Logo Search packages:      
Sourcecode: mailody version File versions  Download package

void Mailody::ImapManager::getMailBox ( const QString &  box,
bool  sync = false 
)

This will select the mailbox and tries to fetch only whats needed.

Parameters:
box the mailbox
sync if true, do not use the cache, but refetch.

Definition at line 283 of file imapmanager.cpp.

References allUidsKnown(), Mailody::DB::deleteMessages(), Mailody::DB::getCurrentMessages(), Mailody::Imaplib::getMailBox(), mailBox(), messageCount(), and unseenCount().

{
    // kdDebug() << k_funcinfo << box << sync << endl;
    if (sync)
    {
        m_db->deleteMessages( box );
        emit messageCount( box, 0);
        emit unseenCount( box, 0);
        emit allUidsKnown( box ); // clear the view
        m_imap->getMailBox( box );
    }
    else
    {
        QStringList values;
        m_db->getCurrentMessages( box, values);
        // kdDebug() << "box has " << (values.count()/4)
        //        << " messages in cache " << values <<  endl;
        if (values.count() == 0)
            m_imap->getMailBox( box );
        else
        {
            emit mailBox( box, values );

            //when using the cache, update the status list.
            // updateStatus(box);
        }
    }
}


Generated by  Doxygen 1.6.0   Back to index