void TimelineWidget::addNewPosts( QList< Choqok::Post* >& postList)
{
    kDebug()<<d->currentAccount->alias()<<' '<<d->timelineName<<' '<<postList.count();
    QList<Post*>::const_iterator it, endIt = postList.constEnd();
    int unread = 0;
    for(it = postList.constBegin(); it!= endIt; ++it){
        if(d->posts.keys().contains((*it)->postId))
            continue;
        PostWidget *pw = d->currentAccount->microblog()->createPostWidget(d->currentAccount, *it, this);
        if(pw) {
            addPostWidgetToUi(pw);
            if( !pw->isRead() )
                ++unread;
        }
    }
    removeOldPosts();
    if(unread){
        d->unreadCount += unread;
        Choqok::NotifyManager::newPostArrived( i18np( "1 new post in %2(%3)",
                                                      "%1 new posts in %2(%3)",
                                                      unread, currentAccount()->alias(), d->timelineName ) );

        emit updateUnreadCount(unread);
        showMarkAllAsReadButton();
    }
}
Beispiel #2
0
void SysTrayIcon::setTimeLineUpdatesEnabled( bool isEnabled )
{
    if ( isEnabled ) {
        setToolTip( "choqok", i18n( "Choqok" ), QString() );
        setIconByName("choqok");
    } else {
        setToolTip( "choqok", i18n( "Choqok - Disabled" ), QString() );
        setIconByName("choqok_offline");
    }
    isOffline = !isEnabled;
    updateUnreadCount( 0 );
}
Beispiel #3
0
void SysTrayIcon::resetUnreadCount()
{
    updateUnreadCount(-unread);
}
Beispiel #4
0
void SysTrayIcon::slotRestoreIcon()
{
    setOverlayIconByName(QString());
    updateUnreadCount( 0 );
}