qBittorrent
IconProvider Class Reference

#include <iconprovider.h>

Inheritance diagram for IconProvider:
Collaboration diagram for IconProvider:

Public Member Functions

virtual QString getIconPath (const QString &iconId) const
 

Static Public Member Functions

static void initInstance ()
 
static void freeInstance ()
 
static IconProviderinstance ()
 

Protected Member Functions

 IconProvider (QObject *parent=nullptr)
 
 ~IconProvider ()
 

Static Protected Attributes

static IconProviderm_instance = nullptr
 

Detailed Description

Definition at line 36 of file iconprovider.h.

Constructor & Destructor Documentation

◆ IconProvider()

IconProvider::IconProvider ( QObject *  parent = nullptr)
explicitprotected

Definition at line 34 of file iconprovider.cpp.

35  : QObject(parent)
36 {
37 }

Referenced by initInstance().

Here is the caller graph for this function:

◆ ~IconProvider()

IconProvider::~IconProvider ( )
protected

Definition at line 39 of file iconprovider.cpp.

39 {}

Member Function Documentation

◆ freeInstance()

void IconProvider::freeInstance ( )
static

Definition at line 47 of file iconprovider.cpp.

48 {
49  delete m_instance;
50  m_instance = nullptr;
51 }
static IconProvider * m_instance
Definition: iconprovider.h:51

References m_instance.

Referenced by Application::cleanup().

Here is the caller graph for this function:

◆ getIconPath()

QString IconProvider::getIconPath ( const QString &  iconId) const
virtual

Definition at line 58 of file iconprovider.cpp.

59 {
60  // there are a few icons not available in svg
61  const QString pathSvg = ":/icons/" + iconId + ".svg";
62  if (QFileInfo::exists(pathSvg))
63  return pathSvg;
64 
65  const QString pathPng = ":/icons/" + iconId + ".png";
66  return pathPng;
67 }

◆ initInstance()

void IconProvider::initInstance ( )
static

Definition at line 41 of file iconprovider.cpp.

42 {
43  if (!m_instance)
45 }
IconProvider(QObject *parent=nullptr)

References IconProvider(), and m_instance.

Referenced by Application::exec().

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

◆ instance()

IconProvider * IconProvider::instance ( )
static

Definition at line 53 of file iconprovider.cpp.

54 {
55  return m_instance;
56 }

References m_instance.

Member Data Documentation

◆ m_instance

IconProvider * IconProvider::m_instance = nullptr
staticprotected

Definition at line 51 of file iconprovider.h.

Referenced by freeInstance(), initInstance(), and instance().


The documentation for this class was generated from the following files: