aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/General/listenbrainz/listenbrainz.cpp1
-rw-r--r--src/plugins/General/rdetect/removablehelper.cpp17
-rw-r--r--src/plugins/General/scrobbler/scrobbler.cpp1
3 files changed, 11 insertions, 8 deletions
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 <QTimer>
#include <QDesktopServices>
#include <QSettings>
+#include <QDateTime>
#include <qmmp/soundcore.h>
#include <qmmp/qmmpsettings.h>
#include <qmmp/qmmp.h>
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<QStorageInfo> volumes = QStorageInfo::mountedVolumes();
+ const QList<QStorageInfo> 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<QAction *> 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 <QTimer>
#include <QDesktopServices>
#include <QSettings>
+#include <QDateTime>
#include <qmmp/soundcore.h>
#include <qmmp/qmmpsettings.h>
#include <qmmp/qmmp.h>