diff --git a/ChangeLog b/ChangeLog index 21e34bb07..a9eb48033 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2015-10-17 Moritz Bunkus + * MKVToolNix GUI: bug fix (Linux): the function "open folder" was + inserting a superfluous leading slash in the directory name. This + causes some file managers (in this particular case Dolphin on + Linux) to interpret a directory name like "//home/mosu/…" as a + share called "mosu" on a Samba/Windows server called "home" and to + prepend the whole name with the "smb://" protocol. Fixes #1479. + * Released v8.5.0. 2015-10-16 Moritz Bunkus diff --git a/src/mkvtoolnix-gui/jobs/job.cpp b/src/mkvtoolnix-gui/jobs/job.cpp index c78629e32..119fd80e5 100644 --- a/src/mkvtoolnix-gui/jobs/job.cpp +++ b/src/mkvtoolnix-gui/jobs/job.cpp @@ -9,6 +9,7 @@ #include "mkvtoolnix-gui/jobs/job.h" #include "mkvtoolnix-gui/jobs/mux_job.h" #include "mkvtoolnix-gui/util/config_file.h" +#include "mkvtoolnix-gui/util/file.h" #include "mkvtoolnix-gui/util/settings.h" namespace mtx { namespace gui { namespace Jobs { @@ -246,7 +247,7 @@ Job::openOutputFolder() auto folder = outputFolder(); if (!folder.isEmpty()) - QDesktopServices::openUrl(QUrl{Q("file:///%1").arg(folder)}); + QDesktopServices::openUrl(Util::pathToFileUrl(folder)); } QString diff --git a/src/mkvtoolnix-gui/util/file.cpp b/src/mkvtoolnix-gui/util/file.cpp index a6f1a72e1..274a68021 100644 --- a/src/mkvtoolnix-gui/util/file.cpp +++ b/src/mkvtoolnix-gui/util/file.cpp @@ -3,7 +3,9 @@ #include #include #include +#include +#include "common/qt.h" #include "mkvtoolnix-gui/util/file.h" namespace mtx { namespace gui { namespace Util { @@ -38,4 +40,12 @@ checkForBomAndNonAscii(QString const &fileName) { return result; } +QUrl +pathToFileUrl(QString const &path) { + auto url = QUrl{}; + url.setScheme(Q("file")); + url.setPath(path); + return url; +} + }}} diff --git a/src/mkvtoolnix-gui/util/file.h b/src/mkvtoolnix-gui/util/file.h index 88a7877ba..8360edd49 100644 --- a/src/mkvtoolnix-gui/util/file.h +++ b/src/mkvtoolnix-gui/util/file.h @@ -4,6 +4,7 @@ #include "common/common_pch.h" class QString; +class QUrl; namespace mtx { namespace gui { namespace Util { @@ -15,6 +16,8 @@ struct BomAsciiCheckResult { BomAsciiCheckResult checkForBomAndNonAscii(QString const &fileName); +QUrl pathToFileUrl(QString const &path); + }}} #endif // MTX_MKVTOOLNIX_GUI_UTIL_FILE_H