Logo Search packages:      
Sourcecode: kcheckgmail version File versions

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

Lables parser.

This parser extracts the number of unread messages per label.

Parameters:
data The data block
Todo:
Store a QMap with the labels information

Definition at line 501 of file gmailparser.cpp.

Referenced by parse().

{
      static QRegExp rx(
            "\\[\"([^\"]+)\"" // label name
            ",([0-9]+)\\]"          // unread
            );

      if(!rx.isValid()) {
            kdWarning() << k_funcinfo << "Invalid RX!\n"
                  << rx.errorString() << endl;
      }
      int pos = 0;
      
      kdDebug() << k_funcinfo << endl;

      while((pos = rx.search(data, pos)) != -1) {
            kdDebug() << rx.cap(1) << " has " << rx.cap(2) << " unread messages" << endl;
            pos += rx.matchedLength();
      }
}


Generated by  Doxygen 1.6.0   Back to index