[QGIS Commit] r12591 - trunk/qgis/src/providers/osm

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Dec 23 07:47:17 EST 2009


Author: wonder
Date: 2009-12-23 07:47:16 -0500 (Wed, 23 Dec 2009)
New Revision: 12591

Modified:
   trunk/qgis/src/providers/osm/osmprovider.cpp
Log:
Reuse OSM db file on windows.
For some strange reason it was not considering the same QDateTime to be equal.

Modified: trunk/qgis/src/providers/osm/osmprovider.cpp
===================================================================
--- trunk/qgis/src/providers/osm/osmprovider.cpp	2009-12-23 11:34:07 UTC (rev 12590)
+++ trunk/qgis/src/providers/osm/osmprovider.cpp	2009-12-23 12:47:16 UTC (rev 12591)
@@ -152,7 +152,7 @@
     QgsDebugMsg( "Opening sqlite3 database failed, OSM provider cannot be constructed." );
     closeDatabase();
     return;
-  };
+  }
 
   // flag determining if OSM file parsing is necessary
   bool shouldParse = true;
@@ -161,7 +161,7 @@
     shouldParse = false;
 
   // test if db file that belongs to source OSM file already exists and if it has the right version
-  if ( shouldParse && databaseExists && isDatabaseCompatibleWithInput( mFileName ) && isDatabaseCompatibleWithProvider() )
+  if ( databaseExists && isDatabaseCompatibleWithInput( mFileName ) && isDatabaseCompatibleWithProvider() )
     shouldParse = false;
 
   if ( shouldParse )
@@ -367,7 +367,7 @@
       // each OSM database schema carry info on last-modified of file from which database was created;
       // if value equals to last-modified of current input file then DB file belongs to current input file
       // (in such case we say that "database is compatible with input")
-      if ( mOsmFileLastModif == oldOsmFileLastModif )
+      if ( mOsmFileLastModif.toTime_t() == oldOsmFileLastModif.toTime_t() )
       {
         sqlite3_finalize( stmtSelectLastModif );
         return true;
@@ -1657,11 +1657,8 @@
 {
   QgsDebugMsg( "Opening database." );
 
-  QByteArray dbfn_bytes  = mDatabaseFileName.toAscii();
-  const char *ptr = dbfn_bytes.data();
-
   // open database
-  if ( sqlite3_open( ptr, &mDatabase ) != SQLITE_OK )
+  if ( sqlite3_open( mDatabaseFileName.toUtf8().data(), &mDatabase ) != SQLITE_OK )
   {
     mError = ( char * ) "Opening SQLite3 database failed.";
     sqlite3_close( mDatabase );



More information about the QGIS-commit mailing list