~ubuntu-branches/debian/experimental/kopete/experimental

« back to all changes in this revision

Viewing changes to kopete/contactlist/contactlistmodel.cpp

  • Committer: Package Import Robot
  • Author(s): Maximiliano Curia
  • Date: 2015-02-24 11:32:57 UTC
  • mfrom: (1.1.41 vivid)
  • Revision ID: package-import@ubuntu.com-20150224113257-gnupg4v7lzz18ij0
Tags: 4:14.12.2-1
* New upstream release (14.12.2).
* Bump Standards-Version to 3.9.6, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
502
502
        return false;
503
503
}
504
504
 
 
505
QList<QVariant> ContactListModel::emoticonStringToList( const QString &msg ) const
 
506
{
 
507
        QList<QVariant> l;
 
508
        QList<KEmoticonsTheme::Token> tokenList = Kopete::Emoticons::tokenize( msg );
 
509
 
 
510
        foreach ( const KEmoticonsTheme::Token &token, tokenList )
 
511
        {
 
512
                if ( token.type == KEmoticonsTheme::Image )
 
513
                        l << QIcon(token.picPath);
 
514
                else if ( token.type == KEmoticonsTheme::Text )
 
515
                        l << token.text;
 
516
        }
 
517
 
 
518
        return l;
 
519
}
 
520
 
505
521
QVariant ContactListModel::metaContactData( const Kopete::MetaContact* mc, int role ) const
506
522
{
507
523
        switch ( role )
535
551
                return mc->status();
536
552
                break;
537
553
        case Kopete::Items::StatusMessageRole:
538
 
                return mc->statusMessage().message();
 
554
                return emoticonStringToList( mc->statusMessage().message() );
539
555
                break;
540
556
        case Kopete::Items::StatusTitleRole:
541
 
                return mc->statusMessage().title();
 
557
                return emoticonStringToList( mc->statusMessage().title() );
542
558
                break;
543
559
        case Kopete::Items::AccountIconsRole:
544
560
                {
667
683
                              QString(QUrl::toPercentEncoding( c->contactId() ) )
668
684
                            );
669
685
 
670
 
                QString name = Kopete::Emoticons::parseEmoticons(c->nickName());
 
686
                QString name = Kopete::Emoticons::parseEmoticons(c->displayName());
671
687
 
672
688
                QString message = c->statusMessage().message();
673
689