|
|
|
@ -213,7 +213,7 @@ Reader::loginFinished( int /* id */, bool error )
|
|
|
|
|
http->deleteLater();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Map loginResults = parse( http->results() , 0 ,true );
|
|
|
|
|
TQStringVariantMap loginResults = parse( http->results() , 0 ,true );
|
|
|
|
|
|
|
|
|
|
m_sessionId = loginResults["mlog"].asList()[0].asMap()["mlid"].asList()[0].asInt();
|
|
|
|
|
m_loginString = "session-id=" + TQString::number( m_sessionId );
|
|
|
|
@ -234,7 +234,7 @@ Reader::updateFinished( int /*id*/, bool error )
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map updateResults = parse( http->results(), 0, true );
|
|
|
|
|
TQStringVariantMap updateResults = parse( http->results(), 0, true );
|
|
|
|
|
m_loginString = m_loginString + "&revision-number=" +
|
|
|
|
|
TQString::number( updateResults["mupd"].asList()[0].asMap()["musr"].asList()[0].asInt() );
|
|
|
|
|
|
|
|
|
@ -254,7 +254,7 @@ Reader::databaseIdFinished( int /*id*/, bool error )
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map dbIdResults = parse( http->results(), 0, true );
|
|
|
|
|
TQStringVariantMap dbIdResults = parse( http->results(), 0, true );
|
|
|
|
|
m_databaseId = TQString::number( dbIdResults["avdb"].asList()[0].asMap()["mlcl"].asList()[0].asMap()["mlit"].asList()[0].asMap()["miid"].asList()[0].asInt() );
|
|
|
|
|
connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( songListFinished( int, bool ) ) );
|
|
|
|
|
http->getDaap( TQString("/databases/%1/items?type=music&meta=dmap.itemid,dmap.itemname,daap.songformat,daap.songartist,daap.songalbum,daap.songtime,daap.songtracknumber,daap.songcomment,daap.songyear,daap.songgenre&%2")
|
|
|
|
@ -273,7 +273,7 @@ Reader::songListFinished( int /*id*/, bool error )
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map songResults = parse( http->results(), 0, true );
|
|
|
|
|
TQStringVariantMap songResults = parse( http->results(), 0, true );
|
|
|
|
|
|
|
|
|
|
SongList result;
|
|
|
|
|
TQValueList<TQVariant> songList;
|
|
|
|
@ -319,7 +319,7 @@ Reader::getTagAndLength( TQDataStream &raw, char tag[5] )
|
|
|
|
|
return tagLength;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map
|
|
|
|
|
TQStringVariantMap
|
|
|
|
|
Reader::parse( TQDataStream &raw, uint containerLength, bool first )
|
|
|
|
|
{
|
|
|
|
|
//DEBUG_BLOCK
|
|
|
|
@ -327,7 +327,7 @@ Reader::parse( TQDataStream &raw, uint containerLength, bool first )
|
|
|
|
|
0-3 Content code OSType (unsigned long), description of the contents of this chunk
|
|
|
|
|
4-7 Length Length of the contents of this chunk (not the whole chunk)
|
|
|
|
|
8- Data The data contained within the chunk */
|
|
|
|
|
Map childMap;
|
|
|
|
|
TQStringVariantMap childMap;
|
|
|
|
|
uint index = 0;
|
|
|
|
|
while( (first ? !raw.atEnd() : ( index < containerLength ) ) )
|
|
|
|
|
{
|
|
|
|
@ -407,7 +407,7 @@ Reader::parse( TQDataStream &raw, uint containerLength, bool first )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
Reader::addElement( Map &parentMap, char* tag, TQVariant element )
|
|
|
|
|
Reader::addElement( TQStringVariantMap &parentMap, char* tag, TQVariant element )
|
|
|
|
|
{
|
|
|
|
|
if( !parentMap.contains( tag ) )
|
|
|
|
|
parentMap[tag] = TQVariant( TQValueList<TQVariant>() );
|
|
|
|
|