Skip to content

Commit

Permalink
Use platform native dialog for file open operations
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12293 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Nov 29, 2009
1 parent fe606b7 commit 82693c9
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/app/qgsspatialitesourceselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,13 @@ void QgsSpatiaLiteSourceSelect::addNewConnection()
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();

Expand All @@ -337,11 +335,9 @@ void QgsSpatiaLiteSourceSelect::addNewConnection()
else
{
// if they didn't select anything, just return
delete openFileDialog;
return;
}

delete openFileDialog;
populateConnectionList();
}

Expand Down

0 comments on commit 82693c9

Please sign in to comment.