diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-08-13 10:46:51 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-08-13 10:46:51 +0000 |
| commit | 6cf6bc2f667ea229d3864a8767982bdecab7b146 (patch) | |
| tree | afd9602f80bad18e6c69d74feb9d85c561cf65ff /src/qmmpui/uihelper.cpp | |
| parent | 90dedc4493d21f3057d86ce4289eee6471a243b5 (diff) | |
| download | qmmp-6cf6bc2f667ea229d3864a8767982bdecab7b146.tar.gz qmmp-6cf6bc2f667ea229d3864a8767982bdecab7b146.tar.bz2 qmmp-6cf6bc2f667ea229d3864a8767982bdecab7b146.zip | |
coding style fixes
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9472 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/uihelper.cpp')
| -rw-r--r-- | src/qmmpui/uihelper.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/qmmpui/uihelper.cpp b/src/qmmpui/uihelper.cpp index d2ada8e9b..6e800b831 100644 --- a/src/qmmpui/uihelper.cpp +++ b/src/qmmpui/uihelper.cpp @@ -26,6 +26,7 @@ #include <QApplication> #include <QMessageBox> #include <QFileInfo> +#include <algorithm> #include <qmmp/soundcore.h> #include <qmmp/metadatamanager.h> #include "filedialog.h" @@ -46,7 +47,6 @@ UiHelper::UiHelper(QObject *parent) : QObject(parent) { m_instance = this; - m_jumpDialog = nullptr; General::create(parent); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_lastDir = settings.value("General/last_dir", QDir::homePath()).toString(); //last directory @@ -60,12 +60,9 @@ UiHelper::~UiHelper() bool UiHelper::visibilityControl() { - for(const GeneralFactory *factory : General::enabledFactories()) - { - if (factory->properties().visibilityControl) - return true; - } - return false; + const QList<GeneralFactory *> factories = General::enabledFactories(); + return std::any_of(factories.cbegin(), factories.cend(), + [](GeneralFactory *factory){ return factory->properties().visibilityControl; }); } void UiHelper::addAction(QAction *action, MenuType type) @@ -292,7 +289,7 @@ UiHelper* UiHelper::instance() void UiHelper::removeAction(QObject *action) { - removeAction((QAction *) action); + removeAction(qobject_cast<QAction *>(action)); } void UiHelper::addSelectedFiles(const QStringList &files, bool play) |
