diff options
author | Klaas Freitag <freitag@owncloud.com> | 2013-12-17 13:16:25 +0400 |
---|---|---|
committer | Klaas Freitag <freitag@owncloud.com> | 2013-12-17 13:16:25 +0400 |
commit | 23f52bcd564b0426dbf25e5e1abf0602fdc49627 (patch) | |
tree | 3b17f026ce5441a80ad23c5f3b6eb07c7740badb /src | |
parent | 58035a2f4a3100b824597d8d490801845bbd22f9 (diff) |
Fix open the explorer code.
Diffstat (limited to 'src')
-rw-r--r-- | src/mirall/protocolwidget.cpp | 3 | ||||
-rw-r--r-- | src/mirall/utility.cpp | 20 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/mirall/protocolwidget.cpp b/src/mirall/protocolwidget.cpp index 638ab845b..25ef6109b 100644 --- a/src/mirall/protocolwidget.cpp +++ b/src/mirall/protocolwidget.cpp @@ -247,7 +247,8 @@ void ProtocolWidget::slotOpenFile( QTreeWidgetItem *item, int ) Folder *folder = FolderMan::instance()->folder(folderName); if (folder) { - QString fullPath = folder->path() + '/' + fileName; + // folder->path() always comes back with trailing path + QString fullPath = folder->path() + fileName; if (QFile(fullPath).exists()) { Utility::showInFileManager(fullPath); } diff --git a/src/mirall/utility.cpp b/src/mirall/utility.cpp index 9365dc44b..4716ee1e3 100644 --- a/src/mirall/utility.cpp +++ b/src/mirall/utility.cpp @@ -314,13 +314,21 @@ static bool checkDolphinCanSelect() // inspired by Qt Creator's showInGraphicalShell(); void Utility::showInFileManager(const QString &localPath) { + const QString sillyQuote("\"\"\""); if (isWindows()) { - const QString explorer = "explorer.exe"; // FIXME: we trust it's in PATH - QString param; - if (!QFileInfo(localPath).isDir()) - param += QLatin1String("/select,"); - param += QDir::toNativeSeparators(localPath); - QProcess::startDetached(explorer, QStringList(param)); + QString explorer = "explorer.exe "; // FIXME: we trust it's in PATH + + if (!QFileInfo(localPath).isDir()) { + explorer += QLatin1String("/select,"); + } + explorer += sillyQuote; + explorer += QDir::toNativeSeparators(localPath); + explorer += sillyQuote; + + qDebug() << "OO Open explorer commandline:" << explorer; + QProcess p; + p.start(explorer); + p.waitForFinished(5000); } else if (isMac()) { QStringList scriptArgs; scriptArgs << QLatin1String("-e") |