From e3bf086e499dd247e0ac8066a69fe898e062c089 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 15 Oct 2024 14:07:14 +0200 Subject: [PATCH] Start: Use ModuleIO in StartView::fileCardSelected --- src/Mod/Start/Gui/StartView.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Mod/Start/Gui/StartView.cpp b/src/Mod/Start/Gui/StartView.cpp index a4769da390..0967b052e8 100644 --- a/src/Mod/Start/Gui/StartView.cpp +++ b/src/Mod/Start/Gui/StartView.cpp @@ -49,6 +49,8 @@ #include #include #include +#include +#include #include #include #include @@ -432,12 +434,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); - auto command = std::string("FreeCAD.loadFile('") + escapedstr + "')"; try { - Base::Interpreter().runString(command.c_str()); + auto filename = + index.data(static_cast(Start::DisplayedFilesModelRoles::path)).toString(); + Gui::ModuleIO::verifyAndOpenFile(filename); Gui::Application::checkForRecomputes(); postStart(PostStartBehavior::doNotSwitchWorkbench); }