[QGIS Commit] r12293 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Nov 29 16:59:36 EST 2009


Author: timlinux
Date: 2009-11-29 16:59:36 -0500 (Sun, 29 Nov 2009)
New Revision: 12293

Modified:
   trunk/qgis/src/app/qgsspatialitesourceselect.cpp
Log:
Use platform native dialog for file open operations

Modified: trunk/qgis/src/app/qgsspatialitesourceselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsspatialitesourceselect.cpp	2009-11-29 21:44:21 UTC (rev 12292)
+++ trunk/qgis/src/app/qgsspatialitesourceselect.cpp	2009-11-29 21:59:36 UTC (rev 12293)
@@ -307,15 +307,13 @@
   QString fullPath;
   QString lastUsedDir = settings.value( "/UI/lastSpatiaLiteDir", "." ).toString();
 
-  QFileDialog *openFileDialog = new QFileDialog( this,
+  QString myFile = QFileDialog::getOpenFileName( this,
       tr( "Choose a SpatiaLite/SQLite DB to open" ),
       lastUsedDir, QObject::tr( "SQLite DB (*.sqlite);;All files (*.*)" ) );
-  openFileDialog->setFileMode( QFileDialog::ExistingFile );
 
-  if ( openFileDialog->exec() == QDialog::Accepted )
+  if ( myFile.isEmpty() )
   {
-    fullPath = openFileDialog->selectedFiles().first();
-    QFileInfo myFI( fullPath );
+    QFileInfo myFI( myFile );
     QString myPath = myFI.path();
     QString myName = myFI.fileName();
 
@@ -337,11 +335,9 @@
   else
   {
     // if they didn't select anything, just return
-    delete openFileDialog;
     return;
   }
 
-  delete openFileDialog;
   populateConnectionList();
 }
 



More information about the QGIS-commit mailing list