Skip to content

Commit

Permalink
fix #1857
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11477 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 22, 2009
1 parent 3f33638 commit 934b69d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/app/qgsspatialitesourceselect.cpp
Expand Up @@ -179,9 +179,9 @@ sqlite3 *QgsSpatiaLiteSourceSelect::openSpatiaLiteDb( const char *path )
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
Expand Down
4 changes: 1 addition & 3 deletions src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -1365,7 +1365,6 @@ void QgsSpatiaLiteProvider::closeDb()

QgsSpatiaLiteProvider::SqliteHandles * QgsSpatiaLiteProvider::SqliteHandles::openDb( const QString & dbPath )
{
char path[1024];
sqlite3 *sqlite_handle;

QMap < QString, QgsSpatiaLiteProvider::SqliteHandles * >&handles = QgsSpatiaLiteProvider::SqliteHandles::handles;
Expand All @@ -1378,8 +1377,7 @@ QgsSpatiaLiteProvider::SqliteHandles * QgsSpatiaLiteProvider::SqliteHandles::ope
}

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

Expand Down

0 comments on commit 934b69d

Please sign in to comment.