From 3e4aaca1f3589bf096449a31938b04abd0109e7f Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Sun, 21 May 2023 13:26:34 +0800 Subject: [PATCH] fix: qChecksum compile warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🎨 apply clang-format changes --- .../qtsingleapplication/src/qtlocalpeer.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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);