diff --git a/thirdparty/qtsingleapplication/src/qtlocalpeer.cpp b/thirdparty/qtsingleapplication/src/qtlocalpeer.cpp index 1de2290c..e23d3586 100644 --- a/thirdparty/qtsingleapplication/src/qtlocalpeer.cpp +++ b/thirdparty/qtsingleapplication/src/qtlocalpeer.cpp @@ -43,12 +43,11 @@ #include #include -#if defined(Q_OS_WIN) -#include -#include -typedef BOOL(WINAPI*PProcessIdToSessionId)(DWORD,DWORD*); -static PProcessIdToSessionId pProcessIdToSessionId = 0; + +#if defined( Q_OS_WIN ) + #include #endif + #if defined(Q_OS_UNIX) #include #include @@ -74,7 +73,12 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId) prefix.truncate(6); QByteArray idc = QDir::home().dirName().toUtf8(); - quint16 idNum = qChecksum(idc.constData(), idc.size()); +#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) + quint16 idNum = qChecksum( idc.constData(), idc.size() ); +#else + quint16 idNum = qChecksum( idc ); +#endif + socketName = QLatin1String("single-") + prefix + QLatin1Char('-') + QString::number(idNum, 16);