fix codestyle and use C++11 keywords

This commit is contained in:
thez3ro 2017-05-17 13:03:51 +02:00
parent 970525cfd4
commit b69b50c6c6
No known key found for this signature in database
GPG Key ID: F628F9E41DD7C073
7 changed files with 14 additions and 16 deletions

View File

@ -28,7 +28,7 @@ public:
ScreenLockListener(QWidget* parent = nullptr); ScreenLockListener(QWidget* parent = nullptr);
~ScreenLockListener(); ~ScreenLockListener();
Q_SIGNALS: signals:
void screenLocked(); void screenLocked();
private: private:

View File

@ -63,25 +63,25 @@ ScreenLockListenerDBus::ScreenLockListenerDBus(QWidget *parent):
void ScreenLockListenerDBus::gnomeSessionStatusChanged(uint status) void ScreenLockListenerDBus::gnomeSessionStatusChanged(uint status)
{ {
if (status != 0) { if (status != 0) {
Q_EMIT screenLocked(); emit screenLocked();
} }
} }
void ScreenLockListenerDBus::logindPrepareForSleep(bool beforeSleep) void ScreenLockListenerDBus::logindPrepareForSleep(bool beforeSleep)
{ {
if (beforeSleep) { if (beforeSleep) {
Q_EMIT screenLocked(); emit screenLocked();
} }
} }
void ScreenLockListenerDBus::unityLocked() void ScreenLockListenerDBus::unityLocked()
{ {
Q_EMIT screenLocked(); emit screenLocked();
} }
void ScreenLockListenerDBus::freedesktopScreenSaver(bool status) void ScreenLockListenerDBus::freedesktopScreenSaver(bool status)
{ {
if (status) { if (status) {
Q_EMIT screenLocked(); emit screenLocked();
} }
} }

View File

@ -27,7 +27,7 @@ class ScreenLockListenerDBus : public ScreenLockListenerPrivate
public: public:
explicit ScreenLockListenerDBus(QWidget *parent = 0); explicit ScreenLockListenerDBus(QWidget *parent = 0);
private Q_SLOTS: private slots:
void gnomeSessionStatusChanged(uint status); void gnomeSessionStatusChanged(uint status);
void logindPrepareForSleep(bool beforeSleep); void logindPrepareForSleep(bool beforeSleep);
void unityLocked(); void unityLocked();

View File

@ -59,5 +59,5 @@ ScreenLockListenerMac::ScreenLockListenerMac(QWidget* parent)
void ScreenLockListenerMac::onSignalReception() void ScreenLockListenerMac::onSignalReception()
{ {
Q_EMIT screenLocked(); emit screenLocked();
} }

View File

@ -36,11 +36,9 @@ ScreenLockListenerPrivate* ScreenLockListenerPrivate::instance(QWidget* parent)
#if defined(Q_OS_OSX) #if defined(Q_OS_OSX)
Q_UNUSED(parent); Q_UNUSED(parent);
return ScreenLockListenerMac::instance(); return ScreenLockListenerMac::instance();
#endif #elif defined(Q_OS_LINUX)
#if defined(Q_OS_LINUX)
return new ScreenLockListenerDBus(parent); return new ScreenLockListenerDBus(parent);
#endif #elif defined(Q_OS_WIN)
#if defined(Q_OS_WIN)
return new ScreenLockListenerWin(parent); return new ScreenLockListenerWin(parent);
#endif #endif
} }

View File

@ -29,7 +29,7 @@ public:
protected: protected:
ScreenLockListenerPrivate(QWidget* parent = 0); ScreenLockListenerPrivate(QWidget* parent = 0);
Q_SIGNALS: signals:
void screenLocked(); void screenLocked();
}; };

View File

@ -67,22 +67,22 @@ bool ScreenLockListenerWin::nativeEventFilter(const QByteArray& eventType, void*
if (setting != nullptr && setting->PowerSetting == GUID_LIDSWITCH_STATE_CHANGE) { if (setting != nullptr && setting->PowerSetting == GUID_LIDSWITCH_STATE_CHANGE) {
const DWORD* state = reinterpret_cast<const DWORD*>(&setting->Data); const DWORD* state = reinterpret_cast<const DWORD*>(&setting->Data);
if (*state == 0) { if (*state == 0) {
Q_EMIT screenLocked(); emit screenLocked();
return true; return true;
} }
} }
} else if (m->wParam == PBT_APMSUSPEND) { } else if (m->wParam == PBT_APMSUSPEND) {
Q_EMIT screenLocked(); emit screenLocked();
return true; return true;
} }
} }
if (m->message == WM_WTSSESSION_CHANGE) { if (m->message == WM_WTSSESSION_CHANGE) {
if (m->wParam == WTS_CONSOLE_DISCONNECT) { if (m->wParam == WTS_CONSOLE_DISCONNECT) {
Q_EMIT screenLocked(); emit screenLocked();
return true; return true;
} }
if (m->wParam == WTS_SESSION_LOCK) { if (m->wParam == WTS_SESSION_LOCK) {
Q_EMIT screenLocked(); emit screenLocked();
return true; return true;
} }
} }