From 01ba4030ff3efe41774723ec7ad7b4a6cc79bf01 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Tue, 24 Aug 2021 11:49:07 -0500 Subject: [PATCH] Clean up missing directory behavior --- src/Gui/DlgGeneralImp.cpp | 5 +++++ src/Gui/PreferencePackManager.cpp | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Gui/DlgGeneralImp.cpp b/src/Gui/DlgGeneralImp.cpp index b1a6f469b9..8b64e55cf1 100644 --- a/src/Gui/DlgGeneralImp.cpp +++ b/src/Gui/DlgGeneralImp.cpp @@ -102,6 +102,11 @@ DlgGeneralImp::DlgGeneralImp( QWidget* parent ) // Future work: the Add-On Manager will be modified to include a section for Preference Packs, at which point this // button will be modified to open the Add-On Manager to that tab. auto savedPreferencePacksDirectory = fs::path(App::Application::getUserAppDataDir()) / "SavedPreferencePacks"; + + // If that directory hasn't been created yet, just send the user to the preferences directory + if (!(fs::exists(savedPreferencePacksDirectory) && fs::is_directory(savedPreferencePacksDirectory))) + savedPreferencePacksDirectory = fs::path(App::Application::getUserAppDataDir()); + QString pathToSavedPacks(QString::fromStdString(savedPreferencePacksDirectory.string())); connect(ui->ManagePreferencePacks, &QPushButton::clicked, this, [pathToSavedPacks]() { QDesktopServices::openUrl(QUrl::fromLocalFile(pathToSavedPacks)); }); } diff --git a/src/Gui/PreferencePackManager.cpp b/src/Gui/PreferencePackManager.cpp index e0260b43e8..cb4e8e2a5b 100644 --- a/src/Gui/PreferencePackManager.cpp +++ b/src/Gui/PreferencePackManager.cpp @@ -240,7 +240,6 @@ void copyTemplateParameters(Base::Reference templateGroup, const s auto boolMap = templateGroup->GetBoolMap(); for (const auto& kv : boolMap) { auto currentValue = userParameterHandle->GetBool(kv.first.c_str(), kv.second); - Base::Console().Message("Parameter %s = %d\n", kv.first.c_str(), currentValue); outputGroup->SetBool(kv.first.c_str(), currentValue); }