Browse Source

Adjusted to use new TQStringVariantMap type.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/3/head
Michele Calgaro 1 month ago
parent
commit
c41e90dac0
Signed by: Michele Calgaro <michele.calgaro@yahoo.it> GPG Key ID: 2A75B7CA8ADED5CF

+ 7
- 7
amarok/src/mediadevice/daap/daapreader/reader.cpp View File

@@ -213,7 +213,7 @@ Reader::loginFinished( int /* id */, bool error )
213 213
         http->deleteLater();
214 214
         return;
215 215
     }
216
-    Map loginResults = parse( http->results() , 0 ,true );
216
+    TQStringVariantMap loginResults = parse( http->results() , 0 ,true );
217 217
 
218 218
     m_sessionId = loginResults["mlog"].asList()[0].asMap()["mlid"].asList()[0].asInt();
219 219
     m_loginString = "session-id=" + TQString::number( m_sessionId );
@@ -234,7 +234,7 @@ Reader::updateFinished( int /*id*/, bool error )
234 234
         return;
235 235
     }
236 236
 
237
-    Map updateResults = parse( http->results(), 0, true );
237
+    TQStringVariantMap updateResults = parse( http->results(), 0, true );
238 238
     m_loginString = m_loginString + "&revision-number="  +
239 239
             TQString::number( updateResults["mupd"].asList()[0].asMap()["musr"].asList()[0].asInt() );
240 240
 
@@ -254,7 +254,7 @@ Reader::databaseIdFinished( int /*id*/, bool error )
254 254
         return;
255 255
     }
256 256
 
257
-    Map dbIdResults = parse( http->results(), 0, true );
257
+    TQStringVariantMap dbIdResults = parse( http->results(), 0, true );
258 258
     m_databaseId = TQString::number( dbIdResults["avdb"].asList()[0].asMap()["mlcl"].asList()[0].asMap()["mlit"].asList()[0].asMap()["miid"].asList()[0].asInt() );
259 259
     connect( http, TQT_SIGNAL( requestFinished( int, bool ) ), this, TQT_SLOT( songListFinished( int, bool ) ) );
260 260
     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 )
273 273
         return;
274 274
     }
275 275
 
276
-    Map songResults = parse( http->results(), 0, true );
276
+    TQStringVariantMap songResults = parse( http->results(), 0, true );
277 277
 
278 278
     SongList result;
279 279
     TQValueList<TQVariant> songList;
@@ -319,7 +319,7 @@ Reader::getTagAndLength( TQDataStream &raw, char tag[5] )
319 319
    return tagLength;
320 320
 }
321 321
 
322
-Map
322
+TQStringVariantMap
323 323
 Reader::parse( TQDataStream &raw, uint containerLength, bool first )
324 324
 {
325 325
 //DEBUG_BLOCK
@@ -327,7 +327,7 @@ Reader::parse( TQDataStream &raw, uint containerLength, bool first )
327 327
 0-3     Content code    OSType (unsigned long), description of the contents of this chunk
328 328
 4-7     Length  Length of the contents of this chunk (not the whole chunk)
329 329
 8-      Data    The data contained within the chunk */
330
-    Map childMap;
330
+    TQStringVariantMap childMap;
331 331
     uint index = 0;
332 332
     while( (first ? !raw.atEnd() : ( index < containerLength ) ) )
333 333
     {
@@ -407,7 +407,7 @@ Reader::parse( TQDataStream &raw, uint containerLength, bool first )
407 407
 }
408 408
 
409 409
 void
410
-Reader::addElement( Map &parentMap, char* tag, TQVariant element )
410
+Reader::addElement( TQStringVariantMap &parentMap, char* tag, TQVariant element )
411 411
 {
412 412
     if( !parentMap.contains( tag ) )
413 413
         parentMap[tag] = TQVariant( TQValueList<TQVariant>() );

+ 2
- 4
amarok/src/mediadevice/daap/daapreader/reader.h View File

@@ -27,8 +27,6 @@ class TQHttpResponseHeader;
27 27
 
28 28
 namespace Daap
29 29
 {
30
-    typedef TQMap<TQString, TQVariant>    Map;
31
-
32 30
     typedef TQPtrList< MetaBundle >     TrackList;
33 31
     typedef TQMap< TQString, TrackList > AlbumList;
34 32
     typedef TQMap< TQString, AlbumList > SongList;
@@ -91,8 +89,8 @@ namespace Daap
91 89
             * @param raw stream of DAAP reply
92 90
             * @param containerLength length of the container (or entire result) being analyzed
93 91
             */
94
-            static Map parse( TQDataStream &raw, uint containerLength, bool first = false );
95
-            static void addElement( Map &parentMap, char* tag, TQVariant element ); //! supporter function for parse
92
+            static TQStringVariantMap parse( TQDataStream &raw, uint containerLength, bool first = false );
93
+            static void addElement( TQStringVariantMap &parentMap, char* tag, TQVariant element ); //! supporter function for parse
96 94
             static TQ_UINT32 getTagAndLength( TQDataStream &raw, char tag[5] );
97 95
 
98 96
             static TQMap<TQString, Code> s_codes;

Loading…
Cancel
Save