GaduRosterService::GaduRosterService(GaduListHelper *gaduListHelper, const QVector<Contact> &contacts, Protocol *protocol) : RosterService{contacts, protocol}, m_stateMachine{new GaduRosterStateMachine{this, protocol}}, m_gaduListHelper{gaduListHelper} { connect(this, SIGNAL(contactAdded(Contact)), this, SLOT(rosterChanged())); connect(this, SIGNAL(contactRemoved(Contact)), this, SLOT(rosterChanged())); connect(this, SIGNAL(contactUpdatedLocally(Contact)), this, SLOT(rosterChanged())); connect(m_stateMachine, SIGNAL(performGet()), SLOT(importContactList())); connect(m_stateMachine, SIGNAL(performPut()), SLOT(exportContactList())); }
void FeedHandler::performOperation(FeedToken token, FeedOperation::UP op) { if (considerWriteOperationForRejection(token, *op)) { return; } switch(op->getType()) { case FeedOperation::PUT: performPut(std::move(token), static_cast<PutOperation &>(*op)); return; case FeedOperation::REMOVE: performRemove(std::move(token), static_cast<RemoveOperation &>(*op)); return; case FeedOperation::UPDATE_42: case FeedOperation::UPDATE: performUpdate(std::move(token), static_cast<UpdateOperation &>(*op)); return; case FeedOperation::DELETE_BUCKET: performDeleteBucket(std::move(token), static_cast<DeleteBucketOperation &>(*op)); return; case FeedOperation::SPLIT_BUCKET: performSplit(std::move(token), static_cast<SplitBucketOperation &>(*op)); return; case FeedOperation::JOIN_BUCKETS: performJoin(std::move(token), static_cast<JoinBucketsOperation &>(*op)); return; case FeedOperation::WIPE_HISTORY: performGarbageCollect(std::move(token)); return; case FeedOperation::CREATE_BUCKET: performCreateBucket(std::move(token), static_cast<CreateBucketOperation &>(*op)); return; default: assert(!"Illegal operation type"); } }