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();
Q_SIGNALS:
signals:
void screenLocked();
private:

View File

@ -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();
}
}

View File

@ -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();

View File

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

View File

@ -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
}

View File

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

View File

@ -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<const DWORD*>(&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;
}
}