mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 03:22:33 +01:00
Merge branch 'master' into 66-port-screenplay-from-qmake-to-cmake
# Conflicts: # ScreenPlay/src/settings.cpp
This commit is contained in:
commit
a2f2877540
@ -202,11 +202,9 @@ std::optional<QJsonObject> Util::parseQByteArrayToQJsonObject(const QByteArray&
|
||||
*/
|
||||
void Util::openFolderInExplorer(const QString& url) const
|
||||
{
|
||||
QString fileString { "file:///" };
|
||||
QString parameter = url;
|
||||
if (url.contains(fileString)) {
|
||||
parameter.remove(fileString);
|
||||
}
|
||||
|
||||
QString path = QUrl::fromUserInput(url).toLocalFile();
|
||||
|
||||
QProcess explorer;
|
||||
#ifdef Q_OS_WIN
|
||||
explorer.setProgram("explorer.exe");
|
||||
@ -214,11 +212,11 @@ void Util::openFolderInExplorer(const QString& url) const
|
||||
// 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(parameter));
|
||||
explorer.setWorkingDirectory(QDir::toNativeSeparators(path));
|
||||
explorer.setArguments({ "." });
|
||||
#elif defined(Q_OS_OSX)
|
||||
explorer.setProgram("open");
|
||||
explorer.setArguments({ QDir::toNativeSeparators(parameter) });
|
||||
explorer.setArguments({ QDir::toNativeSeparators(path) });
|
||||
#endif
|
||||
|
||||
explorer.startDetached();
|
||||
|
Loading…
Reference in New Issue
Block a user