/*!
    Constructs a QMailMessageModelBase with the parent \a parent.
*/
QMailMessageModelBase::QMailMessageModelBase(QObject* parent)
    : QAbstractItemModel(parent)
{
    connect(QMailStore::instance(), SIGNAL(messagesAdded(QMailMessageIdList)), this, SLOT(messagesAdded(QMailMessageIdList)));
    connect(QMailStore::instance(), SIGNAL(messagesRemoved(QMailMessageIdList)), this, SLOT(messagesRemoved(QMailMessageIdList)));
    connect(QMailStore::instance(), SIGNAL(messagesUpdated(QMailMessageIdList)), this, SLOT(messagesUpdated(QMailMessageIdList)));
}
示例#2
0
文件: board.cpp 项目: akru/Netland-NG
void Board::updateMessages(QMap<int, shared_ptr<BoardMessage> > messages)
{
  if (!_messages.isEmpty())
  {
    QList<int> messagesId = messages.keys();
    QList<int>::const_iterator it;
    for (it = messagesId.constBegin(); it != messagesId.constEnd(); ++it)
      _messages.insert(*it, messages[*it]);
  }
  else
    _messages = messages;
  rebuildMessagesTree();
  emit messagesUpdated();
}
示例#3
0
models::MessageModel::MessageModel(QObject *parent)
  : QObject (parent)
{
    CONNECT (QMailStore::instance(), SIGNAL(messageContentsModified(QMailMessageIdList)),
                             this, SLOT(on_messageContentsModified(QMailMessageIdList)));
    CONNECT (QMailStore::instance(), SIGNAL(messageDataUpdated(QMailMessageMetaDataList)),
                             this, SLOT(on_messageDataUpdated(QMailMessageMetaDataList)));
    CONNECT (QMailStore::instance(), SIGNAL(messagePropertyUpdated(QMailMessageIdList,QMailMessageKey::Properties,QMailMessageMetaData)),
                             this, SLOT(on_messagePropertyUpdated(QMailMessageIdList,QMailMessageKey::Properties,QMailMessageMetaData)));
    CONNECT (QMailStore::instance(), SIGNAL(messageStatusUpdated(QMailMessageIdList,quint64,bool)),
                             this, SLOT(on_messageStatusUpdated(QMailMessageIdList,quint64,bool)));
    CONNECT (QMailStore::instance(), SIGNAL(messagesUpdated(QMailMessageIdList)),
                             this, SLOT(on_messagesUpdated(QMailMessageIdList)));
    CONNECT (ServiceActionManager::instance(), SIGNAL(activityChanged(quint64,QMailServiceAction::Activity)),
                             this, SLOT(on_activityChanged(quint64,QMailServiceAction::Activity)));
}