Minor improvement for function QETApp::customElementsDir() and QETApp::commonElementsDir()

the path is set the first time the function is called.
Each other call will immediately return the previously setted path
instead of check again what path to return.
This commit is contained in:
joshua
2021-12-04 12:22:47 +01:00
parent 94f66553ac
commit eed1223c1d
3 changed files with 93 additions and 68 deletions

View File

@@ -197,7 +197,7 @@ void GeneralConfigurationPage::applyConf()
settings.setValue("elements-collections/common-collection-path", "default");
}
if (path != settings.value("elements-collections/common-collection-path").toString()) {
QETApp::resetUserElementsDir();
QETApp::resetCollectionsPath();
}
path = settings.value("elements-collections/custom-collection-path").toString();
@@ -212,7 +212,7 @@ void GeneralConfigurationPage::applyConf()
settings.setValue("elements-collections/custom-collection-path", "default");
}
if (path != settings.value("elements-collections/custom-collection-path").toString()) {
QETApp::resetUserElementsDir();
QETApp::resetCollectionsPath();
}
path = settings.value("elements-collections/custom-tbt-path").toString();
@@ -227,7 +227,7 @@ void GeneralConfigurationPage::applyConf()
settings.setValue("elements-collections/custom-tbt-path", "default");
}
if (path != settings.value("elements-collections/custom-tbt-path").toString()) {
QETApp::resetUserElementsDir();
QETApp::resetCollectionsPath();
}
}