[QGIS Commit] r11477 - in trunk/qgis/src: app providers/spatialite

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Aug 22 04:02:23 EDT 2009


Author: jef
Date: 2009-08-22 04:02:22 -0400 (Sat, 22 Aug 2009)
New Revision: 11477

Modified:
   trunk/qgis/src/app/qgsspatialitesourceselect.cpp
   trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp
Log:
fix #1857

Modified: trunk/qgis/src/app/qgsspatialitesourceselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsspatialitesourceselect.cpp	2009-08-22 07:01:27 UTC (rev 11476)
+++ trunk/qgis/src/app/qgsspatialitesourceselect.cpp	2009-08-22 08:02:22 UTC (rev 11477)
@@ -179,9 +179,9 @@
   QString errCause;
 
   // trying to open the SQLite DB
-  mSqlitePath = path;
+  mSqlitePath = QString::fromUtf8( path );
 
-  ret = sqlite3_open_v2( path, &handle, SQLITE_OPEN_READWRITE, NULL );
+  ret = sqlite3_open_v2( mSqlitePath.toUtf8().constData(), &handle, SQLITE_OPEN_READWRITE, NULL );
   if ( ret )
   {
     // failure

Modified: trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp
===================================================================
--- trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp	2009-08-22 07:01:27 UTC (rev 11476)
+++ trunk/qgis/src/providers/spatialite/qgsspatialiteprovider.cpp	2009-08-22 08:02:22 UTC (rev 11477)
@@ -1365,7 +1365,6 @@
 
 QgsSpatiaLiteProvider::SqliteHandles * QgsSpatiaLiteProvider::SqliteHandles::openDb( const QString & dbPath )
 {
-  char path[1024];
   sqlite3 *sqlite_handle;
 
   QMap < QString, QgsSpatiaLiteProvider::SqliteHandles * >&handles = QgsSpatiaLiteProvider::SqliteHandles::handles;
@@ -1378,8 +1377,7 @@
   }
 
   QgsDebugMsg( QString( "New sqlite connection for " ) + dbPath );
-  strcpy( path, dbPath.toUtf8().constData() );
-  if ( sqlite3_open_v2( path, &sqlite_handle, SQLITE_OPEN_READWRITE, NULL ) )
+  if ( sqlite3_open_v2( dbPath.toUtf8().constData(), &sqlite_handle, SQLITE_OPEN_READWRITE, NULL ) )
   {
     // failure
 



More information about the QGIS-commit mailing list