qBittorrent
anonymous_namespace{feedlistwidget.cpp} Namespace Reference

Classes

class  FeedListItem
 

Enumerations

enum  { StickyItemTagRole = Qt::UserRole + 1 }
 

Functions

QIcon loadIcon (const QString &path, const QString &fallbackId)
 
QIcon rssFeedIcon (const RSS::Feed *feed)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
StickyItemTagRole 

Definition at line 46 of file feedlistwidget.cpp.

47  {
48  StickyItemTagRole = Qt::UserRole + 1
49  };

Function Documentation

◆ loadIcon()

QIcon anonymous_namespace{feedlistwidget.cpp}::loadIcon ( const QString &  path,
const QString &  fallbackId 
)

Definition at line 70 of file feedlistwidget.cpp.

71  {
72  const QPixmap pixmap {path};
73  if (!pixmap.isNull())
74  return {pixmap};
75 
76  return UIThemeManager::instance()->getIcon(fallbackId);
77  }
static UIThemeManager * instance()
QIcon getIcon(const QString &iconId, const QString &fallback={}) const

References UIThemeManager::getIcon(), and UIThemeManager::instance().

Referenced by rssFeedIcon().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rssFeedIcon()

QIcon anonymous_namespace{feedlistwidget.cpp}::rssFeedIcon ( const RSS::Feed feed)

Definition at line 79 of file feedlistwidget.cpp.

80  {
81  if (feed->isLoading())
82  return UIThemeManager::instance()->getIcon(QLatin1String("loading"));
83  if (feed->hasError())
84  return UIThemeManager::instance()->getIcon(QLatin1String("unavailable"));
85 
86  return loadIcon(feed->iconPath(), QLatin1String("application-rss+xml"));
87  }
QString iconPath() const
Definition: rss_feed.cpp:503
bool isLoading() const
Definition: rss_feed.cpp:164
bool hasError() const
Definition: rss_feed.cpp:199
QIcon loadIcon(const QString &path, const QString &fallbackId)

References UIThemeManager::getIcon(), RSS::Feed::hasError(), RSS::Feed::iconPath(), UIThemeManager::instance(), RSS::Feed::isLoading(), and loadIcon().

Referenced by FeedListWidget::createItem(), FeedListWidget::handleFeedIconLoaded(), and FeedListWidget::handleFeedStateChanged().

Here is the call graph for this function:
Here is the caller graph for this function: