15
15
***************************************************************************/
16
16
#include < iostream>
17
17
18
- #include < QComboBox>
19
- #include < QDoubleValidator>
20
- #include < QFileDialog>
21
- #include < QGridLayout>
22
- #include < QGroupBox>
23
- #include < QHBoxLayout>
24
- #include < QIntValidator>
25
- #include < QProcess>
26
- #include < QPushButton>
27
- #include < QRegExpValidator>
28
- #include < QVBoxLayout>
18
+
29
19
#include < q3cstring.h>
30
20
#include < q3groupbox.h>
31
21
#include < q3listbox.h>
40
30
#include < q3textbrowser.h>
41
31
#include < qapplication.h>
42
32
#include < qcolordialog.h>
33
+ #include < QComboBox>
43
34
#include < qcursor.h>
44
35
#include < qdir.h>
45
- #include < qdir.h>
46
36
#include < qdom.h>
37
+ #include < QDoubleValidator>
47
38
#include < qevent.h>
39
+ #include < QFileDialog>
48
40
#include < qfile.h>
41
+ #include < QGridLayout>
42
+ #include < QGroupBox>
43
+ #include < QHBoxLayout>
49
44
#include < qimage.h>
50
45
#include < qinputdialog.h>
46
+ #include < QIntValidator>
51
47
#include < qlabel.h>
52
48
#include < qlayout.h>
53
49
#include < qlineedit.h>
57
53
#include < qpen.h>
58
54
#include < qpixmap.h>
59
55
#include < qpoint.h>
56
+ #include < QProcess>
57
+ #include < QPushButton>
60
58
#include < qpushbutton.h>
61
59
#include < qregexp.h>
60
+ #include < QRegExpValidator>
62
61
#include < qsettings.h>
63
62
#include < qsize.h>
64
63
#include < qspinbox.h>
65
64
#include < qstatusbar.h>
66
65
#include < qstringlist.h>
67
66
#include < qtabwidget.h>
68
67
#include < QUrl>
69
-
68
+ # include < QVBoxLayout >
70
69
#include " qgis.h"
71
70
#include " qgisinterface.h"
72
71
#include " qgsapplication.h"
@@ -93,6 +92,8 @@ extern "C" {
93
92
#include " qgsgrasstools.h"
94
93
#include " qgsgrassselect.h"
95
94
95
+ #include < gdal.h> // to collect version information
96
+
96
97
bool QgsGrassModule::mExecPathInited = 0 ;
97
98
QStringList QgsGrassModule::mExecPath ;
98
99
@@ -2701,26 +2702,30 @@ QStringList QgsGrassModuleGdalInput::options()
2701
2702
2702
2703
if ( !mOgrLayerOption .isNull () && mOgrLayers [current].length () > 0 )
2703
2704
{
2704
- opt = mOgrLayerOption + " =" ;
2705
-
2706
- // OGR does not support schemas !!!
2707
- if ( current >=0 && current < mUri .size () ) {
2708
- QStringList l = mOgrLayers [current].split (" ." );
2709
- opt += l.at (1 );
2705
+ opt = mOgrLayerOption + " =" ;
2706
+ #if GDAL_VERSION_NUM >= 1400 // need to check for GRASS >= 6.2 here too...
2707
+ opt += mOgrLayers [current];
2708
+ #else
2709
+ // Handle older versions of gdal gracefully
2710
+ // OGR does not support schemas !!!
2711
+ if ( current >=0 && current < mUri .size () )
2712
+ {
2713
+ QStringList l = mOgrLayers [current].split (" ." );
2714
+ opt += l.at (1 );
2710
2715
2711
- // Currently only PostGIS is using layer
2712
- // -> layer -> PostGIS -> warning
2713
- if ( mOgrLayers [current].length () > 0 )
2714
- {
2715
- QMessageBox::warning ( 0 , tr (" Warning" ),
2716
- tr (" PostGIS driver in OGR does not support schemas!<br>"
2717
- " Only the table name will be used.<br>"
2718
- " It can result in wrong input if more tables of the same name<br>"
2719
- " are present in the database." ) );
2720
- }
2716
+ // Currently only PostGIS is using layer
2717
+ // -> layer -> PostGIS -> warning
2718
+ if ( mOgrLayers [current].length () > 0 )
2719
+ {
2720
+ QMessageBox::warning ( 0 , tr (" Warning" ),
2721
+ tr (" PostGIS driver in OGR does not support schemas!<br>"
2722
+ " Only the table name will be used.<br>"
2723
+ " It can result in wrong input if more tables of the same name<br>"
2724
+ " are present in the database." ) );
2721
2725
}
2722
-
2723
- list.push_back ( opt );
2726
+ }
2727
+ #endif // GDAL_VERSION_NUM
2728
+ list.push_back ( opt );
2724
2729
}
2725
2730
2726
2731
return list;
0 commit comments