mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 15:16:34 +02:00
* Added ImageRegistry::icon() and renamed ::getFromCache to ::pixmap.
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <QSvgRenderer>
|
#include <QSvgRenderer>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <qicon.h>
|
||||||
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
@@ -39,8 +40,15 @@ ImageRegistry::ImageRegistry()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QIcon
|
||||||
|
ImageRegistry::icon( const QString& image, TomahawkUtils::ImageMode mode )
|
||||||
|
{
|
||||||
|
return pixmap( image, TomahawkUtils::defaultIconSize(), mode );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QPixmap
|
QPixmap
|
||||||
ImageRegistry::getFromCache( const QString& image, const QSize& size, TomahawkUtils::ImageMode mode )
|
ImageRegistry::pixmap( const QString& image, const QSize& size, TomahawkUtils::ImageMode mode )
|
||||||
{
|
{
|
||||||
QHash< int, QPixmap > subsubcache;
|
QHash< int, QPixmap > subsubcache;
|
||||||
QHash< int, QHash< int, QPixmap > > subcache;
|
QHash< int, QHash< int, QPixmap > > subcache;
|
||||||
|
@@ -30,7 +30,8 @@ public:
|
|||||||
|
|
||||||
explicit ImageRegistry();
|
explicit ImageRegistry();
|
||||||
|
|
||||||
QPixmap getFromCache( const QString& image, const QSize& size, TomahawkUtils::ImageMode mode = TomahawkUtils::Original );
|
QIcon icon( const QString& image, TomahawkUtils::ImageMode mode = TomahawkUtils::Original );
|
||||||
|
QPixmap pixmap( const QString& image, const QSize& size, TomahawkUtils::ImageMode mode = TomahawkUtils::Original );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void putInCache( const QString& image, const QSize& size, TomahawkUtils::ImageMode mode, const QPixmap& pixmap );
|
void putInCache( const QString& image, const QSize& size, TomahawkUtils::ImageMode mode, const QPixmap& pixmap );
|
||||||
|
Reference in New Issue
Block a user