From 56331dc881bb1526cba8ad1807690ecf37f6249d Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 9 Sep 2019 16:52:30 +0000 Subject: fixed build regression git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9069 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/listenbrainz/listenbrainz.cpp | 1 + src/plugins/General/rdetect/removablehelper.cpp | 17 +++++++++-------- src/plugins/General/scrobbler/scrobbler.cpp | 1 + 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src/plugins/General') diff --git a/src/plugins/General/listenbrainz/listenbrainz.cpp b/src/plugins/General/listenbrainz/listenbrainz.cpp index 44ea00ba0..4bb43d1d6 100644 --- a/src/plugins/General/listenbrainz/listenbrainz.cpp +++ b/src/plugins/General/listenbrainz/listenbrainz.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/src/plugins/General/rdetect/removablehelper.cpp b/src/plugins/General/rdetect/removablehelper.cpp index 0e891f5ca..0751a12c5 100644 --- a/src/plugins/General/rdetect/removablehelper.cpp +++ b/src/plugins/General/rdetect/removablehelper.cpp @@ -97,9 +97,9 @@ void RemovableHelper::processAction(QAction *action) void RemovableHelper::updateActions() { - QList volumes = QStorageInfo::mountedVolumes(); + const QList volumes = QStorageInfo::mountedVolumes(); - foreach(const QStorageInfo &storage, volumes) + for(const QStorageInfo &storage : qAsConst(volumes)) { if(!storage.isValid() || !storage.isReady()) continue; @@ -155,11 +155,12 @@ void RemovableHelper::updateActions() } } // remove action if device is unmounted/removed - for(const QAction *action : m_actions->actions()) + const QList actions = m_actions->actions(); + for(QAction *action : qAsConst(actions)) { bool found = false; - foreach(const QStorageInfo &storage, volumes) + for(const QStorageInfo &storage : qAsConst(volumes)) { QString dev_path = storage.rootPath(); if(isAudioCd(dev_path)) @@ -188,7 +189,7 @@ void RemovableHelper::updateActions() QAction *RemovableHelper::findAction(const QString &dev_path) { - for(const QAction *action : m_actions->actions()) + for(QAction *action : m_actions->actions()) { if (action->data().toString() == dev_path) return action; @@ -200,7 +201,7 @@ void RemovableHelper::addPath(const QString &path) { PlayListModel *model = PlayListManager::instance()->selectedPlayList(); - for(const PlayListItem *item : model->items()) // Is it already exist? + for(PlayListItem *item : model->items()) // Is it already exist? { if(item->isGroup()) continue; @@ -210,11 +211,11 @@ void RemovableHelper::addPath(const QString &path) if (path.startsWith("cdda://") && m_addTracks) { - PlayListManager::instance()->selectedPlayList()->add(path); + model->add(path); return; } else if (!path.startsWith("cdda://") && m_addFiles) - PlayListManager::instance()->selectedPlayList()->add(path); + model->add(path); } void RemovableHelper::removePath(const QString &path) diff --git a/src/plugins/General/scrobbler/scrobbler.cpp b/src/plugins/General/scrobbler/scrobbler.cpp index 0a8b114f4..b103853fa 100644 --- a/src/plugins/General/scrobbler/scrobbler.cpp +++ b/src/plugins/General/scrobbler/scrobbler.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3-13-gbd6f