Logo Search packages:      
Sourcecode: kcheckgmail version File versions

void GMailParser::parseQuota ( const QString &  data  )  [protected]

Quota information parser.

This parser extracts quota information like the amount of space used, available, the used percentage, etc.

Parameters:
data The data block

Definition at line 422 of file gmailparser.cpp.

Referenced by parse().

{     
      QStringList list = QStringList::split(",",data);
      if(list.size() == 4) {
            QStringList::Iterator iter = list.begin();
            unsigned int i = 0;
            while(iter != list.end()) {
                  QString val = *iter;
                  val.remove('"');
                  switch(i) {
                        case 0:
                              mQuota.used = val;
                              break;
                        case 1:
                              mQuota.total = val;
                              break;
                        case 2:
                              mQuota.percent = val;
                              break;
                        case 3:
                              mQuota.colour = val;
                              break;
                        default:
                              break;
                  }
                  iter++;
                  i++;
            }
      } else
            kdWarning() << k_funcinfo << "Wrong number of elements in qu: "
                  << list.size() << ", should be: 4." << endl;
}


Generated by  Doxygen 1.6.0   Back to index