Styling + CFNotificationName -> CFStringRef

This commit is contained in:
Louis-Bertrand Varin 2017-05-10 11:05:17 -04:00 committed by thez3ro
parent 533136fb0e
commit 970525cfd4
No known key found for this signature in database
GPG Key ID: F628F9E41DD7C073
4 changed files with 14 additions and 12 deletions

View File

@ -32,8 +32,9 @@ ScreenLockListenerMac* ScreenLockListenerMac::instance()
return m_ptr; return m_ptr;
} }
void ScreenLockListenerMac::notificationCenterCallBack(CFNotificationCenterRef /*center*/, void */*observer*/, void ScreenLockListenerMac::notificationCenterCallBack(CFNotificationCenterRef, void*,
CFNotificationName /*name*/, const void */*object*/, CFDictionaryRef /*userInfo*/) CFStringRef, const void*,
CFDictionaryRef)
{ {
instance()->onSignalReception(); instance()->onSignalReception();
} }
@ -48,12 +49,12 @@ ScreenLockListenerMac::ScreenLockListenerMac(QWidget* parent)
return; return;
} }
CFNotificationCenterAddObserver( CFNotificationCenterAddObserver(distCenter,
distCenter, this,
this, &ScreenLockListenerMac::notificationCenterCallBack, &ScreenLockListenerMac::notificationCenterCallBack,
screenIsLockedSignal, screenIsLockedSignal,
nullptr, nullptr,
CFNotificationSuspensionBehaviorDeliverImmediately); CFNotificationSuspensionBehaviorDeliverImmediately);
} }
void ScreenLockListenerMac::onSignalReception() void ScreenLockListenerMac::onSignalReception()

View File

@ -29,8 +29,9 @@ class ScreenLockListenerMac: public ScreenLockListenerPrivate {
public: public:
static ScreenLockListenerMac* instance(); static ScreenLockListenerMac* instance();
static void notificationCenterCallBack(CFNotificationCenterRef /*center*/, void */*observer*/, static void notificationCenterCallBack(CFNotificationCenterRef center, void* observer,
CFNotificationName /*name*/, const void */*object*/, CFDictionaryRef /*userInfo*/); CFStringRef name, const void* object,
CFDictionaryRef userInfo);
private: private:
ScreenLockListenerMac(QWidget* parent = nullptr); ScreenLockListenerMac(QWidget* parent = nullptr);

View File

@ -57,7 +57,7 @@ ScreenLockListenerWin::~ScreenLockListenerWin()
} }
} }
bool ScreenLockListenerWin::nativeEventFilter(const QByteArray &eventType, void* message, long *) bool ScreenLockListenerWin::nativeEventFilter(const QByteArray& eventType, void* message, long*)
{ {
if (eventType == "windows_generic_MSG" || eventType == "windows_dispatcher_MSG") { if (eventType == "windows_generic_MSG" || eventType == "windows_dispatcher_MSG") {
MSG* m = static_cast<MSG*>(message); MSG* m = static_cast<MSG*>(message);

View File

@ -29,7 +29,7 @@ class ScreenLockListenerWin : public ScreenLockListenerPrivate, public QAbstract
public: public:
explicit ScreenLockListenerWin(QWidget* parent = 0); explicit ScreenLockListenerWin(QWidget* parent = 0);
~ScreenLockListenerWin(); ~ScreenLockListenerWin();
virtual bool nativeEventFilter(const QByteArray &eventType, void* message, long *) override; virtual bool nativeEventFilter(const QByteArray &eventType, void* message, long*) override;
private: private:
void* m_powerNotificationHandle ; void* m_powerNotificationHandle ;