Ejemplo n.º 1
0
/** @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));
}
Ejemplo n.º 2
0
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() );
    }
}