/** @short Change mailbox to the one specified by its name */ void MsgListModel::setMailbox(const QString &mailboxName) { Model *model = dynamic_cast<Model*>(sourceModel()); Q_ASSERT(model); TreeItemMailbox *mailboxPtr = model->findMailboxByName(mailboxName); if (mailboxPtr) setMailbox(mailboxPtr->toIndex(model)); }
void Search::readSettings(QSettings* config) { setMailbox( config->value("mailbox", "inbox").toString() ); setMailFrom( config->value("from").toString().trimmed() ); setMailTo( config->value("to").toString().trimmed() ); setMailSubject( config->value("subject").toString().trimmed() ); setMailBody( config->value("body").toString().trimmed() ); setStatus( config->value("status", Search::Any).toInt() ); setName( config->value("name").toString().trimmed() ); QString strDate = config->value("dateafter").toString(); if (!strDate.isEmpty()) { QMailTimeStamp timeStamp(strDate); setAfterDate( timeStamp.toLocalTime().date() ); } strDate = config->value("datebefore").toString(); if (!strDate.isEmpty()) { QMailTimeStamp timeStamp(strDate); setBeforeDate( timeStamp.toLocalTime().date() ); } }