Skip to content

Commit 3d601d7

Browse files
author
timlinux
committedNov 27, 2007

File tree

1 file changed

+36
-31
lines changed

1 file changed

+36
-31
lines changed
 

‎src/plugins/grass/qgsgrassmodule.cpp

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,7 @@
1515
***************************************************************************/
1616
#include <iostream>
1717

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+
2919
#include <q3cstring.h>
3020
#include <q3groupbox.h>
3121
#include <q3listbox.h>
@@ -40,14 +30,20 @@
4030
#include <q3textbrowser.h>
4131
#include <qapplication.h>
4232
#include <qcolordialog.h>
33+
#include <QComboBox>
4334
#include <qcursor.h>
4435
#include <qdir.h>
45-
#include <qdir.h>
4636
#include <qdom.h>
37+
#include <QDoubleValidator>
4738
#include <qevent.h>
39+
#include <QFileDialog>
4840
#include <qfile.h>
41+
#include <QGridLayout>
42+
#include <QGroupBox>
43+
#include <QHBoxLayout>
4944
#include <qimage.h>
5045
#include <qinputdialog.h>
46+
#include <QIntValidator>
5147
#include <qlabel.h>
5248
#include <qlayout.h>
5349
#include <qlineedit.h>
@@ -57,16 +53,19 @@
5753
#include <qpen.h>
5854
#include <qpixmap.h>
5955
#include <qpoint.h>
56+
#include <QProcess>
57+
#include <QPushButton>
6058
#include <qpushbutton.h>
6159
#include <qregexp.h>
60+
#include <QRegExpValidator>
6261
#include <qsettings.h>
6362
#include <qsize.h>
6463
#include <qspinbox.h>
6564
#include <qstatusbar.h>
6665
#include <qstringlist.h>
6766
#include <qtabwidget.h>
6867
#include <QUrl>
69-
68+
#include <QVBoxLayout>
7069
#include "qgis.h"
7170
#include "qgisinterface.h"
7271
#include "qgsapplication.h"
@@ -93,6 +92,8 @@ extern "C" {
9392
#include "qgsgrasstools.h"
9493
#include "qgsgrassselect.h"
9594

95+
#include <gdal.h> // to collect version information
96+
9697
bool QgsGrassModule::mExecPathInited = 0;
9798
QStringList QgsGrassModule::mExecPath;
9899

@@ -2701,26 +2702,30 @@ QStringList QgsGrassModuleGdalInput::options()
27012702

27022703
if ( !mOgrLayerOption.isNull() && mOgrLayers[current].length() > 0 )
27032704
{
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);
27102715

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.") );
27212725
}
2722-
2723-
list.push_back( opt );
2726+
}
2727+
#endif //GDAL_VERSION_NUM
2728+
list.push_back( opt );
27242729
}
27252730

27262731
return list;

0 commit comments

Comments
 (0)
Please sign in to comment.