|
|
@ -43,6 +43,7 @@ |
|
|
|
#include <QRegularExpression> |
|
|
|
#include <QRegularExpression> |
|
|
|
#include <QScreen> |
|
|
|
#include <QScreen> |
|
|
|
#include <QStyle> |
|
|
|
#include <QStyle> |
|
|
|
|
|
|
|
#include <QThread> |
|
|
|
#include <QUrl> |
|
|
|
#include <QUrl> |
|
|
|
#include <QWidget> |
|
|
|
#include <QWidget> |
|
|
|
#include <QWindow> |
|
|
|
#include <QWindow> |
|
|
@ -159,15 +160,22 @@ void Utils::Gui::openFolderSelect(const Path &path) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_OS_WIN |
|
|
|
#ifdef Q_OS_WIN |
|
|
|
HRESULT hresult = ::CoInitializeEx(nullptr, COINIT_MULTITHREADED); |
|
|
|
auto *thread = QThread::create([path]() |
|
|
|
PIDLIST_ABSOLUTE pidl = ::ILCreateFromPathW(reinterpret_cast<PCTSTR>(path.toString().utf16())); |
|
|
|
|
|
|
|
if (pidl) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
::SHOpenFolderAndSelectItems(pidl, 0, nullptr, 0); |
|
|
|
if (SUCCEEDED(::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE))) |
|
|
|
::ILFree(pidl); |
|
|
|
{ |
|
|
|
} |
|
|
|
PIDLIST_ABSOLUTE pidl = ::ILCreateFromPathW(reinterpret_cast<const wchar_t *>(path.toString().utf16())); |
|
|
|
if ((hresult == S_OK) || (hresult == S_FALSE)) |
|
|
|
if (pidl) |
|
|
|
::CoUninitialize(); |
|
|
|
{ |
|
|
|
|
|
|
|
::SHOpenFolderAndSelectItems(pidl, 0, nullptr, 0); |
|
|
|
|
|
|
|
::ILFree(pidl); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
::CoUninitialize(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
QObject::connect(thread, &QThread::finished, thread, &QObject::deleteLater); |
|
|
|
|
|
|
|
thread->start(); |
|
|
|
#elif defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) |
|
|
|
#elif defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) |
|
|
|
QProcess proc; |
|
|
|
QProcess proc; |
|
|
|
proc.start(u"xdg-mime"_qs, {u"query"_qs, u"default"_qs, u"inode/directory"_qs}); |
|
|
|
proc.start(u"xdg-mime"_qs, {u"query"_qs, u"default"_qs, u"inode/directory"_qs}); |
|
|
|