Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
RJ committed Feb 9, 2010
1 parent 9432774 commit 4e5265b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
14 changes: 14 additions & 0 deletions src/remotecollectionconnection.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,4 +4,18 @@
void RemoteCollectionConnection::setup() void RemoteCollectionConnection::setup()
{ {
m_rc = new RemoteCollection(m_servent, this); 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);
} }
16 changes: 0 additions & 16 deletions src/remotecollectionconnection.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,22 +32,6 @@ class RemoteCollectionConnection : public Connection


void handleMsg(QByteArray msg) 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; bool ok;
QVariantMap m = parser.parse(msg, &ok).toMap(); QVariantMap m = parser.parse(msg, &ok).toMap();
if(ok) if(ok)
Expand Down

0 comments on commit 4e5265b

Please sign in to comment.