diff options
Diffstat (limited to 'ui/qt/main_window_slots.cpp')
-rw-r--r-- | ui/qt/main_window_slots.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 1c6d945808..947914411c 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -275,8 +275,7 @@ bool MainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned break; } - // get_dirname overwrites its path. - wsApp->setLastOpenDir(get_dirname(cf_path.toUtf8().data())); + wsApp->setLastOpenDirFromFilename(cf_path); main_ui_->statusBar->showExpert(); @@ -760,16 +759,12 @@ void MainWindow::captureFileReadStarted(const QString &action) { } void MainWindow::captureFileReadFinished() { - gchar *dir_path; - if (!capture_file_.capFile()->is_tempfile && capture_file_.capFile()->filename) { /* Add this filename to the list of recent files in the "Recent Files" submenu */ add_menu_recent_capture_file(capture_file_.capFile()->filename); /* Remember folder for next Open dialog and save it in recent */ - dir_path = g_strdup(capture_file_.capFile()->filename); - wsApp->setLastOpenDir(get_dirname(dir_path)); - g_free(dir_path); + wsApp->setLastOpenDirFromFilename(capture_file_.capFile()->filename); } /* Update the appropriate parts of the main window. */ @@ -1802,7 +1797,7 @@ void MainWindow::on_actionFileExportPacketBytes_triggered() write_file_binary_mode(qUtf8Printable(file_name), data_p, capture_file_.capFile()->finfo_selected->length); /* Save the directory name for future file dialogs. */ - wsApp->setLastOpenDir(file_name); + wsApp->setLastOpenDirFromFilename(file_name); } } @@ -1861,7 +1856,7 @@ void MainWindow::on_actionFileExportTLSSessionKeys_triggered() write_file_binary_mode(qUtf8Printable(file_name), keylist, keylist_length); /* Save the directory name for future file dialogs. */ - wsApp->setLastOpenDir(file_name); + wsApp->setLastOpenDirFromFilename(file_name); g_free(keylist); } } |