Skip to content

Commit

Permalink
+ fixes #2047: Don't register recent files which can't be opened
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Apr 11, 2015
1 parent c62319d commit 4e54841
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Gui/Application.cpp
Expand Up @@ -595,9 +595,14 @@ void Application::exportTo(const char* FileName, const char* DocName, const char

std::string code = str.str();
// the original file name is required
if (runPythonCode(code.c_str(), false))
getMainWindow()->appendRecentFile(QString::fromUtf8(File.filePath().c_str()));

if (runPythonCode(code.c_str(), false)) {
// search for a module that is able to open the exported file because otherwise
// it doesn't need to be added to the recent files list (#0002047)
std::map<std::string, std::string> importMap = App::GetApplication().getImportFilters(te.c_str());
if (!importMap.empty())
getMainWindow()->appendRecentFile(QString::fromUtf8(File.filePath().c_str()));
}

// allow exporters to pass _objs__ to submodules before deleting it
runPythonCode("del __objs__", false);
}
Expand Down

0 comments on commit 4e54841

Please sign in to comment.