diff --git a/src/mirall/protocolwidget.cpp b/src/mirall/protocolwidget.cpp index 638ab845bc..25ef6109b6 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 9365dc44be..4716ee1e3c 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")