Skip to content

Commit 1059204

Browse files
author
esseffe
committedSep 21, 2009
fixed a cuple of bugs - incorrect Spatialite's DB path handling
git-svn-id: http://svn.osgeo.org/qgis/trunk@11694 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 93e3bb3 commit 1059204

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

‎src/app/qgsspatialitesourceselect.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ sqlite3 *QgsSpatiaLiteSourceSelect::openSpatiaLiteDb( const char *path )
181181
// trying to open the SQLite DB
182182
mSqlitePath = QString::fromUtf8( path );
183183

184-
ret = sqlite3_open_v2( mSqlitePath.toUtf8().constData(), &handle, SQLITE_OPEN_READWRITE, NULL );
184+
ret = sqlite3_open_v2( path, &handle, SQLITE_OPEN_READWRITE, NULL );
185185
if ( ret )
186186
{
187187
// failure
@@ -290,9 +290,8 @@ void QgsSpatiaLiteSourceSelect::populateConnectionList()
290290
while ( it != keys.end() )
291291
{
292292
// retrieving the SQLite DB name and full path
293-
QString text = *it + tr( " @ " );
293+
QString text = *it + tr( "@" );
294294
text += settings.value( *it + "/sqlitepath", "###unknown###" ).toString();
295-
296295
cmbConnections->addItem( text );
297296
++it;
298297
}
@@ -360,7 +359,7 @@ void QgsSpatiaLiteSourceSelect::deleteConnection()
360359
{
361360
QSettings settings;
362361
QString subKey = cmbConnections->currentText();
363-
int idx = subKey.indexOf( " @ " );
362+
int idx = subKey.indexOf( "@" );
364363
if ( idx > 0 )
365364
subKey.truncate( idx );
366365

@@ -455,7 +454,7 @@ void QgsSpatiaLiteSourceSelect::on_btnConnect_clicked()
455454

456455
QSettings settings;
457456
QString subKey = cmbConnections->currentText();
458-
int idx = subKey.indexOf( " @ " );
457+
int idx = subKey.indexOf( "@" );
459458
if ( idx > 0 )
460459
subKey.truncate( idx );
461460

0 commit comments

Comments
 (0)
Please sign in to comment.