return;
#endif
- QString explorer = "explorer.exe "; // FIXME: we trust it's in PATH
- QFileInfo fi(localPath);
-
- // canonicalFilePath returns empty if the file does not exist
- if (!fi.canonicalFilePath().isEmpty()) {
- QString nativeArgs;
- if (!fi.isDir()) {
- nativeArgs += QLatin1String("/select,");
- }
- nativeArgs += QLatin1Char('"');
- nativeArgs += QDir::toNativeSeparators(fi.canonicalFilePath());
- nativeArgs += QLatin1Char('"');
-
- QProcess p;
+ const QString explorer = "explorer.exe "; // FIXME: we trust it's in PATH
+ QFileInfo fi(localPath);
+
+ // canonicalFilePath returns empty if the file does not exist
+ if (!fi.canonicalFilePath().isEmpty()) {
+ QString nativeArgs;
+ if (!fi.isDir()) {
+ nativeArgs += QLatin1String("/select,");
+ }
+ nativeArgs += QLatin1Char('"');
+ nativeArgs += QDir::toNativeSeparators(fi.canonicalFilePath());
+ nativeArgs += QLatin1Char('"');
+
+ QProcess p;
#ifdef Q_OS_WIN
// QProcess on Windows tries to wrap the whole argument/program string
// with quotes if it detects a space in it, but explorer wants the quotes
// only around the path. Use setNativeArguments to bypass this logic.
p.setNativeArguments(nativeArgs);
#endif
- p.start(explorer);
+ p.start(explorer, QStringList {});
p.waitForFinished(5000);
}
} else if (Utility::isMac()) {