diff --git a/desktop-widgets/divelistview.h b/desktop-widgets/divelistview.h index 7d3b78cc1..47b9b5aeb 100644 --- a/desktop-widgets/divelistview.h +++ b/desktop-widgets/divelistview.h @@ -35,6 +35,7 @@ public: void restoreSelection(); void contextMenuEvent(QContextMenuEvent *event); QList selectedTrips(); + static QString lastUsedImageDir(); public slots: void toggleColumnVisibilityByIndex(); @@ -56,7 +57,6 @@ slots: void shiftTimes(); void loadImages(); void loadWebImages(); - static QString lastUsedImageDir(); signals: void currentDiveChanged(int divenr); diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 087ccc228..3d984ab15 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -544,6 +544,18 @@ void MainWindow::on_actionNew_triggered() on_actionClose_triggered(); } +static QString lastUsedDir() +{ + QSettings settings; + QString lastDir = QDir::homePath(); + + settings.beginGroup("FileDialog"); + if (settings.contains("LastDir")) + if (QDir(settings.value("LastDir").toString()).exists()) + lastDir = settings.value("LastDir").toString(); + return lastDir; +} + void MainWindow::on_actionOpen_triggered() { if (!okToClose(tr("Please save or cancel the current dive edit before opening a new file."))) @@ -784,18 +796,6 @@ void MainWindow::on_actionClose_triggered() } } -QString MainWindow::lastUsedDir() -{ - QSettings settings; - QString lastDir = QDir::homePath(); - - settings.beginGroup("FileDialog"); - if (settings.contains("LastDir")) - if (QDir(settings.value("LastDir").toString()).exists()) - lastDir = settings.value("LastDir").toString(); - return lastDir; -} - void MainWindow::updateLastUsedDir(const QString &dir) { QSettings s; diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h index 00ddd86b7..6c2b7c1f4 100644 --- a/desktop-widgets/mainwindow.h +++ b/desktop-widgets/mainwindow.h @@ -213,7 +213,6 @@ private: void beginChangeState(CurrentState s); void saveSplitterSizes(); void toggleCollapsible(bool toggle); - QString lastUsedDir(); void updateLastUsedDir(const QString &s); void registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *topRight, QWidget *bottomLeft, QWidget *bottomRight); void enterState(CurrentState); diff --git a/smtk-import/smrtk2ssrfc_window.cpp b/smtk-import/smrtk2ssrfc_window.cpp index 344bd4642..e44abe10c 100644 --- a/smtk-import/smrtk2ssrfc_window.cpp +++ b/smtk-import/smrtk2ssrfc_window.cpp @@ -35,7 +35,7 @@ Smrtk2ssrfcWindow::~Smrtk2ssrfcWindow() delete ui; } -QString Smrtk2ssrfcWindow::lastUsedDir() +static QString lastUsedDir() { QSettings settings; QString lastDir = QDir::homePath(); diff --git a/smtk-import/smrtk2ssrfc_window.h b/smtk-import/smrtk2ssrfc_window.h index 71bfdfd15..c66653094 100644 --- a/smtk-import/smrtk2ssrfc_window.h +++ b/smtk-import/smrtk2ssrfc_window.h @@ -22,7 +22,6 @@ public: private: Ui::Smrtk2ssrfcWindow *ui; - QString lastUsedDir(); QString filter(); void updateLastUsedDir(const QString &s); void closeCurrentFile();