diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-08-12 21:03:34 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-08-12 21:03:34 +0000 |
| commit | 7ef8d11baeaf1847ba7f1df5d858f8cffea9300d (patch) | |
| tree | a741fb49db8834efd4b46d760b89082547eb2a9d /src/plugins/General/statusicon/qmmptrayicon.cpp | |
| parent | 6f301f5880f7efce76ed46e7b502830642b87370 (diff) | |
| download | qmmp-7ef8d11baeaf1847ba7f1df5d858f8cffea9300d.tar.gz qmmp-7ef8d11baeaf1847ba7f1df5d858f8cffea9300d.tar.bz2 qmmp-7ef8d11baeaf1847ba7f1df5d858f8cffea9300d.zip | |
coding style fixes
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9470 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/statusicon/qmmptrayicon.cpp')
| -rw-r--r-- | src/plugins/General/statusicon/qmmptrayicon.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/plugins/General/statusicon/qmmptrayicon.cpp b/src/plugins/General/statusicon/qmmptrayicon.cpp index 1f65a3a75..efaec4810 100644 --- a/src/plugins/General/statusicon/qmmptrayicon.cpp +++ b/src/plugins/General/statusicon/qmmptrayicon.cpp @@ -24,7 +24,7 @@ #include <QGuiApplication> #include <QWindow> #include <qmmp/soundcore.h> - +#include <algorithm> #include "qmmptrayicon.h" #ifdef QMMP_WS_X11 #include "statusiconpopupwidget.h" @@ -61,7 +61,7 @@ bool QmmpTrayIcon::event(QEvent *e) { if (e->type() == QEvent::Wheel ) { - wheelEvent((QWheelEvent *) e); + wheelEvent(dynamic_cast<QWheelEvent *>(e)); e->accept(); return true; } @@ -78,12 +78,8 @@ bool QmmpTrayIcon::hasToolTipEvent() { //checking for XEmbed system tray implementation //only this implementation is able to send QHelpEvent - for(const QWindow *w : qApp->allWindows()) - { - if(w->objectName() == "QSystemTrayIconSysWindow") - return true; - } - return false; + const QWindowList windowList = qApp->allWindows(); + return std::any_of(windowList.cbegin(), windowList.cend(), [](QWindow *w){ return w->objectName() == "QSystemTrayIconSysWindow"; }); } void QmmpTrayIcon::wheelEvent(QWheelEvent *e) |
