diff --git a/YACReaderLibrary/YACReaderLibrary.pro b/YACReaderLibrary/YACReaderLibrary.pro index 342e72b1..d96a7965 100644 --- a/YACReaderLibrary/YACReaderLibrary.pro +++ b/YACReaderLibrary/YACReaderLibrary.pro @@ -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 diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index b1dc3f9f..1159507d 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -62,6 +62,10 @@ #include "QsLog.h" +#ifdef Q_OS_WIN + #include +#endif + #ifdef Q_OS_MAC //#include #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(cmdArgs.utf16()), 0, SW_NORMAL); #endif }