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

List:       kde-commits
Subject:    branches/KDE/4.0/kdenetwork/knewsticker
From:       Frerich Raabe <raabe () kde ! org>
Date:       2008-02-17 21:28:27
Message-ID: 1203283707.851519.14623.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 776344 by raabe:

automatically merged revision 776340:
- This configuration widget exists from the first show() until the end of 
  the applet. Consequently, it got notified about all feeds loaded and kept
  adding them to the list widget in the configuration dialog. This bug was
  reported in BR157948.

  The primary fix is to not stay connected to the NewsFeedManager all the
  time but only while we're adding a feed. We do an aditional check for
  the URL which was loaded, just in case a feed update of some other
  URL finishes while we're retrieving the to-be-added feed.

 M  +11 -3     feedsettingswidget.cpp  
 M  +1 -0      feedsettingswidget.h  


--- branches/KDE/4.0/kdenetwork/knewsticker/feedsettingswidget.cpp #776343:776344
@@ -30,9 +30,6 @@
     connect( ui.removeButton, SIGNAL( clicked() ),
              this, SLOT( removeButtonClicked() ) );
 
-    connect( NewsFeedManager::self(), SIGNAL( feedLoaded( const QUrl & ) ),
-             this, SLOT( feedLoaded( const QUrl & ) ) );
-
     if ( ui.feedListWidget->count() > 0 ) {
         ui.feedListWidget->setCurrentRow( 0 );
         feedItemChanged();
@@ -80,6 +77,10 @@
                                           &ok );
 
      if ( ok && !url.isEmpty() ) {
+         m_addedFeedUrl = url;
+         connect( NewsFeedManager::self(), SIGNAL( feedLoaded( const QUrl & ) ),
+                  this, SLOT( feedLoaded( const QUrl & ) ) );
+
          NewsFeedManager::self()->updateFeed( url );
          m_downloadMessageBox = new QProgressDialog( i18n( "Please wait while the \
newsfeed is downloaded..." ),  i18n( "Cancel" ),
@@ -107,6 +108,13 @@
 
 void FeedSettingsWidget::feedLoaded( const QUrl &url )
 {
+    if ( url.toString() != m_addedFeedUrl ) {
+        return;
+    }
+
+    disconnect( NewsFeedManager::self(), SIGNAL( feedLoaded( const QUrl & ) ),
+                this, SLOT( feedLoaded( const QUrl & ) ) );
+
     delete m_downloadMessageBox;
     m_downloadMessageBox = 0;
 
--- branches/KDE/4.0/kdenetwork/knewsticker/feedsettingswidget.h #776343:776344
@@ -35,6 +35,7 @@
 private:
     Ui::FeedSettings ui;
     QProgressDialog *m_downloadMessageBox;
+    QString m_addedFeedUrl;
 };
 
 #endif // !defined(FEEDSETTINGSWIDGET_H)


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

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