Bug 94758 - favicons on page viewer don't update
Summary: favicons on page viewer don't update
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: cvs
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-09 19:27 UTC by George Staikos
Modified: 2004-12-12 18:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Staikos 2004-12-09 19:27:43 UTC
The favicons on the page viewer tabs don't update when changing sites.
Comment 1 George Staikos 2004-12-12 18:01:03 UTC
CVS commit by staikos: 

update favicons for the page viewer properly
BUG: 94758


  M +11 -4     akregator_view.cpp   1.191
  M +2 -0      akregator_view.h   1.76
  M +9 -0      pageviewer.cpp   1.20
  M +3 -0      pageviewer.h   1.14


--- kdepim/akregator/src/akregator_view.cpp  #1.190:1.191
@@ -268,4 +268,6 @@ void aKregatorView::slotOpenTab(const KU
     m_part->manager()->addPart(page);
     
+    connect( page, SIGNAL(setTabIcon(const QPixmap&)),
+            this, SLOT(setTabIcon(const QPixmap&)));
     connect( page, SIGNAL(setWindowCaption (const QString &)),
             this, SLOT(slotTabCaption (const QString &)) );
@@ -284,11 +286,16 @@ void aKregatorView::slotOpenTab(const KU
     if (m_tabs->count() > 1 && m_tabs->currentPageIndex() != 0)
         m_tabsClose->setEnabled(true);
-    QString favicon = FeedIconManager::self()->iconLocation(url);
-    if (!favicon.isEmpty()) {
-        m_tabs->setTabIconSet(page->widget(), QPixmap(KGlobal::dirs()->findResource("cache", favicon+".png")));
-    }
     page->openURL(url);
 }
 
+
+void aKregatorView::setTabIcon(const QPixmap& icon)
+{
+    const PageViewer *s = dynamic_cast<const PageViewer*>(sender());
+    if (s) {
+        m_tabs->setTabIconSet(const_cast<PageViewer*>(s)->widget(), icon);
+    }
+}
+
 void aKregatorView::connectFrame(Frame *f)
 {

--- kdepim/akregator/src/akregator_view.h  #1.75:1.76
@@ -281,4 +281,6 @@ namespace Akregator
             QString getTitleNodeText(const QDomDocument &doc);
 
+            void setTabIcon(const QPixmap&);
+
             /**
              * Write child items of item to node using QDom document document.

--- kdepim/akregator/src/pageviewer.cpp  #1.19:1.20
@@ -7,4 +7,5 @@
 
 #include "akregator_run.h" 
+#include "feediconmanager.h"
 #include "pageviewer.h"
 #include "viewer.h"
@@ -204,4 +205,11 @@ bool PageViewer::openURL(const KURL &url
     m_forwardAction->setEnabled( m_current != m_history.fromLast() );
   
+    QString favicon = FeedIconManager::self()->iconLocation(url);
+    if (!favicon.isEmpty()) {
+        emit setTabIcon(QPixmap(KGlobal::dirs()->findResource("cache", favicon+".png")));
+    } else {
+        emit setTabIcon(QPixmap());
+    }
+
     return retval;
 }
@@ -389,2 +397,3 @@ void PageViewer::slotSelectionChanged( )
 
 #include "pageviewer.moc"
+// vim: ts=4 sw=4 et

--- kdepim/akregator/src/pageviewer.h  #1.13:1.14
@@ -71,4 +71,7 @@ namespace Akregator
             void slotGlobalBookmarkArticle();
             
+        signals:
+            void setTabIcon(const QPixmap&);
+
         private:
             QValueList<PageViewerHistoryEntry> m_history;