diff options
author | Daniel Molkentin <danimo@owncloud.com> | 2014-10-29 06:18:16 +0300 |
---|---|---|
committer | Daniel Molkentin <danimo@owncloud.com> | 2014-10-29 06:27:58 +0300 |
commit | dc1e73dcb7145c59c455c612e3769cc2412e67fe (patch) | |
tree | 64daeaaa515ed4cf799694d524c85a257c04bf7a /src/gui/openfilemanager.cpp | |
parent | 24b07aaaef76c77df3b0422c68c837fdba0c20e5 (diff) | |
parent | 782463589e4d3062c4c23b39c8cdb4764db89e52 (diff) |
Merge remote-tracking branch 'origin/1.7'
Conflicts:
src/libsync/syncjournaldb.cpp
test/CMakeLists.txt
Diffstat (limited to 'src/gui/openfilemanager.cpp')
-rw-r--r-- | src/gui/openfilemanager.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/gui/openfilemanager.cpp b/src/gui/openfilemanager.cpp index 397c5c56a..698cc3dd9 100644 --- a/src/gui/openfilemanager.cpp +++ b/src/gui/openfilemanager.cpp @@ -90,18 +90,22 @@ void showInFileManager(const QString &localPath) } #endif QString explorer = "explorer.exe "; // FIXME: we trust it's in PATH + QFileInfo fi(localPath); - if (!QFileInfo(localPath).isDir()) { - explorer += QLatin1String("/select,"); + // canonicalFilePath returns empty if the file does not exist + if( !fi.canonicalFilePath().isEmpty() ) { + if (!fi.isDir()) { + explorer += QLatin1String("/select,"); + } + explorer += QLatin1Char('"'); + explorer += QDir::toNativeSeparators(fi.canonicalFilePath()); + explorer += QLatin1Char('"'); + + qDebug() << "OO Open explorer commandline:" << explorer; + QProcess p; + p.start(explorer); + p.waitForFinished(5000); } - explorer += QLatin1Char('"'); - explorer += QDir::toNativeSeparators(localPath); - explorer += QLatin1Char('"'); - - qDebug() << "OO Open explorer commandline:" << explorer; - QProcess p; - p.start(explorer); - p.waitForFinished(5000); } else if (Utility::isMac()) { QStringList scriptArgs; scriptArgs << QLatin1String("-e") @@ -182,4 +186,4 @@ void showInFileManager(const QString &localPath) } } -}
\ No newline at end of file +} |