mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-28 15:27:18 -05:00
fix codestyle and use C++11 keywords
This commit is contained in:
parent
970525cfd4
commit
b69b50c6c6
@ -28,7 +28,7 @@ public:
|
|||||||
ScreenLockListener(QWidget* parent = nullptr);
|
ScreenLockListener(QWidget* parent = nullptr);
|
||||||
~ScreenLockListener();
|
~ScreenLockListener();
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void screenLocked();
|
void screenLocked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -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();
|
||||||
|
@ -59,5 +59,5 @@ ScreenLockListenerMac::ScreenLockListenerMac(QWidget* parent)
|
|||||||
|
|
||||||
void ScreenLockListenerMac::onSignalReception()
|
void ScreenLockListenerMac::onSignalReception()
|
||||||
{
|
{
|
||||||
Q_EMIT screenLocked();
|
emit screenLocked();
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
ScreenLockListenerPrivate(QWidget* parent = 0);
|
ScreenLockListenerPrivate(QWidget* parent = 0);
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void screenLocked();
|
void screenLocked();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user