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(); } }
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 ); }
void SysTrayIcon::resetUnreadCount() { updateUnreadCount(-unread); }
void SysTrayIcon::slotRestoreIcon() { setOverlayIconByName(QString()); updateUnreadCount( 0 ); }