[QGIS Commit] r9019 - in trunk/qgis/src: app core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Aug 7 05:54:28 EDT 2008


Author: jef
Date: 2008-08-07 05:54:28 -0400 (Thu, 07 Aug 2008)
New Revision: 9019

Modified:
   trunk/qgis/src/app/qgsbookmarks.cpp
   trunk/qgis/src/app/qgscustomprojectiondialog.cpp
   trunk/qgis/src/core/qgsmaplayer.cpp
Log:
fix qml support for non-file data sources

Modified: trunk/qgis/src/app/qgsbookmarks.cpp
===================================================================
--- trunk/qgis/src/app/qgsbookmarks.cpp	2008-08-07 09:52:57 UTC (rev 9018)
+++ trunk/qgis/src/app/qgsbookmarks.cpp	2008-08-07 09:54:28 UTC (rev 9019)
@@ -251,7 +251,7 @@
 
   int rc;
   rc = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &db);
-  if(rc)
+  if(rc!=SQLITE_OK)
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(db) << std::endl;
 

Modified: trunk/qgis/src/app/qgscustomprojectiondialog.cpp
===================================================================
--- trunk/qgis/src/app/qgscustomprojectiondialog.cpp	2008-08-07 09:52:57 UTC (rev 9018)
+++ trunk/qgis/src/app/qgscustomprojectiondialog.cpp	2008-08-07 09:54:28 UTC (rev 9019)
@@ -105,14 +105,13 @@
   int           myResult;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
-
   // Set up the query to retrieve the projection information needed to populate the PROJECTION list
   QString mySql = "select * from tbl_projection order by name";
   myResult = sqlite3_prepare(myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail);
@@ -140,14 +139,13 @@
   int           myResult;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
-
   // Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
   QString mySql = "select * from tbl_ellipsoid order by name";
   myResult = sqlite3_prepare(myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail);
@@ -184,12 +182,12 @@
   QString       myName;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
   // Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
   QString mySql = "delete from tbl_srs where srs_id='" + mCurrentRecordId + "'";
@@ -244,12 +242,12 @@
   long          myRecordCount=0;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
   // Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
   QString mySql = "select count(*) from tbl_srs";
@@ -279,12 +277,12 @@
   QString       myName;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
   // Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
   QString mySql = "select name from tbl_projection where acronym='" + theProjectionFamilyAcronym + "'";
@@ -310,12 +308,12 @@
   QString       myName;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
   // Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
   QString mySql = "select name from tbl_ellipsoid where acronym='" + theEllipsoidAcronym + "'";
@@ -341,12 +339,12 @@
   QString       myName;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
   // Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
   QString mySql = "select acronym from tbl_projection where name='" + theProjectionFamilyName + "'";
@@ -372,12 +370,12 @@
   QString       myName;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
   // Set up the query to retrieve the projection information needed to populate the ELLIPSOID list
   QString mySql = "select acronym from tbl_ellipsoid where name='" + theEllipsoidName + "'";
@@ -406,12 +404,12 @@
   int           myResult;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
 
   QString mySql = "select * from tbl_srs order by srs_id limit 1";
@@ -484,12 +482,12 @@
   int           myResult;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
 
   QString mySql = "select * from tbl_srs where srs_id < " + mCurrentRecordId + " order by srs_id desc limit 1";
@@ -563,15 +561,14 @@
   int           myResult;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
 
-
   QString mySql = "select * from tbl_srs where srs_id > " + mCurrentRecordId + " order by srs_id asc limit 1";
 #ifdef QGISDEBUG
     std::cout << "Query to move next:" << mySql.toLocal8Bit().data() << std::endl;
@@ -639,12 +636,12 @@
   int           myResult;
   //check the db is available
   myResult = sqlite3_open(QgsApplication::qgisUserDbFilePath().toUtf8().data(), &myDatabase);
-  if(myResult) 
+  if(myResult!=SQLITE_OK) 
   {
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
 
   QString mySql = "select * from tbl_srs order by srs_id desc limit 1";
@@ -868,7 +865,7 @@
         << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
 #ifdef QGISDEBUG
   std::cout << "Update or insert sql \n" << mySql.toLocal8Bit().data() << std::endl;
@@ -993,9 +990,8 @@
     std::cout <<  "Can't open database: " <<  sqlite3_errmsg(myDatabase) << std::endl; 
     // XXX This will likely never happen since on open, sqlite creates the 
     //     database if it does not exist.
-    assert(myResult == 0);
+    assert(myResult == SQLITE_OK);
   }
-
   // Set up the query to retrieve the projection information needed to populate the PROJECTION list
   QString mySql = "select parameters from tbl_projection name where name='"+theText+"'";
 #ifdef QGISDEBUG

Modified: trunk/qgis/src/core/qgsmaplayer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaplayer.cpp	2008-08-07 09:52:57 UTC (rev 9018)
+++ trunk/qgis/src/core/qgsmaplayer.cpp	2008-08-07 09:54:28 UTC (rev 9019)
@@ -434,7 +434,7 @@
   QgsDebugMsg( QString("Trying to load style for \"%1\" from \"%2\"").arg(theURI).arg(db) );
 
   myResult = sqlite3_open(db.toUtf8().data(), &myDatabase);
-  if (!myResult)
+  if (myResult!=SQLITE_OK)
   {
     return false;
   }
@@ -610,7 +610,7 @@
     int myResult;
 
     myResult = sqlite3_open( QDir( QgsApplication::qgisSettingsDirPath() ).absoluteFilePath( "qgis.qmldb").toUtf8().data(), &myDatabase);
-    if (myResult)
+    if (myResult!=SQLITE_OK)
     {
       return tr("User database could not be opened.");
     }



More information about the QGIS-commit mailing list