diff --git a/src/mkvtoolnix-gui/chapter_editor/tab.cpp b/src/mkvtoolnix-gui/chapter_editor/tab.cpp index e451128d8..f868b205d 100644 --- a/src/mkvtoolnix-gui/chapter_editor/tab.cpp +++ b/src/mkvtoolnix-gui/chapter_editor/tab.cpp @@ -689,10 +689,10 @@ Tab::saveAsImpl(bool requireNewFileName, p->savedState = currentState(); if (newFileName != p->fileName) { - p->fileName = newFileName; + p->fileName = newFileName; - auto &settings = Util::Settings::get(); - settings.m_lastOpenDir = QFileInfo{newFileName}.path(); + auto &settings = Util::Settings::get(); + settings.m_lastOpenDir.setPath(QFileInfo{newFileName}.path()); settings.save(); updateFileNameDisplay(); diff --git a/src/mkvtoolnix-gui/chapter_editor/tool.cpp b/src/mkvtoolnix-gui/chapter_editor/tool.cpp index 0a6236862..c4895431a 100644 --- a/src/mkvtoolnix-gui/chapter_editor/tool.cpp +++ b/src/mkvtoolnix-gui/chapter_editor/tool.cpp @@ -159,7 +159,7 @@ void Tool::openFile(QString const &fileName, bool append) { auto &settings = Util::Settings::get(); - settings.m_lastOpenDir = QFileInfo{fileName}.path(); + settings.m_lastOpenDir.setPath(QFileInfo{fileName}.path()); settings.save(); if (!append) diff --git a/src/mkvtoolnix-gui/header_editor/tab.cpp b/src/mkvtoolnix-gui/header_editor/tab.cpp index d8e5f8b36..a96844f0a 100644 --- a/src/mkvtoolnix-gui/header_editor/tab.cpp +++ b/src/mkvtoolnix-gui/header_editor/tab.cpp @@ -665,7 +665,7 @@ Tab::selectAttachmentsAndAdd() { if (fileNames.isEmpty()) return; - settings.m_lastOpenDir = QFileInfo{fileNames[0]}.path(); + settings.m_lastOpenDir.setPath(QFileInfo{fileNames[0]}.path()); settings.save(); addAttachments(fileNames); diff --git a/src/mkvtoolnix-gui/header_editor/tool.cpp b/src/mkvtoolnix-gui/header_editor/tool.cpp index fbc07b97f..3d76a2b6d 100644 --- a/src/mkvtoolnix-gui/header_editor/tool.cpp +++ b/src/mkvtoolnix-gui/header_editor/tool.cpp @@ -141,8 +141,8 @@ Tool::openFilesFromCommandLine(QStringList const &fileNames) { void Tool::openFile(QString const &fileName) { - auto &settings = Util::Settings::get(); - settings.m_lastOpenDir = QFileInfo{fileName}.path(); + auto &settings = Util::Settings::get(); + settings.m_lastOpenDir.setPath(QFileInfo{fileName}.path()); settings.save(); auto tab = new Tab{this, fileName}; diff --git a/src/mkvtoolnix-gui/info/tool.cpp b/src/mkvtoolnix-gui/info/tool.cpp index 39fd46226..0ded972ea 100644 --- a/src/mkvtoolnix-gui/info/tool.cpp +++ b/src/mkvtoolnix-gui/info/tool.cpp @@ -132,7 +132,7 @@ Tool::selectAndOpenFile() { void Tool::openFile(QString const &fileName) { Util::Settings::change([&fileName](Util::Settings &settings) { - settings.m_lastOpenDir = QFileInfo{fileName}.path(); + settings.m_lastOpenDir.setPath(QFileInfo{fileName}.path()); }); appendTab(new Tab{this}) diff --git a/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp b/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp index 39dc48d42..79c5e602c 100644 --- a/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp +++ b/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp @@ -837,8 +837,8 @@ PreferencesDialog::save() { : ui->rbMAutoSetPreviousDirectory->isChecked() ? Util::Settings::ToPreviousDirectory : Util::Settings::ToSameAsFirstInputFile; m_cfg.m_autoDestinationOnlyForVideoFiles = ui->cbMAutoDestinationOnlyForVideoFiles->isChecked(); - m_cfg.m_relativeOutputDir = ui->cbMAutoSetRelativeDirectory->currentText(); - m_cfg.m_fixedOutputDir = ui->cbMAutoSetFixedDirectory->currentText(); + m_cfg.m_relativeOutputDir.setPath(ui->cbMAutoSetRelativeDirectory->currentText()); + m_cfg.m_fixedOutputDir.setPath(ui->cbMAutoSetFixedDirectory->currentText()); m_cfg.m_uniqueOutputFileNames = ui->cbMUniqueOutputFileNames->isChecked(); m_cfg.m_autoClearOutputFileName = ui->cbMAutoClearOutputFileName->isChecked(); diff --git a/src/mkvtoolnix-gui/merge/attachments.cpp b/src/mkvtoolnix-gui/merge/attachments.cpp index c5dc6b278..24196e163 100644 --- a/src/mkvtoolnix-gui/merge/attachments.cpp +++ b/src/mkvtoolnix-gui/merge/attachments.cpp @@ -257,7 +257,7 @@ Tab::selectAttachmentsToAdd() { auto fileNames = Util::getOpenFileNames(this, QY("Add attachments"), Util::Settings::get().lastOpenDirPath(), QY("All files") + Q(" (*)")); if (!fileNames.isEmpty()) - Util::Settings::get().m_lastOpenDir = QFileInfo{fileNames[0]}.path(); + Util::Settings::get().m_lastOpenDir.setPath(QFileInfo{fileNames[0]}.path()); return fileNames; } diff --git a/src/mkvtoolnix-gui/merge/input.cpp b/src/mkvtoolnix-gui/merge/input.cpp index a1055448d..9aa39c0a2 100644 --- a/src/mkvtoolnix-gui/merge/input.cpp +++ b/src/mkvtoolnix-gui/merge/input.cpp @@ -1194,7 +1194,7 @@ Tab::addOrAppendFiles(bool append, QStringList const &fileNames, QModelIndex const &sourceFileIdx) { if (!fileNames.isEmpty()) - Util::Settings::get().m_lastOpenDir = QFileInfo{fileNames.last()}.path(); + Util::Settings::get().m_lastOpenDir.setPath(QFileInfo{fileNames.last()}.path()); qDebug() << "Tab::addOrAppendFiles: TID" << QThread::currentThreadId(); diff --git a/src/mkvtoolnix-gui/merge/tab.cpp b/src/mkvtoolnix-gui/merge/tab.cpp index 1e01466a2..c34943d0e 100644 --- a/src/mkvtoolnix-gui/merge/tab.cpp +++ b/src/mkvtoolnix-gui/merge/tab.cpp @@ -202,7 +202,7 @@ Tab::onSaveOptionFile() { return; Util::OptionFile::create(fileName, updateConfigFromControlValues().buildMkvmergeOptions()); - settings.m_lastConfigDir = QFileInfo{fileName}.path(); + settings.m_lastConfigDir.setPath(QFileInfo{fileName}.path()); settings.save(); MainWindow::get()->setStatusBarMessage(QY("The option file has been created.")); @@ -217,7 +217,7 @@ Tab::onSaveConfigAs() { updateConfigFromControlValues(); m_config.save(fileName); - settings.m_lastConfigDir = QFileInfo{fileName}.path(); + settings.m_lastConfigDir.setPath(QFileInfo{fileName}.path()); settings.save(); m_savedState = currentState(); @@ -258,7 +258,7 @@ Tab::getOpenFileName(QString const &title, if (fileName.isEmpty()) return fileName; - settings.m_lastOpenDir = QFileInfo{fileName}.path(); + settings.m_lastOpenDir.setPath(QFileInfo{fileName}.path()); settings.save(); if (lineEdit) @@ -285,7 +285,7 @@ Tab::getSaveFileName(QString const &title, if (fileName.isEmpty()) return fileName; - settings.m_lastOutputDir = QFileInfo{fileName}.path(); + settings.m_lastOutputDir.setPath(QFileInfo{fileName}.path()); settings.save(); lineEdit->setText(fileName); diff --git a/src/mkvtoolnix-gui/merge/tool.cpp b/src/mkvtoolnix-gui/merge/tool.cpp index 2884153e8..38ec20962 100644 --- a/src/mkvtoolnix-gui/merge/tool.cpp +++ b/src/mkvtoolnix-gui/merge/tool.cpp @@ -179,7 +179,7 @@ Tool::openConfig() { void Tool::openConfigFile(QString const &fileName) { Util::Settings::change([&fileName](Util::Settings &cfg) { - cfg.m_lastConfigDir = QFileInfo{fileName}.path(); + cfg.m_lastConfigDir.setPath(QFileInfo{fileName}.path()); }); if (MainWindow::jobTool()->addJobFile(fileName)) { diff --git a/src/mkvtoolnix-gui/util/settings.cpp b/src/mkvtoolnix-gui/util/settings.cpp index 13e06ad88..06d3f1694 100644 --- a/src/mkvtoolnix-gui/util/settings.cpp +++ b/src/mkvtoolnix-gui/util/settings.cpp @@ -358,7 +358,7 @@ Settings::setDefaults(boost::optional enableMuxingTracksByTheseTypes) if (ToParentOfFirstInputFile == m_outputFileNamePolicy) { m_outputFileNamePolicy = ToRelativeOfFirstInputFile; - m_relativeOutputDir = Q(".."); + m_relativeOutputDir.setPath(Q("..")); } m_enableMuxingTracksByTheseTypes.clear(); diff --git a/src/mkvtoolnix-gui/util/widget.cpp b/src/mkvtoolnix-gui/util/widget.cpp index e971a7413..5b86450c5 100644 --- a/src/mkvtoolnix-gui/util/widget.cpp +++ b/src/mkvtoolnix-gui/util/widget.cpp @@ -178,7 +178,7 @@ addSegmentUIDFromFileToLineEdit(QWidget &parent, if (fileName.isEmpty()) return; - settings.m_lastOpenDir = QFileInfo{fileName}.path(); + settings.m_lastOpenDir.setPath(QFileInfo{fileName}.path()); settings.save(); try { diff --git a/src/mkvtoolnix-gui/watch_jobs/tab.cpp b/src/mkvtoolnix-gui/watch_jobs/tab.cpp index b93fb5515..1f32b5922 100644 --- a/src/mkvtoolnix-gui/watch_jobs/tab.cpp +++ b/src/mkvtoolnix-gui/watch_jobs/tab.cpp @@ -402,7 +402,7 @@ Tab::onSaveOutput() { out.close(); } - cfg.m_lastOpenDir = QFileInfo{fileName}.path(); + cfg.m_lastOpenDir.setPath(QFileInfo{fileName}.path()); cfg.save(); }