Address review comments
This commit is contained in:
@@ -1894,16 +1894,15 @@ void GMainWindow::OnOpenFAQ() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::OpenFolderSpecifyingFile(const QString& file) {
|
void GMainWindow::OpenFolderSpecifyingFile(const QString& file) {
|
||||||
|
|
||||||
// Windows supports opening a folder with selecting a specified file in explorer. On every other
|
// Windows supports opening a folder with selecting a specified file in explorer. On every other
|
||||||
// OS we just open the folder without preselecting the file.
|
// OS we just open the folder without preselecting the file.
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
const QString explorer = QStringLiteral("explorer");
|
const QString explorer = QStringLiteral("explorer");
|
||||||
QStringList param;
|
QStringList param;
|
||||||
if (!QFileInfo(file).isDir()) {
|
if (!QFileInfo(file).isDir()) {
|
||||||
param << QStringLiteral("/select,");
|
param.push_back(QStringLiteral("/select,"));
|
||||||
}
|
}
|
||||||
param << QDir::toNativeSeparators(file);
|
param.push_back(QDir::toNativeSeparators(file));
|
||||||
QProcess::startDetached(explorer, param);
|
QProcess::startDetached(explorer, param);
|
||||||
#else
|
#else
|
||||||
QDesktopServices::openUrl(QUrl::fromLocalFile(file));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(file));
|
||||||
|
|||||||
Reference in New Issue
Block a user