Workaround for issue #1963 - Search for templates in userAppData/Templates folder
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user