File tree Expand file tree Collapse file tree 2 files changed +49
-25
lines changed Expand file tree Collapse file tree 2 files changed +49
-25
lines changed Original file line number Diff line number Diff line change
1
+ /* **************************************************************************
2
+ qgscplerrorhandler.h - QgsCplErrorHandler
3
+
4
+ ---------------------
5
+ begin : Oct 29, 2003
6
+ copyright : (C) 2003 by Gary E.Sherman
7
+ email : sherman at mrcc.com
8
+ ***************************************************************************
9
+ * *
10
+ * This program is free software; you can redistribute it and/or modify *
11
+ * it under the terms of the GNU General Public License as published by *
12
+ * the Free Software Foundation; either version 2 of the License, or *
13
+ * (at your option) any later version. *
14
+ * *
15
+ ***************************************************************************/
16
+ #ifndef QGSCPLERRORHANDLER_H
17
+ #define QGSCPLERRORHANDLER_H
18
+
19
+ #include " gdal.h"
20
+ #include " qgsmessagelog.h"
21
+
22
+ class QgsCPLErrorHandler
23
+ {
24
+ static void CPL_STDCALL showError ( CPLErr errClass, int errNo, const char *msg )
25
+ {
26
+ if ( errNo != OGRERR_NONE )
27
+ QgsMessageLog::logMessage ( QObject::tr ( " OGR[%1] error %2: %3" ).arg ( errClass ).arg ( errNo ).arg ( msg ), QObject::tr ( " OGR" ) );
28
+ }
29
+
30
+ public:
31
+ QgsCPLErrorHandler ()
32
+ {
33
+ CPLPushErrorHandler ( showError );
34
+ }
35
+
36
+ ~QgsCPLErrorHandler ()
37
+ {
38
+ CPLPopErrorHandler ();
39
+ }
40
+
41
+ private:
42
+ QgsCPLErrorHandler ( const QgsCPLErrorHandler &other );
43
+ QgsCPLErrorHandler &operator =( const QgsCPLErrorHandler &other );
44
+
45
+ };
46
+
47
+
48
+ #endif // QGSCPLERRORHANDLER_H
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ email : sherman at mrcc.com
16
16
***************************************************************************/
17
17
18
18
#include " qgsogrprovider.h"
19
+ #include " qgscplerrorhandler.h"
19
20
#include " qgsogrfeatureiterator.h"
20
21
#include " qgslogger.h"
21
22
#include " qgsmessagelog.h"
@@ -80,31 +81,6 @@ static const QString TEXT_PROVIDER_DESCRIPTION =
80
81
81
82
static OGRwkbGeometryType ogrWkbGeometryTypeFromName( const QString &typeName );
82
83
83
- class QgsCPLErrorHandler
84
- {
85
- static void CPL_STDCALL showError( CPLErr errClass, int errNo, const char *msg )
86
- {
87
- if ( errNo != OGRERR_NONE )
88
- QgsMessageLog::logMessage( QObject::tr( " OGR[%1 ] error %2 : %3 " ).arg( errClass ).arg( errNo ).arg( msg ), QObject::tr( " OGR" ) );
89
- }
90
-
91
- public:
92
- QgsCPLErrorHandler()
93
- {
94
- CPLPushErrorHandler( showError );
95
- }
96
-
97
- ~QgsCPLErrorHandler()
98
- {
99
- CPLPopErrorHandler();
100
- }
101
-
102
- private:
103
- QgsCPLErrorHandler( const QgsCPLErrorHandler &other );
104
- QgsCPLErrorHandler &operator=( const QgsCPLErrorHandler &other );
105
-
106
- };
107
-
108
84
109
85
bool QgsOgrProvider::convertField( QgsField &field, const QTextCodec &encoding )
110
86
{
You can’t perform that action at this time.
0 commit comments