Permalink
Browse files

tmp

  • Loading branch information...
1 parent 9432774 commit 4e5265bbb224c82f70b46e6317642f0403dd345d @RJ committed Feb 9, 2010
Showing with 14 additions and 16 deletions.
  1. +14 −0 src/remotecollectionconnection.cpp
  2. +0 −16 src/remotecollectionconnection.h
@@ -4,4 +4,18 @@
void RemoteCollectionConnection::setup()
{
m_rc = new RemoteCollection(m_servent, this);
+
+ // send all tracks TODO use a LibraryCollection for this
+ // so that in future, we could reproxy easily
+ QVariantList all = m_library->allTracks();
+ qDebug() << "Sending our library of " << all.length() << " tracks...";
+
+ QVariantMap response;
+ response["method"] = "alltracks";
+ response["tracks"] = all;
+
+ QJson::Serializer serializer;
+ const QByteArray serialized = serializer.serialize( response );
+ qDebug() << "Sending full tracklist, size: " << serialized.length();
+ sendMsg(serialized);
}
@@ -32,22 +32,6 @@ class RemoteCollectionConnection : public Connection
void handleMsg(QByteArray msg)
{
- if(msg == "ALLTRACKSREQUEST")
- {
- // send all tracks
- QVariantList /*QList<QVariantMap>*/ all = m_library->allTracks();
- qDebug() << "Sending our library of " << all.length() << " tracks...";
-
- QVariantMap response;
- response["method"] = "alltracks";
- response["tracks"] = all;
-
- QJson::Serializer serializer;
- const QByteArray serialized = serializer.serialize( response );
- sendMsg(serialized);
- return;
- }
-
bool ok;
QVariantMap m = parser.parse(msg, &ok).toMap();
if(ok)

0 comments on commit 4e5265b

Please sign in to comment.