From 683b7a82a508b28c066e188768e36463ea82616f Mon Sep 17 00:00:00 2001 From: lordmulder Date: Mon, 19 Dec 2011 02:09:45 +0100 Subject: [PATCH] QDesktopServices::openUrl() fails horribly, if we try to explore a folder like "C:\Foo\Bar" while there is a file "C:\Foo\Bar.exe". Going back to ShellExecute() for now. --- src/Config.h | 2 +- src/Dialog_MainWindow.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Config.h b/src/Config.h index 969c13fd..ab31f6e5 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 4 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 10 -#define VER_LAMEXP_BUILD 817 +#define VER_LAMEXP_BUILD 818 /////////////////////////////////////////////////////////////////////////////// // Tool versions (minimum expected versions!) diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 5f9626c7..282a3483 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -848,7 +848,9 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) case QEvent::MouseButtonPress: if(dynamic_cast(event)->button() == Qt::LeftButton) { - QDesktopServices::openUrl(QString("file:///%1").arg(outputFolderLabel->text())); + QString path = outputFolderLabel->text(); + if(!path.endsWith(QDir::separator())) path.append(QDir::separator()); + ShellExecuteW(this->winId(), L"explore", QWCHAR(path), NULL, NULL, SW_SHOW); } break; case QEvent::Enter: @@ -2342,7 +2344,9 @@ void MainWindow::outputFolderContextMenu(const QPoint &pos) */ void MainWindow::showFolderContextActionTriggered(void) { - QDesktopServices::openUrl(QUrl::fromLocalFile(m_fileSystemModel->filePath(outputFolderView->currentIndex()))); + QString path = QDir::toNativeSeparators(m_fileSystemModel->filePath(outputFolderView->currentIndex())); + if(!path.endsWith(QDir::separator())) path.append(QDir::separator()); + ShellExecuteW(this->winId(), L"explore", QWCHAR(path), NULL, NULL, SW_SHOW); } /*