fix for issue #11 (Author mechtex)

This commit is contained in:
Luis Ángel San Martín
2014-06-21 16:27:34 +02:00
parent 053d97d39f
commit 6a17ab9be2
2 changed files with 9 additions and 5 deletions

View File

@ -17,7 +17,8 @@ DEFINES += SERVER_RELEASE NOMINMAX
win32 {
LIBS += -L../dependencies/poppler/lib -loleaut32 -lole32
LIBS += -L../dependencies/poppler/lib -loleaut32 -lole32 -lshell32
isEqual(QT_MAJOR_VERSION, 5) {
LIBS += -lpoppler-qt5

View File

@ -62,6 +62,10 @@
#include "QsLog.h"
#ifdef Q_OS_WIN
#include <shellapi.h>
#endif
#ifdef Q_OS_MAC
//#include <QtMacExtras>
#endif
@ -1606,10 +1610,9 @@ QFileInfo file = QDir::cleanPath(currentPath() + dmCV->getComicPath(modelIndex))
#endif
#ifdef Q_OS_WIN
QString filePath = file.absoluteFilePath();
QStringList args;
args << "/select," << QDir::toNativeSeparators(filePath);
QProcess::startDetached("explorer", args);
QString filePath = file.absoluteFilePath();
QString cmdArgs = QString("/select,\"") + QDir::toNativeSeparators(filePath) + QStringLiteral("\"");
ShellExecuteW(0, L"open", L"explorer.exe", reinterpret_cast<LPCWSTR>(cmdArgs.utf16()), 0, SW_NORMAL);
#endif
}