[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.2/kdepim/akregator/src
From:       Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date:       2009-04-17 16:51:46
Message-ID: 1239987106.263507.5519.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 955446 by osterfeld:

backport 

r952086 | osterfeld | 2009-04-10 23:21:18 +0200 (Fri, 10 Apr 2009) | 4 lines

re-enable notifications
The standard popup is too small for notifying many items though
BUG:166216
BUG:170314



 M  +4 -4      akregator.notifyrc  
 M  +5 -1      feed.cpp  
 M  +0 -22     mainwidget.cpp  
 M  +0 -3      mainwidget.h  
 M  +9 -11     notificationmanager.cpp  


--- branches/KDE/4.2/kdepim/akregator/src/akregator.notifyrc #955445:955446
@@ -5,7 +5,7 @@
 Comment[pa]=ਅਕਰੀਗੇਟਰ
 Comment[x-test]=xxAkregatorxx
 
-[Event/feed_added]
+[Event/FeedAdded]
 Name=Feed added
 Name[af]=Stroom bygevoeg
 Name[ca]=Font afegida
@@ -101,9 +101,9 @@
 Comment[x-test]=xxA new feed was remotely added to Akregatorxx
 Comment[zh_CN]=远程添 新种子进了 Akregator
 Comment[zh_TW]=已從 端新增 Feed 到 Akregator
-Action=Logfile
+Action=Popup
 
-[Event/new_articles]
+[Event/NewArticles]
 Name=New Articles
 Name[af]=Nuwe Artikels
 Name[br]=Pennadoù nevez
@@ -202,5 +202,5 @@
 Comment[x-test]=xxNew articles were fetchedxx
 Comment[zh_CN]=获取了新文 
 Comment[zh_TW]=有新文 進來
-Action=Logfile
+Action=Popup
 
--- branches/KDE/4.2/kdepim/akregator/src/feed.cpp #955445:955446
@@ -31,6 +31,7 @@
 #include "feedstorage.h"
 #include "fetchqueue.h"
 #include "folder.h"
+#include "notificationmanager.h"
 #include "storage.h"
 #include "treenodevisitor.h"
 #include "types.h"
@@ -462,6 +463,7 @@
 {
     d->setTotalCountDirty();
     bool changed = false;
+    const bool notify = useNotification() || Settings::useNotifications();
 
     QList<ItemPtr> items = feed->items();
     QList<ItemPtr>::ConstIterator it = items.constBegin();
@@ -486,7 +488,8 @@
                 mya.setStatus(New);
             else
                 mya.setStatus(Read);
-
+            if ( notify )
+                NotificationManager::self()->slotNotifyArticle( mya );
             changed = true;
         }
         else // article is in list
@@ -513,6 +516,7 @@
         }
     }
 
+
     QList<Article>::ConstIterator dit = deletedArticles.constBegin();
     QList<Article>::ConstIterator dtmp;
     QList<Article>::ConstIterator den = deletedArticles.constEnd();
--- branches/KDE/4.2/kdepim/akregator/src/mainwidget.cpp #955445:955446
@@ -125,8 +125,6 @@
     m_horizontalSplitter->setOpaqueResize(true);
     lt->addWidget(m_horizontalSplitter);
 
-    connect(Kernel::self()->fetchQueue(), SIGNAL(fetched(Akregator::Feed*)),
-             this, SLOT(slotFeedFetched(Akregator::Feed*)));
     connect(Kernel::self()->fetchQueue(), SIGNAL(signalStarted()),
              this, SLOT(slotFetchingStarted()));
     connect(Kernel::self()->fetchQueue(), SIGNAL(signalStopped()),
@@ -820,26 +818,6 @@
     m_mainFrame->slotSetStatusText(QString());
 }
 
-void Akregator::MainWidget::slotFeedFetched(Feed *feed)
-{
-    // iterate through the articles (once again) to do notifications properly
-    if (feed->articles().count() > 0)
-    {
-        QList<Article> articles = feed->articles();
-        QList<Article>::ConstIterator it;
-        QList<Article>::ConstIterator end = articles.constEnd();
-        for (it = articles.constBegin(); it != end; ++it)
-        {
-            if ((*it).status()==Akregator::New && ((*it).feed()->useNotification() \
                || Settings::useNotifications()))
-            {
-                NotificationManager::self()->slotNotifyArticle(*it);
-            }
-        }
-    }
-}
-
-
-
 void Akregator::MainWidget::slotArticleSelected(const Akregator::Article& article)
 {
     if (m_viewMode == CombinedView)
--- branches/KDE/4.2/kdepim/akregator/src/mainwidget.h #955445:955446
@@ -156,9 +156,6 @@
         /** displays a URL in the status bar when the user moves the mouse over a \
link */  void slotMouseOverInfo(const KFileItem& kifi);
 
-        /** Feed has been fetched, populate article view if needed and update \
                counters. */
-        void slotFeedFetched(Akregator::Feed *);
-
         /** adds a new feed to the feed tree */
         void slotFeedAdd();
         /** adds a feed group to the feed tree */
--- branches/KDE/4.2/kdepim/akregator/src/notificationmanager.cpp #955445:955446
@@ -76,7 +76,7 @@
     if (feeds.count() == 1)
     {
         //KNotifyClient::Instance inst(m_instance);
-        KNotification::event("feed_added", i18n("Feed added:\n %1", feeds[0]), \
QPixmap() ,m_widget); +        KNotification::event("FeedAdded", i18n("Feed added:\n \
%1", feeds[0]), QPixmap() ,m_widget, KNotification::CloseOnTimeout, m_instance);  }
     else if (feeds.count() > 1)
     {
@@ -84,7 +84,7 @@
         for (QStringList::ConstIterator it = feeds.begin(); it != feeds.end(); ++it)
             message += *it + '\n';
         //KNotifyClient::Instance inst(m_instance);
-        KNotification::event("feed_added", i18n("Feeds added:\n %1", message), \
QPixmap() ,m_widget); +        KNotification::event("FeedAdded", i18n("Feeds added:\n \
%1", message), QPixmap() ,m_widget, KNotification::CloseOnTimeout, m_instance);  }
 }
 
@@ -92,20 +92,18 @@
 {
     QString message = "<html><body>";
     QString feedTitle;
-    QList<Article>::ConstIterator it = m_articles.constBegin();
-    QList<Article>::ConstIterator en = m_articles.constEnd();
-    for (; it != en; ++it)
+
+    Q_FOREACH( const Article& i, m_articles )
     {
-        if (feedTitle != (*it).feed()->title())
+        if (feedTitle != i.feed()->title())
         {
-            feedTitle = (*it).feed()->title();
+            feedTitle = i.feed()->title();
             message += QString("<p><b>%1:</b></p>").arg(feedTitle);
         }
-        message += (*it).title() + "<br>";
+        message += i.title() + "<br>";
     }
     message += "</body></html>";
-    //KNotifyClient::Instance inst(m_instance);
-    KNotification::event("new_articles", message,QPixmap() ,m_widget);
+    KNotification::event("NewArticles", message, QPixmap() ,m_widget, \
KNotification::CloseOnTimeout, m_instance);  
     m_articles.clear();
     m_running = false;
@@ -125,7 +123,7 @@
         m_addedInLastInterval = false;
         QTimer::singleShot(m_checkInterval, this, SLOT(slotIntervalCheck()));
     }
-    
+
 }
 
 NotificationManager* NotificationManager::m_self;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic