diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-01-03 07:41:04 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-01-03 07:41:04 +0000 |
| commit | b917024aa1ac4cb0a40164132db3c6d2913157eb (patch) | |
| tree | 4424bef9f2ac9a3dab21c822836a1b5c79ffee47 /src/qmmpui/playlistmodel.cpp | |
| parent | bef5a901922c002815d047d276e61ec0bf8c0f46 (diff) | |
| download | qmmp-b917024aa1ac4cb0a40164132db3c6d2913157eb.tar.gz qmmp-b917024aa1ac4cb0a40164132db3c6d2913157eb.tar.bz2 qmmp-b917024aa1ac4cb0a40164132db3c6d2913157eb.zip | |
fixed build with -Werror=zero-as-null-pointer-constant
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8572 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playlistmodel.cpp')
| -rw-r--r-- | src/qmmpui/playlistmodel.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp index 2a99e40c6..3883f28ad 100644 --- a/src/qmmpui/playlistmodel.cpp +++ b/src/qmmpui/playlistmodel.cpp @@ -41,11 +41,11 @@ PlayListModel::PlayListModel(const QString &name, QObject *parent) : QObject(parent) , m_selection() { - qsrand(time(0)); + qsrand(time(nullptr)); m_ui_settings = QmmpUiSettings::instance(); m_total_duration = 0; m_current = 0; - m_stop_track = 0; + m_stop_track = nullptr; m_name = name; m_loader = new FileLoader(this); m_task = new PlayListTask(this); @@ -267,20 +267,20 @@ int PlayListModel::columnCount() const PlayListTrack* PlayListModel::currentTrack() const { - return m_container->isEmpty() ? 0 : m_current_track; + return m_container->isEmpty() ? nullptr : m_current_track; } PlayListTrack *PlayListModel::nextTrack() const { if(m_container->isEmpty() || !m_play_state) - return 0; + return nullptr; if(m_stop_track && m_stop_track == currentTrack()) - return 0; + return nullptr; if(!isEmptyQueue()) return m_queued_songs.at(0); int index = m_play_state->nextIndex(); if(index < 0 || (index + 1 > m_container->count())) - return 0; + return nullptr; return m_container->track(index); } @@ -350,7 +350,7 @@ bool PlayListModel::next() { if(m_stop_track == currentTrack()) { - m_stop_track = 0; + m_stop_track = nullptr; emit listChanged(STOP_AFTER); return false; } @@ -378,7 +378,7 @@ void PlayListModel::clear() { m_loader->finish(); m_current = 0; - m_stop_track = 0; + m_stop_track = nullptr; m_container->clear(); m_queued_songs.clear(); m_total_duration = 0; @@ -428,7 +428,7 @@ PlayListTrack *PlayListModel::findTrack(int track_index) const QList<PlayListItem *> PlayListModel::findTracks(const QString &str) const { QList<PlayListItem *> items; - PlayListItem *item = 0; + PlayListItem *item = nullptr; if(str.isEmpty()) return items; @@ -562,7 +562,7 @@ int PlayListModel::removeTrackInternal(int i) if(m_stop_track == track) { flags |= STOP_AFTER; - m_stop_track = 0; + m_stop_track = nullptr; } if(track->isSelected()) flags |= SELECTION; @@ -574,7 +574,7 @@ int PlayListModel::removeTrackInternal(int i) { flags |= CURRENT; if(m_container->isEmpty()) - m_current_track = 0; + m_current_track = nullptr; else { m_current = i > 0 ? qMin(i - 1, m_container->count() - 1) : 0; @@ -870,7 +870,7 @@ void PlayListModel::prepareForShufflePlaying(bool val) void PlayListModel::prepareGroups(bool enabled) { - PlayListContainer *container = 0; + PlayListContainer *container = nullptr; if(enabled) container = new GroupedContainer; else @@ -927,7 +927,7 @@ void PlayListModel::onTaskFinished() if(m_stop_track && !m_container->contains(m_stop_track)) { - m_stop_track = 0; + m_stop_track = nullptr; flags |= STOP_AFTER; } @@ -1006,7 +1006,7 @@ void PlayListModel::refresh() void PlayListModel::clearQueue() { m_queued_songs.clear(); - m_stop_track = 0; + m_stop_track = nullptr; emit listChanged(QUEUE); } @@ -1016,11 +1016,11 @@ void PlayListModel::stopAfterSelected() int flags = STOP_AFTER; if(!m_queued_songs.isEmpty()) { - m_stop_track = m_stop_track != m_queued_songs.last() ? m_queued_songs.last() : 0; + m_stop_track = m_stop_track != m_queued_songs.last() ? m_queued_songs.last() : nullptr; } else if(selected_tracks.count() == 1) { - m_stop_track = m_stop_track != selected_tracks.at(0) ? selected_tracks.at(0) : 0; + m_stop_track = m_stop_track != selected_tracks.at(0) ? selected_tracks.at(0) : nullptr; } else if(selected_tracks.count() > 1) { |
