Skip to content
Permalink
Browse files

Fix compilation errors under gcc:

 qgis/src/app/qgsdbsourceselect.cpp:308: error: ‘>>’ should be ‘> >’ within a nested template argument list
 qgis/src/app/qgsdbsourceselect.cpp:445: error: ‘>>’ should be ‘> >’ within a nested template argument list

gcc does not allow you to make nested template calls like this:

  Foo <bar<xyz>>

The conjoined >> must have at least one space otherwise a compilation error will result.

Also replaced tabs with 2 spaces.




git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7619 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Nov 20, 2007
1 parent 4a2f93c commit 8e019c14a7c1c1d2e4a0938d50d40c05b5853b3f
Showing with 51 additions and 50 deletions.
  1. +51 −50 src/app/qgsdbsourceselect.cpp
@@ -299,31 +299,32 @@ void QgsDbSourceSelect::addTables()
QString query = table + " sql=";

QComboBox *cb = static_cast<QComboBox *>( lstTables->cellWidget(i, dbssType) );
if(cb) {
int i = table.find("(");
int j = table.find(")");
QString column = table.mid(i+1,j-i-1);
QString type;

QMapIterator <QString, QPair<QString, QIcon>> it(mLayerIcons);
while( it.hasNext() ) {
it.next();

if( it.value().first == cb->currentText() ) {
type=it.key();
break;
}
}

if( type=="POINT" ) {
query += QString("GeometryType(\"%1\") IN ('POINT','MULTIPOINT')").arg(column);
} else if(type=="LINESTRING") {
query += QString("GeometryType(\"%1\") IN ('LINESTRING','MULTILINESTRING')").arg(column);
} else if(type=="POLYGON") {
query += QString("GeometryType(\"%1\") IN ('POLYGON','MULTIPOLYGON')").arg(column);
} else {
continue;
}
if(cb)
{
int i = table.find("(");
int j = table.find(")");
QString column = table.mid(i+1,j-i-1);
QString type;

QMapIterator <QString, QPair < QString, QIcon > > it(mLayerIcons);
while( it.hasNext() ) {
it.next();

if( it.value().first == cb->currentText() ) {
type=it.key();
break;
}
}

if( type=="POINT" ) {
query += QString("GeometryType(\"%1\") IN ('POINT','MULTIPOINT')").arg(column);
} else if(type=="LINESTRING") {
query += QString("GeometryType(\"%1\") IN ('LINESTRING','MULTILINESTRING')").arg(column);
} else if(type=="POLYGON") {
query += QString("GeometryType(\"%1\") IN ('POLYGON','MULTIPOLYGON')").arg(column);
} else {
continue;
}
}

QTableWidgetItem *sqlItem = lstTables->item(i, dbssSql);
@@ -407,47 +408,47 @@ void QgsDbSourceSelect::on_btnConnect_clicked()
{
QString myThemePath = QgsApplication::themePath();
mLayerIcons.insert("POINT",
qMakePair(tr("Point layer"),
QIcon(myThemePath+"/mIconPointLayer.png")));
qMakePair(tr("Point layer"),
QIcon(myThemePath+"/mIconPointLayer.png")));
mLayerIcons.insert("MULTIPOINT",
qMakePair(tr("Multi-point layer"),
mLayerIcons.value("POINT").second));
qMakePair(tr("Multi-point layer"),
mLayerIcons.value("POINT").second));

mLayerIcons.insert("LINESTRING",
qMakePair(tr("Linestring layer"),
QIcon(myThemePath+"/mIconLineLayer.png")));
qMakePair(tr("Linestring layer"),
QIcon(myThemePath+"/mIconLineLayer.png")));
mLayerIcons.insert("MULTILINESTRING",
qMakePair(tr("Multi-linestring layer"),
mLayerIcons.value("LINESTRING").second));
qMakePair(tr("Multi-linestring layer"),
mLayerIcons.value("LINESTRING").second));

mLayerIcons.insert("POLYGON",
qMakePair(tr("Polygon layer"),
QIcon(myThemePath+"/mIconPolygonLayer.png")));
qMakePair(tr("Polygon layer"),
QIcon(myThemePath+"/mIconPolygonLayer.png")));
mLayerIcons.insert("MULTIPOLYGON",
qMakePair(tr("Multi-polygon layer"),
mLayerIcons.value("POLYGON").second));
qMakePair(tr("Multi-polygon layer"),
mLayerIcons.value("POLYGON").second));

mLayerIcons.insert("GEOMETRY",
qMakePair(tr("Mixed geometry layer"),
QIcon(myThemePath+"/mIconGeometryLayer.png")));
qMakePair(tr("Mixed geometry layer"),
QIcon(myThemePath+"/mIconGeometryLayer.png")));
mLayerIcons.insert("GEOMETRYCOLLECTION",
qMakePair(tr("Geometry collection layer"),
mLayerIcons.value("GEOMETRY").second));
qMakePair(tr("Geometry collection layer"),
mLayerIcons.value("GEOMETRY").second));

mLayerIcons.insert("WAITING",
qMakePair(tr("Waiting for layer type"),
QIcon(myThemePath+"/mIconWaitingForLayerType.png")));
qMakePair(tr("Waiting for layer type"),
QIcon(myThemePath+"/mIconWaitingForLayerType.png")));
mLayerIcons.insert("UNKNOWN",
qMakePair(tr("Unknown layer type"),
QIcon(myThemePath+"/mIconUnknownLayerType.png")));
qMakePair(tr("Unknown layer type"),
QIcon(myThemePath+"/mIconUnknownLayerType.png")));

mCbMinLength = 0;
QMapIterator <QString, QPair<QString, QIcon>> it(mLayerIcons);
mCbMinLength = 0;
QMapIterator <QString, QPair < QString, QIcon > > it(mLayerIcons);
while( it.hasNext() ) {
it.next();
int len = it.value().first.length();;
mCbMinLength = mCbMinLength<len ? len : mCbMinLength;
}
int len = it.value().first.length();;
mCbMinLength = mCbMinLength<len ? len : mCbMinLength;
}
}
//qDebug("Connection succeeded");
// tell the DB that we want text encoded in UTF8

0 comments on commit 8e019c1

Please sign in to comment.
You can’t perform that action at this time.