~ubuntu-branches/ubuntu/natty/kdemultimedia/natty-proposed

« back to all changes in this revision

Viewing changes to libkcddb/cddb.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Debian Qt/KDE Maintainers
  • Date: 2011-05-26 02:41:36 UTC
  • mfrom: (0.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 108.
  • Revision ID: james.westby@ubuntu.com-20110526024136-jjwsigfy402jhupm
Tags: upstream-4.6.3
ImportĀ upstreamĀ versionĀ 4.6.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
namespace KCDDB
33
33
{
34
34
  CDDB::CDDB()
35
 
    : user_( "libkcddb-user" ),
36
 
      localHostName_( "localHost" ),
 
35
    : user_( QLatin1String( "libkcddb-user" ) ),
 
36
      localHostName_( QLatin1String( "localHost" ) ),
37
37
      readOnly_( false )
38
38
  {
39
39
 
74
74
 
75
75
    id = ( ( id % 255 ) << 24 ) | ( l << 8 ) | numTracks;
76
76
 
77
 
    return QString::number( id, 16 ).rightJustified( 8, '0' );
 
77
    return QString::number( id, 16 ).rightJustified( 8, QLatin1Char( '0' ) );
78
78
  }
79
79
 
80
80
    QString
85
85
 
86
86
    // Disc start.
87
87
    ret.append( QString::number( numTracks ) );
88
 
    ret.append( " " );
 
88
    ret.append( QLatin1String( " " ) );
89
89
 
90
90
    for ( uint i = 0; i < numTracks; i++ )
91
91
    {
92
92
      ret.append( QString::number( trackOffsetList_[ i ] ) );
93
 
      ret.append( " " );
 
93
      ret.append( QLatin1String( " " ) );
94
94
    }
95
95
 
96
96
    unsigned int discLengthInSec = ( trackOffsetList_[ numTracks ] ) / 75;
103
103
    uint
104
104
  CDDB::statusCode( const QString & line )
105
105
  {
106
 
    QStringList tokenList = line.split(' ', QString::SkipEmptyParts );
 
106
    QStringList tokenList = line.split(QLatin1Char( ' ' ), QString::SkipEmptyParts );
107
107
 
108
108
    uint serverStatus = tokenList[ 0 ].toUInt();
109
109
 
116
116
    Categories c;
117
117
    QStringList categories = c.cddbList();
118
118
    // Also load user-created entries
119
 
    categories << "user";
 
119
    categories << QLatin1String( "user" );
120
120
 
121
121
    CDInfoList infoList;
122
122
    QStringList cddbCacheDirs = config.cacheLocations();
126
126
    {
127
127
      foreach(const QString &category, categories)
128
128
      {
129
 
        QFile f( *cddbCacheDir + '/' + category + '/' + trackOffsetListToId(offsetList) );
 
129
        QFile f( *cddbCacheDir + QLatin1Char( '/' ) + category + QLatin1Char( '/' ) + trackOffsetListToId(offsetList) );
130
130
        if ( f.exists() && f.open(QIODevice::ReadOnly) )
131
131
        {
132
132
            QTextStream ts(&f);
135
135
            f.close();
136
136
            CDInfo info;
137
137
            info.load(cddbData);
138
 
            if (category != "user")
 
138
            if (category != QLatin1String( "user" ))
139
139
            {
140
140
              info.set(Category,category);
141
 
              info.set("source", "freedb");
 
141
              info.set(QLatin1String( "source" ), QLatin1String( "freedb" ));
142
142
            }
143
143
            else
144
144
            {
145
 
              info.set("source", "user");
 
145
              info.set(QLatin1String( "source" ), QLatin1String( "user" ));
146
146
            }
147
147
 
148
148
            infoList.append( info );