Logo Search packages:      
Sourcecode: kcheckgmail version File versions

void GMailParser::parseVersion ( const QString &  _data  )  [protected]

Gmail version information parser.

This parser extracts some information from the version string.

Parameters:
_data The data block

Definition at line 352 of file gmailparser.cpp.

Referenced by parse().

{
      QString data = _data;
      data.remove('"');
      
      kdDebug() << k_funcinfo << "Version string: " << data << endl;
      
      QStringList list = QStringList::split(",",data);
      if(list.size() != 5)
            kdWarning() << k_funcinfo << "Wrong number of elements: "
                        << list.size() << ", should be: 5." << endl;
      
      QStringList::Iterator iter = list.begin();
      unsigned int i = 0;
      while(iter != list.end()) {
            QString str = *iter;
            switch(i) {
                  case 0:
                        mVersion.unknown1 = str;
                        break;
                  case 1:
                        mVersion.language = str;
                        break;
                  case 2:
                        mVersion.unknown2 = str.toUInt();
                        break;
                  case 3:
                        mVersion.unknown3 = str.toUInt();
                        break;
                  case 4:
                        mVersion.version = str;
                        break;
                  default:
                        kdWarning() << k_funcinfo << "Unknown version token: " << str << "(" << i <<")" << endl;
                        break;
            }
            iter++;
            i++;
      }
      kdDebug() << "GMail version " << mVersion.version << endl;
      
      bool ok = false;
      
      for( i = 0; i < gGMailVersion.size() ; i++ ) {
            if( gGMailVersion[i] == mVersion.version )
                  ok = true;
      }
      
#ifdef DETECT_GLANGUAGE
      if(gGMailLanguageCode.contains(mVersion.language))
            kdDebug() << "GMail language: " << gGMailLanguageCode[mVersion.language] << endl;
      else
            kdWarning() << k_funcinfo << "Unknown language code: " << mVersion.language << endl;
#endif
      
      if(!ok)
      {
            kdWarning() << k_funcinfo << "GMail version " << mVersion.version << " is not supported, check for updates!" << endl;
            emit versionMismatch();
      }
}


Generated by  Doxygen 1.6.0   Back to index