diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 4cdf421ad6..7782da5cf2 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -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 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); }