Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/activeprofiles_win.cpp b/src/activeprofiles_win.cpp
- index e5b0abc0..55114f0a 100644
- --- a/src/activeprofiles_win.cpp
- +++ b/src/activeprofiles_win.cpp
- @@ -99,7 +99,11 @@ public:
- static const DWORD stringListMessage = 1;
- bool sendMessage(const QString &to, UINT message, WPARAM wParam, LPARAM lParam) const;
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
- +#else
- + bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
- +#endif
- bool sendStringList(const QString &to, const QStringList &list) const;
- @@ -163,7 +167,11 @@ bool ActiveProfiles::Private::sendStringList(const QString &to, const QStringLis
- return sendMessage(to, WM_COPYDATA, (WPARAM)winId(), (LPARAM)(LPVOID)&cd);
- }
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- bool ActiveProfiles::Private::nativeEvent(const QByteArray &eventType, void *message, long *result)
- +#else
- +bool ActiveProfiles::Private::nativeEvent(const QByteArray &eventType, void *message, qintptr *result)
- +#endif
- {
- [[maybe_unused]] static const auto expectedType = QByteArray("windows_generic_MSG");
- Q_ASSERT(eventType == expectedType);
- diff --git a/src/applicationinfo.cpp b/src/applicationinfo.cpp
- index 880a551d..16903d06 100644
- --- a/src/applicationinfo.cpp
- +++ b/src/applicationinfo.cpp
- @@ -217,7 +217,11 @@ QString ApplicationInfo::homeDir(ApplicationInfo::HomedirType type)
- }
- dataDir_ = configDir_;
- // prefer non-roaming data location for cache which is default for qds:DataLocation
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- cacheDir_ = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
- +#else
- + cacheDir_ = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
- +#endif
- } else {
- configDir_ = dataDir_ = cacheDir_ = base + "/" + name();
- }
- diff --git a/src/common.cpp b/src/common.cpp
- index 99579b2d..622d6695 100644
- --- a/src/common.cpp
- +++ b/src/common.cpp
- @@ -292,7 +292,13 @@ void soundPlay(const QString &s)
- }
- #if defined(Q_OS_WIN) || defined(Q_OS_MAC)
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- QSound::play(str);
- +#else
- + QSoundEffect effect;
- + effect.setSource(QUrl::fromLocalFile(str));
- + effect.play();
- +#endif
- #else
- QString player = PsiOptions::instance()->getOption("options.ui.notifications.sounds.unix-sound-player").toString();
- if (player == "")
- diff --git a/src/mainwin.cpp b/src/mainwin.cpp
- index 52c10428..b2aa649f 100644
- --- a/src/mainwin.cpp
- +++ b/src/mainwin.cpp
- @@ -71,7 +71,9 @@
- #include <QVBoxLayout>
- #include <QtAlgorithms>
- #ifdef Q_OS_WIN
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- #include "widgets/thumbnailtoolbar.h"
- +#endif
- #include <windows.h>
- #endif
- #ifdef HAVE_X11
- @@ -157,7 +159,9 @@ public:
- #ifdef Q_OS_WIN
- DWORD deactivationTickCount;
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- QPointer<PsiThumbnailToolBar> thumbnailToolBar_;
- +#endif
- #endif
- void registerActions();
- @@ -1486,6 +1490,7 @@ bool MainWin::nativeEvent(const QByteArray &eventType, MSG *msg, long *result)
- return false;
- }
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- void MainWin::updateWinTaskbar(bool enabled)
- {
- if (!enabled) {
- @@ -1508,6 +1513,7 @@ void MainWin::updateWinTaskbar(bool enabled)
- }
- }
- #endif
- +#endif
- void MainWin::updateCaption()
- {
- diff --git a/src/tools/globalshortcut/globalshortcutmanager_win.cpp b/src/tools/globalshortcut/globalshortcutmanager_win.cpp
- index 0f696e65..abfcf02d 100644
- --- a/src/tools/globalshortcut/globalshortcutmanager_win.cpp
- +++ b/src/tools/globalshortcut/globalshortcutmanager_win.cpp
- @@ -35,7 +35,11 @@ class GlobalShortcutManager::KeyTrigger::Impl : public QWidget {
- qApp->installNativeEventFilter(this);
- }
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- virtual bool nativeEventFilter(const QByteArray &eventType, void *m, long *result) Q_DECL_OVERRIDE
- +#else
- + bool nativeEventFilter(const QByteArray &eventType, void *m, qintptr *result) override
- +#endif
- {
- if (eventType == "windows_generic_MSG") {
- return impl->nativeEvent(eventType, static_cast<MSG *>(m), result);
- @@ -70,7 +74,11 @@ public:
- /**
- * Triggers triggered() signal when the hotkey is activated.
- */
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- bool nativeEvent(const QByteArray &eventType, MSG *m, long *result)
- +#else
- + bool nativeEvent(const QByteArray &eventType, MSG *m, qintptr *result)
- +#endif
- {
- Q_UNUSED(eventType);
- if (m->message == WM_HOTKEY && m->wParam == id_) {
- diff --git a/src/tools/systemwatch/systemwatch_win.cpp b/src/tools/systemwatch/systemwatch_win.cpp
- index e367135d..da3f1fbe 100644
- --- a/src/tools/systemwatch/systemwatch_win.cpp
- +++ b/src/tools/systemwatch/systemwatch_win.cpp
- @@ -57,8 +57,11 @@ class WinSystemWatch::EventFilter : public QAbstractNativeEventFilter {
- public:
- EventFilter(WinSystemWatch *parent) : syswatch(parent) { qApp->installNativeEventFilter(this); }
- -
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- virtual bool nativeEventFilter(const QByteArray &eventType, void *m, long *result) Q_DECL_OVERRIDE
- +#else
- + bool nativeEventFilter(const QByteArray &eventType, void *m, qintptr *result) override
- +#endif
- {
- if (eventType == "windows_generic_MSG") {
- return syswatch->processWinEvent(static_cast<MSG *>(m), result);
- @@ -75,7 +78,11 @@ WinSystemWatch::~WinSystemWatch()
- d = 0;
- }
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- bool WinSystemWatch::processWinEvent(MSG *m, long *result)
- +#else
- +bool WinSystemWatch::processWinEvent(MSG *m, qintptr *result)
- +#endif
- {
- Q_UNUSED(result);
- if (WM_POWERBROADCAST == m->message) {
- diff --git a/src/tools/systemwatch/systemwatch_win.h b/src/tools/systemwatch/systemwatch_win.h
- index 97eb2997..dd04ebcd 100644
- --- a/src/tools/systemwatch/systemwatch_win.h
- +++ b/src/tools/systemwatch/systemwatch_win.h
- @@ -13,7 +13,11 @@ public:
- private:
- class EventFilter;
- EventFilter *d;
- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- bool processWinEvent(MSG *m, long *result);
- +#else
- + bool processWinEvent(MSG *m, qintptr *result);
- +#endif
- };
- #endif // SYSTEMWATCH_WIN_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement