diff --git a/src/Mod/Drawing/App/FeaturePage.cpp b/src/Mod/Drawing/App/FeaturePage.cpp index 3d5efa956..85cef73c1 100644 --- a/src/Mod/Drawing/App/FeaturePage.cpp +++ b/src/Mod/Drawing/App/FeaturePage.cpp @@ -107,7 +107,12 @@ void FeaturePage::onChanged(const App::Property* prop) void FeaturePage::onDocumentRestored() { 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) diff --git a/src/Mod/Raytracing/App/LuxProject.cpp b/src/Mod/Raytracing/App/LuxProject.cpp index 43e31a582..fde32dce9 100644 --- a/src/Mod/Raytracing/App/LuxProject.cpp +++ b/src/Mod/Raytracing/App/LuxProject.cpp @@ -54,7 +54,12 @@ LuxProject::LuxProject(void) void LuxProject::onDocumentRestored() { 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) diff --git a/src/Mod/Raytracing/App/RayProject.cpp b/src/Mod/Raytracing/App/RayProject.cpp index a73b0f4f2..d4f1428e7 100644 --- a/src/Mod/Raytracing/App/RayProject.cpp +++ b/src/Mod/Raytracing/App/RayProject.cpp @@ -53,7 +53,12 @@ RayProject::RayProject(void) void RayProject::onDocumentRestored() { 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)