[QGIS Commit] r12312 - trunk/qgis/src/app
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Wed Dec 2 16:08:13 EST 2009
Author: jef
Date: 2009-12-02 16:08:12 -0500 (Wed, 02 Dec 2009)
New Revision: 12312
Modified:
trunk/qgis/src/app/qgsspatialitesourceselect.cpp
Log:
fix #2179
Modified: trunk/qgis/src/app/qgsspatialitesourceselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsspatialitesourceselect.cpp 2009-12-02 20:47:39 UTC (rev 12311)
+++ trunk/qgis/src/app/qgsspatialitesourceselect.cpp 2009-12-02 21:08:12 UTC (rev 12312)
@@ -304,40 +304,34 @@
// Retrieve last used project dir from persistent settings
sqlite3 *handle;
QSettings settings;
- QString fullPath;
QString lastUsedDir = settings.value( "/UI/lastSpatiaLiteDir", "." ).toString();
QString myFile = QFileDialog::getOpenFileName( this,
- tr( "Choose a SpatiaLite/SQLite DB to open" ),
- lastUsedDir, QObject::tr( "SQLite DB (*.sqlite);;All files (*.*)" ) );
+ tr( "Choose a SpatiaLite/SQLite DB to open" ),
+ lastUsedDir, QObject::tr( "SQLite DB (*.sqlite);;All files (*.*)" ) );
if ( myFile.isEmpty() )
- {
- QFileInfo myFI( myFile );
- QString myPath = myFI.path();
- QString myName = myFI.fileName();
+ return;
- handle = openSpatiaLiteDb( myFI.canonicalFilePath() );
- if ( handle )
- {
- // OK, this one is a valid SpatiaLite DB
- closeSpatiaLiteDb( handle );
+ QFileInfo myFI( myFile );
+ QString myPath = myFI.path();
+ QString myName = myFI.fileName();
- // Persist last used SpatiaLite dir
- settings.setValue( "/UI/lastSpatiaLiteDir", myPath );
- // inserting this SQLite DB path
- QString baseKey = "/SpatiaLite/connections/";
- settings.setValue( baseKey + "selected", myName );
- baseKey += myName;
- settings.setValue( baseKey + "/sqlitepath", fullPath );
- }
- }
- else
- {
- // if they didn't select anything, just return
+ handle = openSpatiaLiteDb( myFI.canonicalFilePath() );
+ if ( !handle )
return;
- }
+ // OK, this one is a valid SpatiaLite DB
+ closeSpatiaLiteDb( handle );
+
+ // Persist last used SpatiaLite dir
+ settings.setValue( "/UI/lastSpatiaLiteDir", myPath );
+ // inserting this SQLite DB path
+ QString baseKey = "/SpatiaLite/connections/";
+ settings.setValue( baseKey + "selected", myName );
+ baseKey += myName;
+ settings.setValue( baseKey + "/sqlitepath", myFI.canonicalFilePath() );
+
populateConnectionList();
}
More information about the QGIS-commit
mailing list