|
Added
Link Here
|
| 1 |
diff --git a/src/lib/playlistmodel.cpp b/src/lib/playlistmodel.cpp |
| 2 |
index 69a8d46..dab4967 100644 |
| 3 |
--- ./src/lib/playlistmodel.cpp |
| 4 |
+++ ./src/lib/playlistmodel.cpp |
| 5 |
@@ -27,6 +27,9 @@ |
| 6 |
|
| 7 |
#include "playlistmodel.h" |
| 8 |
|
| 9 |
+// Used to check for Protocolversion at compiletime |
| 10 |
+#include <xmmsc/xmmsc_idnumbers.h> |
| 11 |
+ |
| 12 |
PlaylistModel::PlaylistModel (QObject *parent, XClient *client, const QString &name) : QAbstractItemModel (parent) |
| 13 |
{ |
| 14 |
// m_columns.append ("#"); |
| 15 |
@@ -108,6 +111,19 @@ PlaylistModel::handle_pls_loaded (const std::string &name) |
| 16 |
return true; |
| 17 |
} |
| 18 |
|
| 19 |
+#if (XMMS_IPC_PROTOCOL_VERSION > 10) |
| 20 |
+bool |
| 21 |
+PlaylistModel::handle_update_pos (const Xmms::Dict &posdict) |
| 22 |
+{ |
| 23 |
+ QString changed_pl = XClient::stdToQ (posdict.get<std::string> ("name")); |
| 24 |
+ if (changed_pl == m_name) { |
| 25 |
+ uint32_t pos = posdict.get<uint32_t> ("position"); |
| 26 |
+ m_current_pos = pos; |
| 27 |
+ emit dataChanged(index (pos, 0), index (pos, m_columns.size ())); |
| 28 |
+ } |
| 29 |
+ return true; |
| 30 |
+} |
| 31 |
+#else |
| 32 |
bool |
| 33 |
PlaylistModel::handle_update_pos (const uint32_t &pos) |
| 34 |
{ |
| 35 |
@@ -115,6 +131,7 @@ PlaylistModel::handle_update_pos (const uint32_t &pos) |
| 36 |
emit dataChanged(index (pos, 0), index (pos, m_columns.size ())); |
| 37 |
return true; |
| 38 |
} |
| 39 |
+#endif |
| 40 |
|
| 41 |
QList<QString> |
| 42 |
PlaylistModel::columns () const |