diff --git a/src/Mod/Start/Gui/StartView.cpp b/src/Mod/Start/Gui/StartView.cpp index 9a892cfbb7..67d69414cc 100644 --- a/src/Mod/Start/Gui/StartView.cpp +++ b/src/Mod/Start/Gui/StartView.cpp @@ -48,10 +48,8 @@ #include #include #include -#include #include -#include -#include +#include #include #include #include @@ -435,25 +433,10 @@ void StartView::postStart(PostStartBehavior behavior) const void StartView::fileCardSelected(const QModelIndex& index) { - auto file = index.data(static_cast(Start::DisplayedFilesModelRoles::path)).toString(); - std::string escapedstr = Base::Tools::escapedUnicodeFromUtf8(file.toStdString().c_str()); - escapedstr = Base::Tools::escapeEncodeFilename(escapedstr); try { - QString filename = QString::fromStdString(escapedstr); - QFileInfo fi(filename); - if (!fi.exists() || !fi.isFile()) { - QMessageBox::critical(Gui::getMainWindow(), - tr("File not found"), - tr("The file '%1' cannot be opened.").arg(filename)); - } - else { - // invokes appendFile() - Gui::SelectModule::Dict dict = Gui::SelectModule::importHandler(filename); - for (Gui::SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { - Gui::Application::Instance->open(it.key().toUtf8(), it.value().toLatin1()); - break; - } - } + auto filename = + index.data(static_cast(Start::DisplayedFilesModelRoles::path)).toString(); + Gui::ModuleIO::verifyAndOpenFile(filename); } catch (Base::PyException& e) { Base::Console().Error(e.getMessage().c_str());