Beispiel #1
0
void PersonsListJob::processFetchedPersonList( Attica::BaseJob* job )
{
    Attica::ListJob<Attica::Person> *personsJob = static_cast<Attica::ListJob<Attica::Person> *>( job );
    if( personsJob->metadata().error() == Attica::Metadata::NoError )
    {
        foreach( const Attica::Person & person, personsJob->itemList() )
        {
            PersonItem* newPerson = new PersonItem( person.id(), person.firstName(), person.lastName(), this );
            d->personsList.append( newPerson );
        }

        emitSucceeded();
    }
Beispiel #2
0
void CommentListJob::processFetchedCommentList(Attica::BaseJob* job)
{
    QList<CommentItem*> list;

    Attica::ListJob<Attica::Comment> *commentsJob = static_cast<Attica::ListJob<Attica::Comment> *>( job );
    if( commentsJob->metadata().error() == Attica::Metadata::NoError ) {
        foreach(const Attica::Comment& comment, commentsJob->itemList()) {
            CommentItem *newComment = new CommentItem(comment.id(), comment.subject(), comment.text(),
                                                      comment.user(), comment.date(), comment.score(), this);
            list.append(newComment);
            if (comment.childCount()) {
                addChildren(newComment, comment);
            }
        }

        emit commentListFetchFinished(list);
    } else {