Workaround for issue #1963 - Search for templates in userAppData/Templates folder
This commit is contained in:
parent
01768b70e7
commit
01480a174a
|
@ -107,7 +107,12 @@ void FeaturePage::onChanged(const App::Property* prop)
|
||||||
void FeaturePage::onDocumentRestored()
|
void FeaturePage::onDocumentRestored()
|
||||||
{
|
{
|
||||||
Base::FileInfo fi(PageResult.getValue());
|
Base::FileInfo fi(PageResult.getValue());
|
||||||
Template.setValue(App::Application::getResourceDir() + "Mod/Drawing/Templates/" + fi.fileName());
|
std::string path = App::Application::getResourceDir() + "Mod/Drawing/Templates/" + fi.fileName();
|
||||||
|
// try to find the template in user dir/Templates first
|
||||||
|
Base::FileInfo tempfi(App::Application::getUserAppDataDir() + "Templates/" + fi.fileName());
|
||||||
|
if (tempfi.exists())
|
||||||
|
path = tempfi.filePath();
|
||||||
|
Template.setValue(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
App::DocumentObjectExecReturn *FeaturePage::execute(void)
|
App::DocumentObjectExecReturn *FeaturePage::execute(void)
|
||||||
|
|
|
@ -54,7 +54,12 @@ LuxProject::LuxProject(void)
|
||||||
void LuxProject::onDocumentRestored()
|
void LuxProject::onDocumentRestored()
|
||||||
{
|
{
|
||||||
Base::FileInfo fi(PageResult.getValue());
|
Base::FileInfo fi(PageResult.getValue());
|
||||||
Template.setValue(App::Application::getResourceDir() + "Mod/Raytracing/Templates/" + fi.fileName());
|
std::string path = App::Application::getResourceDir() + "Mod/Raytracing/Templates/" + fi.fileName();
|
||||||
|
// try to find the template in user dir/Templates first
|
||||||
|
Base::FileInfo tempfi(App::Application::getUserAppDataDir() + "Templates/" + fi.fileName());
|
||||||
|
if (tempfi.exists())
|
||||||
|
path = tempfi.filePath();
|
||||||
|
Template.setValue(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
App::DocumentObjectExecReturn *LuxProject::execute(void)
|
App::DocumentObjectExecReturn *LuxProject::execute(void)
|
||||||
|
|
|
@ -53,7 +53,12 @@ RayProject::RayProject(void)
|
||||||
void RayProject::onDocumentRestored()
|
void RayProject::onDocumentRestored()
|
||||||
{
|
{
|
||||||
Base::FileInfo fi(PageResult.getValue());
|
Base::FileInfo fi(PageResult.getValue());
|
||||||
Template.setValue(App::Application::getResourceDir() + "Mod/Raytracing/Templates/" + fi.fileName());
|
std::string path = App::Application::getResourceDir() + "Mod/Raytracing/Templates/" + fi.fileName();
|
||||||
|
// try to find the template in user dir/Templates first
|
||||||
|
Base::FileInfo tempfi(App::Application::getUserAppDataDir() + "Templates/" + fi.fileName());
|
||||||
|
if (tempfi.exists())
|
||||||
|
path = tempfi.filePath();
|
||||||
|
Template.setValue(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
App::DocumentObjectExecReturn *RayProject::execute(void)
|
App::DocumentObjectExecReturn *RayProject::execute(void)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user