diff --git a/ScreenPlay/src/util.cpp b/ScreenPlay/src/util.cpp index a2872597..f375896b 100644 --- a/ScreenPlay/src/util.cpp +++ b/ScreenPlay/src/util.cpp @@ -3,6 +3,7 @@ #include "qarchive_enums.hpp" #include "qarchivediskcompressor.hpp" #include "qarchivediskextractor.hpp" +#include #if defined(Q_OS_WIN) #include @@ -93,24 +94,8 @@ bool Util::writeJsonObjectToFile(const QString& absoluteFilePath, const QJsonObj */ void Util::openFolderInExplorer(const QString& url) const { - - QString path = QUrl::fromUserInput(url).toLocalFile(); - - QProcess explorer; -#ifdef Q_OS_WIN - explorer.setProgram("explorer.exe"); - // When we have space in the path like - // C:\Program Files (x86)\Steam\... - // we cannot set the path as an argument. But we can set the working it - // to the wanted path and open the current path via the dot. - explorer.setWorkingDirectory(QDir::toNativeSeparators(path)); - explorer.setArguments({ "." }); -#elif defined(Q_OS_OSX) - explorer.setProgram("open"); - explorer.setArguments({ QDir::toNativeSeparators(path) }); -#endif - - explorer.startDetached(); + const QString path = QUrl::fromUserInput(url).toLocalFile(); + QDesktopServices::openUrl(QUrl::fromLocalFile(path)); } /*!