Skip to content

Commit

Permalink
fixed a cuple of bugs - incorrect Spatialite's DB path handling
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11694 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
esseffe committed Sep 21, 2009
1 parent af62f1c commit ad972f6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/app/qgsspatialitesourceselect.cpp
Expand Up @@ -181,7 +181,7 @@ sqlite3 *QgsSpatiaLiteSourceSelect::openSpatiaLiteDb( const char *path )
// trying to open the SQLite DB
mSqlitePath = QString::fromUtf8( path );

ret = sqlite3_open_v2( mSqlitePath.toUtf8().constData(), &handle, SQLITE_OPEN_READWRITE, NULL );
ret = sqlite3_open_v2( path, &handle, SQLITE_OPEN_READWRITE, NULL );
if ( ret )
{
// failure
Expand Down Expand Up @@ -290,9 +290,8 @@ void QgsSpatiaLiteSourceSelect::populateConnectionList()
while ( it != keys.end() )
{
// retrieving the SQLite DB name and full path
QString text = *it + tr( " @ " );
QString text = *it + tr( "@" );
text += settings.value( *it + "/sqlitepath", "###unknown###" ).toString();

cmbConnections->addItem( text );
++it;
}
Expand Down Expand Up @@ -360,7 +359,7 @@ void QgsSpatiaLiteSourceSelect::deleteConnection()
{
QSettings settings;
QString subKey = cmbConnections->currentText();
int idx = subKey.indexOf( " @ " );
int idx = subKey.indexOf( "@" );
if ( idx > 0 )
subKey.truncate( idx );

Expand Down Expand Up @@ -455,7 +454,7 @@ void QgsSpatiaLiteSourceSelect::on_btnConnect_clicked()

QSettings settings;
QString subKey = cmbConnections->currentText();
int idx = subKey.indexOf( " @ " );
int idx = subKey.indexOf( "@" );
if ( idx > 0 )
subKey.truncate( idx );

Expand Down

0 comments on commit ad972f6

Please sign in to comment.