aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qmmpui/playlistmodel.cpp4
-rw-r--r--src/ui/display.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp
index 6934c2c42..3afa743fa 100644
--- a/src/qmmpui/playlistmodel.cpp
+++ b/src/qmmpui/playlistmodel.cpp
@@ -111,10 +111,10 @@ void PlayListModel::add(PlayListItem *item)
m_total_length += item->length();
m_items << item;
+ m_current = m_items.indexOf(m_currentItem);
if (m_items.size() == 1)
- emit firstAdded();
- m_current = m_items.indexOf(m_currentItem);
+ emit firstAdded();
emit listChanged();
}
diff --git a/src/ui/display.cpp b/src/ui/display.cpp
index fab49fbf9..c8c619541 100644
--- a/src/ui/display.cpp
+++ b/src/ui/display.cpp
@@ -23,7 +23,7 @@
#include <QMenu>
#include <qmmp/soundcore.h>
#include <qmmpui/mediaplayer.h>
-#include <qmmpui/playlistmodel.h>
+#include <qmmpui/playlistmanager.h>
#include "skin.h"
#include "mainvisual.h"
#include "button.h"
@@ -114,9 +114,9 @@ MainDisplay::MainDisplay (QWidget *parent)
connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(setState(Qmmp::State)));
connect(m_core, SIGNAL(volumeChanged(int,int)), SLOT(setVolume(int, int)));
connect(m_core, SIGNAL(elapsedChanged(qint64)),m_titlebar, SLOT(setTime(qint64)));
- /*PlayListModel *model = MediaPlayer::instance()->playListModel();
- connect(model, SIGNAL(repeatableListChanged(bool)), m_repeatButton, SLOT(setON(bool)));
- connect(model, SIGNAL(shuffleChanged(bool)), m_shuffleButton, SLOT(setON(bool)));*/
+ PlayListManager *pl_manager = MediaPlayer::instance()->playListManager();
+ connect(pl_manager, SIGNAL(repeatableListChanged(bool)), m_repeatButton, SLOT(setON(bool)));
+ connect(pl_manager, SIGNAL(shuffleChanged(bool)), m_shuffleButton, SLOT(setON(bool)));
updatePositions();
updateMask();
}