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

« back to all changes in this revision

Viewing changes to libkcddb/httplookup.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:
39
39
    Result
40
40
  HTTPLookup::sendQuery()
41
41
  {
42
 
    QString cmd = QString( "cddb query %1 %2" )
 
42
      QString cmd = QString::fromLatin1( "cddb query %1 %2" )
43
43
      .arg( trackOffsetListToId(), trackOffsetListToString() ) ;
44
44
 
45
45
    makeURL( cmd );
54
54
    category_  = match.first;
55
55
    discid_    = match.second;
56
56
 
57
 
    QString cmd = QString( "cddb read %1 %2" )
 
57
    QString cmd = QString::fromLatin1( "cddb read %1 %2" )
58
58
        .arg( category_, discid_ );
59
59
 
60
60
    makeURL( cmd );
66
66
    void
67
67
  HTTPLookup::initURL( const QString & hostName, uint port )
68
68
  {
69
 
    cgiURL_.setProtocol( "http" );
 
69
    cgiURL_.setProtocol( QLatin1String( "http" ) );
70
70
    cgiURL_.setHost( hostName );
71
71
    cgiURL_.setPort( port );
72
 
    cgiURL_.setPath( "/~cddb/cddb.cgi" );
 
72
    cgiURL_.setPath( QLatin1String( "/~cddb/cddb.cgi" ) );
73
73
 
74
74
    return;
75
75
  }
82
82
 
83
83
    cgiURL_.setQuery( QString::null );  //krazy:exclude=nullstrassign for old broken gcc
84
84
 
85
 
    QString hello = QString("%1 %2 %3 %4")
 
85
    QString hello = QString::fromLatin1("%1 %2 %3 %4")
86
86
        .arg(user_, localHostName_, clientName(), clientVersion());
87
87
 
88
 
    cgiURL_.addQueryItem( "cmd", cmd );
89
 
    cgiURL_.addQueryItem( "hello", hello );
90
 
    cgiURL_.addQueryItem( "proto", "6" );
 
88
    cgiURL_.addQueryItem( QLatin1String( "cmd" ), cmd );
 
89
    cgiURL_.addQueryItem( QLatin1String( "hello" ), hello );
 
90
    cgiURL_.addQueryItem( QLatin1String( "proto" ), QLatin1String( "6" ) );
91
91
  }
92
92
 
93
93
    void
94
94
  HTTPLookup::jobFinished()
95
95
  {
96
 
    QStringList lineList = QString::fromUtf8(data_, data_.size()).split( "\n", QString::SkipEmptyParts );
 
96
    QStringList lineList = QString::fromUtf8(data_, data_.size()).split( QLatin1String( "\n" ), QString::SkipEmptyParts );
97
97
    QStringList::ConstIterator it = lineList.constBegin();
98
98
 
99
99
    switch ( state_ )
121
121
              {
122
122
                QString line( *it );
123
123
 
124
 
                if ( '.' == line[ 0 ] )
 
124
                if ( QLatin1Char( '.' ) == line[ 0 ] )
125
125
                {
126
126
                  result_ = Success;
127
127
 
160
160
 
161
161
          if ( info.load( QString::fromUtf8(data_,data_.size()) ) )
162
162
          {
163
 
            info.set( "category", category_ );
164
 
            info.set( "discid", discid_ );
165
 
            info.set( "source", "freedb" );
 
163
            info.set( QLatin1String( "category" ), category_ );
 
164
            info.set( QLatin1String( "discid" ), discid_ );
 
165
            info.set( QLatin1String( "source" ), QLatin1String( "freedb" ) );
166
166
            cdInfoList_.append( info );
167
167
          }
168
168