summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-11-14 13:51:05 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-15 09:15:35 +0900
commita6615f67cd06a3a4211e0f0fa167d532b4aad706 (patch)
tree323d95423403711b35f42161915282d48675798b /qt-ui
parentb28237309a5fd3af527d71fe0d4dfada7a11107c (diff)
downloadsubsurface-a6615f67cd06a3a4211e0f0fa167d532b4aad706.tar.gz
More code cleanup.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/mainwindow.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 5e7560030..b528ea194 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -99,11 +99,10 @@ void MainWindow::on_actionNew_triggered()
void MainWindow::on_actionOpen_triggered()
{
- QString lastDir = lastUsedDir();
- QString filename = QFileDialog::getOpenFileName(this, tr("Open File"), lastDir, filter());
+ QString filename = QFileDialog::getOpenFileName(this, tr("Open File"), lastUsedDir(), filter());
if (filename.isEmpty())
return;
- updateLastUsedDir(filename);
+ updateLastUsedDir(QFileInfo(filename).dir().path());
on_actionClose_triggered();
loadFiles( QStringList() << filename );
}
@@ -150,12 +149,9 @@ void MainWindow::on_actionClose_triggered()
void MainWindow::on_actionImport_triggered()
{
- QString lastDir = lastUsedDir();
-
- QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Import Files"), lastDir, filter());
+ QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Import Files"), lastUsedDir(), filter());
if (!fileNames.size())
return; // no selection
-
updateLastUsedDir(QFileInfo(fileNames.at(0)).dir().path());
importFiles(fileNames);
}
@@ -181,10 +177,8 @@ void MainWindow::updateLastUsedDir(const QString& dir)
void MainWindow::on_actionExportUDDF_triggered()
{
- QString filename;
QFileInfo fi(system_default_filename());
-
- filename = QFileDialog::getSaveFileName(this, tr("Save File as"), fi.absolutePath(),
+ QString filename = QFileDialog::getSaveFileName(this, tr("Save File as"), fi.absolutePath(),
tr("UDDF files (*.uddf *.UDDF)"));
if (!filename.isNull() && !filename.isEmpty())
export_dives_uddf((const char *)filename.toStdString().c_str(), false);
@@ -228,7 +222,6 @@ void MainWindow::showProfile()
ui.infoPane->setCurrentIndex(MAINTAB);
}
-
void MainWindow::on_actionPreferences_triggered()
{
PreferencesDialog::instance()->show();
@@ -820,7 +813,6 @@ void MainWindow::on_actionImportCSV_triggered()
refreshDisplay();
}
-
void MainWindow::editCurrentDive()
{
if(DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING){