File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -307,15 +307,13 @@ void QgsSpatiaLiteSourceSelect::addNewConnection()
307
307
QString fullPath;
308
308
QString lastUsedDir = settings.value ( " /UI/lastSpatiaLiteDir" , " ." ).toString ();
309
309
310
- QFileDialog *openFileDialog = new QFileDialog ( this ,
310
+ QString myFile = QFileDialog::getOpenFileName ( this ,
311
311
tr ( " Choose a SpatiaLite/SQLite DB to open" ),
312
312
lastUsedDir, QObject::tr ( " SQLite DB (*.sqlite);;All files (*.*)" ) );
313
- openFileDialog->setFileMode ( QFileDialog::ExistingFile );
314
313
315
- if ( openFileDialog-> exec () == QDialog::Accepted )
314
+ if ( myFile. isEmpty () )
316
315
{
317
- fullPath = openFileDialog->selectedFiles ().first ();
318
- QFileInfo myFI ( fullPath );
316
+ QFileInfo myFI ( myFile );
319
317
QString myPath = myFI.path ();
320
318
QString myName = myFI.fileName ();
321
319
@@ -337,11 +335,9 @@ void QgsSpatiaLiteSourceSelect::addNewConnection()
337
335
else
338
336
{
339
337
// if they didn't select anything, just return
340
- delete openFileDialog;
341
338
return ;
342
339
}
343
340
344
- delete openFileDialog;
345
341
populateConnectionList ();
346
342
}
347
343
You can’t perform that action at this time.
0 commit comments