25 #include "actionmanager.h"
29 #include <tqpopupmenu.h>
30 #include <tdeaction.h>
32 #include <kiconloader.h>
37 FeedItem::FeedItem(FolderItem* parent, Feed* node) : TreeNodeItem(parent, node)
42 FeedItem::FeedItem(TDEListView* parent, Feed* node) : TreeNodeItem(parent, node)
47 FeedItem::FeedItem(TDEListView* parent, TreeNodeItem* after, Feed* node) : TreeNodeItem(parent, after, node)
53 FeedItem::FeedItem(FolderItem* parent, TreeNodeItem* after, Feed* node) : TreeNodeItem(parent, after, node)
62 Feed* FeedItem::node()
64 return static_cast<Feed*
> (m_node);
67 void FeedItem::nodeChanged()
69 if ( node()->fetchErrorOccurred() )
70 setPixmap(0, errorPixmap());
73 if (!node()->favicon().isNull())
74 setPixmap(0, node()->favicon());
77 setPixmap( 0, defaultPixmap() );
78 node()->loadFavicon();
82 TreeNodeItem::nodeChanged();
85 TQPixmap FeedItem::errorPixmap()
87 return TDEGlobal::iconLoader()->loadIcon(
"error", TDEIcon::Small);
90 TQPixmap FeedItem::defaultPixmap()
92 return TDEGlobal::iconLoader()->loadIcon(
"text-plain", TDEIcon::Small);
95 void FeedItem::initialize(Feed* node)
100 setText(0, node->title());
101 if (!node->favicon().isNull())
102 setPixmap( 0, node->favicon() );
105 setPixmap( 0, defaultPixmap() );
111 void FeedItem::showContextMenu(
const TQPoint& p)
113 TQWidget* w = ActionManager::getInstance()->container(
"feeds_popup");
115 static_cast<TQPopupMenu *
>(w)->exec(p);