From b69b50c6c6f2152cedf4528af24beed6179bcbbe Mon Sep 17 00:00:00 2001 From: thez3ro Date: Wed, 17 May 2017 13:03:51 +0200 Subject: [PATCH] fix codestyle and use C++11 keywords --- src/core/ScreenLockListener.h | 2 +- src/core/ScreenLockListenerDBus.cpp | 8 ++++---- src/core/ScreenLockListenerDBus.h | 2 +- src/core/ScreenLockListenerMac.cpp | 2 +- src/core/ScreenLockListenerPrivate.cpp | 6 ++---- src/core/ScreenLockListenerPrivate.h | 2 +- src/core/ScreenLockListenerWin.cpp | 8 ++++---- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/core/ScreenLockListener.h b/src/core/ScreenLockListener.h index bc115d19..b4eb81e0 100644 --- a/src/core/ScreenLockListener.h +++ b/src/core/ScreenLockListener.h @@ -28,7 +28,7 @@ public: ScreenLockListener(QWidget* parent = nullptr); ~ScreenLockListener(); -Q_SIGNALS: +signals: void screenLocked(); private: diff --git a/src/core/ScreenLockListenerDBus.cpp b/src/core/ScreenLockListenerDBus.cpp index e24e388a..1976b47e 100644 --- a/src/core/ScreenLockListenerDBus.cpp +++ b/src/core/ScreenLockListenerDBus.cpp @@ -63,25 +63,25 @@ ScreenLockListenerDBus::ScreenLockListenerDBus(QWidget *parent): void ScreenLockListenerDBus::gnomeSessionStatusChanged(uint status) { if (status != 0) { - Q_EMIT screenLocked(); + emit screenLocked(); } } void ScreenLockListenerDBus::logindPrepareForSleep(bool beforeSleep) { if (beforeSleep) { - Q_EMIT screenLocked(); + emit screenLocked(); } } void ScreenLockListenerDBus::unityLocked() { - Q_EMIT screenLocked(); + emit screenLocked(); } void ScreenLockListenerDBus::freedesktopScreenSaver(bool status) { if (status) { - Q_EMIT screenLocked(); + emit screenLocked(); } } \ No newline at end of file diff --git a/src/core/ScreenLockListenerDBus.h b/src/core/ScreenLockListenerDBus.h index a907f20c..72f308f7 100644 --- a/src/core/ScreenLockListenerDBus.h +++ b/src/core/ScreenLockListenerDBus.h @@ -27,7 +27,7 @@ class ScreenLockListenerDBus : public ScreenLockListenerPrivate public: explicit ScreenLockListenerDBus(QWidget *parent = 0); -private Q_SLOTS: +private slots: void gnomeSessionStatusChanged(uint status); void logindPrepareForSleep(bool beforeSleep); void unityLocked(); diff --git a/src/core/ScreenLockListenerMac.cpp b/src/core/ScreenLockListenerMac.cpp index d919adb6..dce05de3 100644 --- a/src/core/ScreenLockListenerMac.cpp +++ b/src/core/ScreenLockListenerMac.cpp @@ -59,5 +59,5 @@ ScreenLockListenerMac::ScreenLockListenerMac(QWidget* parent) void ScreenLockListenerMac::onSignalReception() { - Q_EMIT screenLocked(); + emit screenLocked(); } diff --git a/src/core/ScreenLockListenerPrivate.cpp b/src/core/ScreenLockListenerPrivate.cpp index 9a0ebd69..36ee301f 100644 --- a/src/core/ScreenLockListenerPrivate.cpp +++ b/src/core/ScreenLockListenerPrivate.cpp @@ -36,11 +36,9 @@ ScreenLockListenerPrivate* ScreenLockListenerPrivate::instance(QWidget* parent) #if defined(Q_OS_OSX) Q_UNUSED(parent); return ScreenLockListenerMac::instance(); -#endif -#if defined(Q_OS_LINUX) +#elif defined(Q_OS_LINUX) return new ScreenLockListenerDBus(parent); -#endif -#if defined(Q_OS_WIN) +#elif defined(Q_OS_WIN) return new ScreenLockListenerWin(parent); #endif } diff --git a/src/core/ScreenLockListenerPrivate.h b/src/core/ScreenLockListenerPrivate.h index 781d6452..8ecad17d 100644 --- a/src/core/ScreenLockListenerPrivate.h +++ b/src/core/ScreenLockListenerPrivate.h @@ -29,7 +29,7 @@ public: protected: ScreenLockListenerPrivate(QWidget* parent = 0); -Q_SIGNALS: +signals: void screenLocked(); }; diff --git a/src/core/ScreenLockListenerWin.cpp b/src/core/ScreenLockListenerWin.cpp index 9429393f..a1bf13d4 100644 --- a/src/core/ScreenLockListenerWin.cpp +++ b/src/core/ScreenLockListenerWin.cpp @@ -67,22 +67,22 @@ bool ScreenLockListenerWin::nativeEventFilter(const QByteArray& eventType, void* if (setting != nullptr && setting->PowerSetting == GUID_LIDSWITCH_STATE_CHANGE) { const DWORD* state = reinterpret_cast(&setting->Data); if (*state == 0) { - Q_EMIT screenLocked(); + emit screenLocked(); return true; } } } else if (m->wParam == PBT_APMSUSPEND) { - Q_EMIT screenLocked(); + emit screenLocked(); return true; } } if (m->message == WM_WTSSESSION_CHANGE) { if (m->wParam == WTS_CONSOLE_DISCONNECT) { - Q_EMIT screenLocked(); + emit screenLocked(); return true; } if (m->wParam == WTS_SESSION_LOCK) { - Q_EMIT screenLocked(); + emit screenLocked(); return true; } }