43 #include "imapparser.h"
45 #include <kimap/rfccodecs.h>
49 imapList::imapList (): parser_(0), noInferiors_ (false),
50 noSelect_ (false), marked_ (false), unmarked_ (false),
51 hasChildren_ (false), hasNoChildren_ (false)
55 imapList::imapList (
const imapList & lr):parser_(lr.parser_),
56 hierarchyDelimiter_ (lr.hierarchyDelimiter_),
58 noInferiors_ (lr.noInferiors_),
59 noSelect_ (lr.noSelect_), marked_ (lr.marked_), unmarked_ (lr.unmarked_),
60 hasChildren_ (lr.hasChildren_), hasNoChildren_ (lr.hasNoChildren_),
61 attributes_ (lr.attributes_)
65 imapList & imapList::operator = (
const imapList & lr)
72 hierarchyDelimiter_ = lr.hierarchyDelimiter_;
74 noInferiors_ = lr.noInferiors_;
75 noSelect_ = lr.noSelect_;
77 unmarked_ = lr.unmarked_;
78 hasChildren_ = lr.hasChildren_;
79 hasNoChildren_ = lr.hasNoChildren_;
80 attributes_ = lr.attributes_;
85 imapList::imapList (
const QString & inStr, imapParser &parser)
89 marked_ (false), unmarked_ (false), hasChildren_ (false),
90 hasNoChildren_ (false)
93 s.data = inStr.toLatin1();
100 parseAttributes( s );
105 hierarchyDelimiter_ = QString::fromLatin1 (parser_->parseOneWord(s));
106 if (hierarchyDelimiter_ ==
"NIL")
107 hierarchyDelimiter_.clear();
108 name_ = QString::fromUtf8 (KIMAP::decodeImapFolderName (parser_->parseLiteral (s)));
111 void imapList::parseAttributes(
parseString & str )
114 while ( !str.isEmpty () && str[0] !=
')' )
116 QString orig = QString::fromLatin1( parser_->parseOneWord(str) );
118 QString attribute = orig.toLower();
119 if ( attribute.contains (
"\\noinferiors"))
121 else if ( attribute.contains (
"\\noselect"))
123 else if ( attribute.contains (
"\\marked"))
125 else if ( attribute.contains (
"\\unmarked"))
127 else if ( attribute.contains (
"\\haschildren"))
129 else if ( attribute.contains (
"\\hasnochildren"))
130 hasNoChildren_ =
true;
132 kDebug(7116) <<
"imapList::imapList: bogus attribute" << attribute;