Clean up missing directory behavior

This commit is contained in:
Chris Hennes
2021-08-24 11:49:07 -05:00
parent d13f7958f9
commit 5aaaf17570
2 changed files with 5 additions and 1 deletions

View File

@@ -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)); });
}

View File

@@ -240,7 +240,6 @@ void copyTemplateParameters(Base::Reference<ParameterGrp> 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);
}