diff options
author | abcd <qt-info@nokia.com> | 2010-07-15 11:15:10 +1000 |
---|---|---|
committer | abcd <qt-info@nokia.com> | 2010-07-15 11:15:10 +1000 |
commit | f19a7eb43e38dd3bcac18e81f90b4108eeccdce5 (patch) | |
tree | 194968ae9cd077dfa98f2b59306cd32ec4cfad5a | |
parent | 32991beb4c36bdb5de059dd33b9498f60e9aa40c (diff) |
Try using the native file dialog instead for the landmarkbrowser
-rw-r--r-- | examples/landmarkbrowser/landmarkbrowser.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/examples/landmarkbrowser/landmarkbrowser.cpp b/examples/landmarkbrowser/landmarkbrowser.cpp index adb9c454be..6abb7c81be 100644 --- a/examples/landmarkbrowser/landmarkbrowser.cpp +++ b/examples/landmarkbrowser/landmarkbrowser.cpp @@ -58,22 +58,14 @@ LandmarkBrowser::~LandmarkBrowser() void LandmarkBrowser::on_importLandmarks_clicked() { - QFileDialog fileDialog(this, tr("Import File"), ".", tr("Landmark files (*.gpx)")); - fileDialog.setFileMode(QFileDialog::ExistingFile); - QStringList selectedFiles; - if (fileDialog.exec()) { - selectedFiles = fileDialog.selectedFiles(); - if (selectedFiles.count() ==0 ) - return; - } else { - return; - } + QString fileName = QFileDialog::getOpenFileName(this,tr("Import File"),".",tr("Landmark files (*.gpx)")); + if (!fileName.isEmpty()) { + landmarkImport->setFileName(fileName); + landmarkImport->setFormat("GpxV1.1"); + landmarkImport->start(); - landmarkImport->setFileName(selectedFiles.at(0)); - landmarkImport->setFormat("GpxV1.1"); - landmarkImport->start(); - - progress->show(); + progress->show(); + } } void LandmarkBrowser::on_fetchLandmarks_clicked() |