Skip to content

Commit e140945

Browse files
author
timlinux
committedNov 29, 2009
Use platform native dialog for file open operations
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12293 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed
 

‎src/app/qgsspatialitesourceselect.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,13 @@ void QgsSpatiaLiteSourceSelect::addNewConnection()
307307
QString fullPath;
308308
QString lastUsedDir = settings.value( "/UI/lastSpatiaLiteDir", "." ).toString();
309309

310-
QFileDialog *openFileDialog = new QFileDialog( this,
310+
QString myFile = QFileDialog::getOpenFileName( this,
311311
tr( "Choose a SpatiaLite/SQLite DB to open" ),
312312
lastUsedDir, QObject::tr( "SQLite DB (*.sqlite);;All files (*.*)" ) );
313-
openFileDialog->setFileMode( QFileDialog::ExistingFile );
314313

315-
if ( openFileDialog->exec() == QDialog::Accepted )
314+
if ( myFile.isEmpty() )
316315
{
317-
fullPath = openFileDialog->selectedFiles().first();
318-
QFileInfo myFI( fullPath );
316+
QFileInfo myFI( myFile );
319317
QString myPath = myFI.path();
320318
QString myName = myFI.fileName();
321319

@@ -337,11 +335,9 @@ void QgsSpatiaLiteSourceSelect::addNewConnection()
337335
else
338336
{
339337
// if they didn't select anything, just return
340-
delete openFileDialog;
341338
return;
342339
}
343340

344-
delete openFileDialog;
345341
populateConnectionList();
346342
}
347343

0 commit comments

Comments
 (0)
Please sign in to comment.