diff --git a/README b/README index 4632dc6..a2c4e8a 100644 --- a/README +++ b/README @@ -5,6 +5,7 @@ Required dependencys: - promoe should compile with DrK - if you compile against xmms2-devel make sure it isn't not older than 2008-05-15 + (and get the patch for bug 1973 if necessary) Optional dependencys: * Avahi http://www.avahi.org/ diff --git a/lib/playlistmodel.cpp b/lib/playlistmodel.cpp index 4ab291b..c449c48 100644 --- a/lib/playlistmodel.cpp +++ b/lib/playlistmodel.cpp @@ -96,11 +96,7 @@ PlaylistModel::got_connection (XClient *client) client->playlist ()->currentPos () (Xmms::bind (&PlaylistModel::handle_update_pos, this)); client->playlist ()->broadcastChanged () (Xmms::bind (&PlaylistModel::handle_change, this)); -#if (XMMS_IPC_PROTOCOL_VERSION > 10) - client->playlist ()->broadcastCurrentPos () (Xmms::bind (&PlaylistModel::handle_update_positions, this)); -#else client->playlist ()->broadcastCurrentPos () (Xmms::bind (&PlaylistModel::handle_update_pos, this)); -#endif client->playlist ()->broadcastLoaded () (Xmms::bind (&PlaylistModel::handle_pls_loaded, this)); @@ -119,17 +115,19 @@ PlaylistModel::handle_pls_loaded (const std::string &name) return true; } +#if (XMMS_IPC_PROTOCOL_VERSION > 10) bool -PlaylistModel::handle_update_positions (const Xmms::Dict &pos) +PlaylistModel::handle_update_pos (const Xmms::Dict &posdict) { - QString changed_pl = XClient::stdToQ (pos.get ("name")); + QString changed_pl = XClient::stdToQ (posdict.get ("name")); if (changed_pl == m_name) { - uint32_t newpos = pos.get ("position"); - return handle_update_pos (newpos); + uint32_t pos = posdict.get ("position"); + m_current_pos = pos; + emit dataChanged(index (pos, 0), index (pos, m_columns.size ())); } return true; } - +#else bool PlaylistModel::handle_update_pos (const uint32_t &pos) { @@ -137,6 +135,7 @@ PlaylistModel::handle_update_pos (const uint32_t &pos) emit dataChanged(index (pos, 0), index (pos, m_columns.size ())); return true; } +#endif QList PlaylistModel::columns () const diff --git a/lib/playlistmodel.h b/lib/playlistmodel.h index 5a79379..11a153e 100644 --- a/lib/playlistmodel.h +++ b/lib/playlistmodel.h @@ -130,8 +130,11 @@ class PlaylistModel : public QAbstractItemModel private: bool handle_list (const Xmms::List< unsigned int > &list); bool handle_change (const Xmms::Dict &chg); - bool handle_update_positions (const Xmms::Dict &pos); +#if (XMMS_IPC_PROTOCOL_VERSION > 10) + bool handle_update_pos (const Xmms::Dict &pos); +#else bool handle_update_pos (const unsigned int &pos); +#endif bool handle_pls_loaded (const std::string &); bool handle_current_pls (const std::string &);