@@ -152,7 +152,7 @@ QgsOSMDataProvider::QgsOSMDataProvider( QString uri )
152
152
QgsDebugMsg ( " Opening sqlite3 database failed, OSM provider cannot be constructed." );
153
153
closeDatabase ();
154
154
return ;
155
- };
155
+ }
156
156
157
157
// flag determining if OSM file parsing is necessary
158
158
bool shouldParse = true ;
@@ -161,7 +161,7 @@ QgsOSMDataProvider::QgsOSMDataProvider( QString uri )
161
161
shouldParse = false ;
162
162
163
163
// test if db file that belongs to source OSM file already exists and if it has the right version
164
- if ( shouldParse && databaseExists && isDatabaseCompatibleWithInput ( mFileName ) && isDatabaseCompatibleWithProvider () )
164
+ if ( databaseExists && isDatabaseCompatibleWithInput ( mFileName ) && isDatabaseCompatibleWithProvider () )
165
165
shouldParse = false ;
166
166
167
167
if ( shouldParse )
@@ -367,7 +367,7 @@ bool QgsOSMDataProvider::isDatabaseCompatibleWithInput( QString mFileName )
367
367
// each OSM database schema carry info on last-modified of file from which database was created;
368
368
// if value equals to last-modified of current input file then DB file belongs to current input file
369
369
// (in such case we say that "database is compatible with input")
370
- if ( mOsmFileLastModif == oldOsmFileLastModif )
370
+ if ( mOsmFileLastModif . toTime_t () == oldOsmFileLastModif. toTime_t () )
371
371
{
372
372
sqlite3_finalize ( stmtSelectLastModif );
373
373
return true ;
@@ -1657,11 +1657,8 @@ bool QgsOSMDataProvider::openDatabase()
1657
1657
{
1658
1658
QgsDebugMsg ( " Opening database." );
1659
1659
1660
- QByteArray dbfn_bytes = mDatabaseFileName .toAscii ();
1661
- const char *ptr = dbfn_bytes.data ();
1662
-
1663
1660
// open database
1664
- if ( sqlite3_open ( ptr , &mDatabase ) != SQLITE_OK )
1661
+ if ( sqlite3_open ( mDatabaseFileName . toUtf8 (). data () , &mDatabase ) != SQLITE_OK )
1665
1662
{
1666
1663
mError = ( char * ) " Opening SQLite3 database failed." ;
1667
1664
sqlite3_close ( mDatabase );
0 commit comments