void dAmnPrivClass::apply(QString commands) { QTextStream parser (&commands); while(!parser.atEnd()) { QString command; parser >> command; QString priv; int value; switch(command[0].toLatin1()) { case '+': priv = command.mid(1); value = 1; break; case '-': priv = command.mid(1); value = 0; break; default: QPair<QString, QString> pair = dAmnPacketParser::splitPair(command); priv = pair.first; value = pair.second.toInt(); } switch(getPriv(priv)) { case join: this->_joinpriv = value; break; case topic: this->_topicpriv = value; break; case title: this->_titlepriv = value; break; case kick: this->_kickpriv = value; break; case msg: this->_msgpriv = value; break; case shownotice:this->_shownoticepriv = value; break; case admin: this->_adminpriv = value; break; case images: this->_imagespriv = value; break; case smilies: this->_smiliespriv = value; break; case emoticons: this->_emoticonspriv = value; break; case thumbs: this->_thumbspriv = value; break; case avatars: this->_avatarspriv = value; break; case websites: this->_websitespriv = value; break; case objects: this->_objectspriv = value; break; case order: this->_order = (uint) value; break; case unknown: default: qt_noop(); } } }
bool ProjectInfoDialog::eventFilter(QObject * obj, QEvent * e) { switch (e->type()) { case QEvent::Close: { bool isHide = saveNotification(); if (!isHide) { e->ignore(); return true; } break; } default: qt_noop(); } return QObject::eventFilter(obj, e); }
/* Returns the qstring which will be the text in the index feedback. */ QString HbIndexFeedbackPrivate::displayText(const QVariant &data) const { QString retVal; switch (mIndexFeedbackPolicy) { case HbIndexFeedback::IndexFeedbackSingleCharacter: retVal = data.toString().left(1); break; case HbIndexFeedback::IndexFeedbackThreeCharacter: retVal = data.toString().left(3); break; case HbIndexFeedback::IndexFeedbackString: retVal = data.toString(); break; default: qt_noop(); break; } return retVal; }