[QGIS Commit] r8300 - branches/ogr-plugin-branch/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Mar 28 17:52:51 EDT 2008


Author: gcontreras
Date: 2008-03-28 17:52:51 -0400 (Fri, 28 Mar 2008)
New Revision: 8300

Modified:
   branches/ogr-plugin-branch/src/app/qgisapp.cpp
   branches/ogr-plugin-branch/src/app/qgsdbsourceselect.cpp
Log:
fixes to addDatabaseLayer method and fixes to addTables to support
the creation of ogr database layers using the ogr provider.

Modified: branches/ogr-plugin-branch/src/app/qgisapp.cpp
===================================================================
--- branches/ogr-plugin-branch/src/app/qgisapp.cpp	2008-03-28 21:48:04 UTC (rev 8299)
+++ branches/ogr-plugin-branch/src/app/qgisapp.cpp	2008-03-28 21:52:51 UTC (rev 8300)
@@ -2075,7 +2075,7 @@
     QString connInfo = dbs->connInfo();
     //QString connType = dbs->getConnectionType();
     
-    //qDebug("addDatabase :"+connInfo);
+    qDebug("addDatabase :"+connInfo);
     // for each selected table, connect to the database, parse the WKT geometry,
     // and build a cavnasitem for it
     // readWKB(connInfo,tables);

Modified: branches/ogr-plugin-branch/src/app/qgsdbsourceselect.cpp
===================================================================
--- branches/ogr-plugin-branch/src/app/qgsdbsourceselect.cpp	2008-03-28 21:48:04 UTC (rev 8299)
+++ branches/ogr-plugin-branch/src/app/qgsdbsourceselect.cpp	2008-03-28 21:52:51 UTC (rev 8300)
@@ -344,6 +344,8 @@
 }
 void QgsDbSourceSelect::addTables()
 {
+     
+  //check this to support ogr databases   
   m_selectedTables.clear();
 
   typedef QMap<int, QVector<QString> > schemaInfo;
@@ -423,7 +425,16 @@
 		  continue;
 		}
 	    }
-	  query = "\"" + schemaName + "\".\"" + tableName + "\" " + "(" + geomColumnName + ") sql=" + sql;
+	  
+	  //*****************************freddy
+	  QString type=cmbType->currentText();
+	  if(type.contains("Ogr",FALSE)>0)
+       query=tableName;
+      else 
+       query = "\"" + schemaName + "\".\"" + tableName + "\" " + "(" + geomColumnName + ") sql=" + sql; 
+  
+	  //*****************************freddy
+	  
 	  m_selectedTables.push_back(query);
 	}
     }
@@ -684,7 +695,12 @@
 
 QString QgsDbSourceSelect::connInfo()
 {
-  return m_connInfo;
+  //check here     
+  QString type=cmbType->currentText();    
+    if (type.startsWith("Ogr"))
+      return "type="+type+" "+m_connInfo;
+    else  
+      return m_connInfo;
 }
 
 void QgsDbSourceSelect::setSql(const QModelIndex& index)



More information about the QGIS-commit mailing list