aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/playlistmodel.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2020-08-13 10:46:51 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2020-08-13 10:46:51 +0000
commit6cf6bc2f667ea229d3864a8767982bdecab7b146 (patch)
treeafd9602f80bad18e6c69d74feb9d85c561cf65ff /src/qmmpui/playlistmodel.cpp
parent90dedc4493d21f3057d86ce4289eee6471a243b5 (diff)
downloadqmmp-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/playlistmodel.cpp')
-rw-r--r--src/qmmpui/playlistmodel.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp
index 3b5ae17ed..9c44acc3b 100644
--- a/src/qmmpui/playlistmodel.cpp
+++ b/src/qmmpui/playlistmodel.cpp
@@ -20,6 +20,7 @@
#include <QWidget>
#include <QtAlgorithms>
#include <QTextStream>
+#include <algorithm>
#include <time.h>
#include <qmmp/metadatamanager.h>
#include "metadatahelper_p.h"
@@ -39,14 +40,11 @@
#define INVALID_INDEX -1
PlayListModel::PlayListModel(const QString &name, QObject *parent)
- : QObject(parent) , m_selection()
+ : QObject(parent) , m_name(name)
{
qsrand(time(nullptr));
m_ui_settings = QmmpUiSettings::instance();
- m_total_duration = 0;
- m_current = 0;
- m_stop_track = nullptr;
- m_name = name;
+
m_loader = new FileLoader(this);
m_task = new PlayListTask(this);
if(m_ui_settings->isGroupsEnabled())
@@ -728,11 +726,8 @@ void PlayListModel::moveItems(int from, int to)
if(selected_indexes.isEmpty())
return;
- for(const int &i : qAsConst(selected_indexes)) //do no move groups
- {
- if(!isTrack(i))
- return;
- }
+ if(std::any_of(selected_indexes.cbegin(), selected_indexes.cend(), [this](int i){ return !isTrack(i); }))
+ return;
if (bottommostInSelection(from) == INVALID_INDEX ||
from == INVALID_INDEX ||
@@ -959,7 +954,7 @@ void PlayListModel::onTaskFinished()
|| m_task->type() == PlayListTask::REFRESH)
{
PlayListTrack *prev_current_track = m_current_track;
- bool prev_count = m_container->count();
+ int prev_count = m_container->count();
m_container->replaceTracks(m_task->takeResults(&m_current_track));