summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp1
-rw-r--r--noncore/multimedia/opieplayer2/skin.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/skin.h4
3 files changed, 10 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp
index edef2a7..46e7b6e 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.cpp
+++ b/noncore/multimedia/opieplayer2/mediawidget.cpp
@@ -68,6 +68,7 @@ MediaWidget::Button MediaWidget::setupButton( const SkinButtonInfo &buttonInfo,
68void MediaWidget::loadDefaultSkin( const GUIInfo &guiInfo ) 68void MediaWidget::loadDefaultSkin( const GUIInfo &guiInfo )
69{ 69{
70 Skin skin( guiInfo.fileNameInfix ); 70 Skin skin( guiInfo.fileNameInfix );
71 skin.setCachable( false );
71 loadSkin( guiInfo.buttonInfo, guiInfo.buttonCount, skin ); 72 loadSkin( guiInfo.buttonInfo, guiInfo.buttonCount, skin );
72} 73}
73 74
diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp
index a8f4ae9..44f5ca2 100644
--- a/noncore/multimedia/opieplayer2/skin.cpp
+++ b/noncore/multimedia/opieplayer2/skin.cpp
@@ -77,11 +77,15 @@ Skin::Skin( const QString &fileNameInfix )
77 77
78Skin::~Skin() 78Skin::~Skin()
79{ 79{
80 SkinCache::self().store( m_skinPath, m_fileNameInfix, d ); 80 if ( m_isCachable )
81 SkinCache::self().store( m_skinPath, m_fileNameInfix, d );
82 else
83 delete d;
81} 84}
82 85
83void Skin::init( const QString &name ) 86void Skin::init( const QString &name )
84{ 87{
88 m_isCachable = true;
85 m_skinPath = "opieplayer2/skins/" + name; 89 m_skinPath = "opieplayer2/skins/" + name;
86 d = SkinCache::self().lookupAndTake( m_skinPath, m_fileNameInfix ); 90 d = SkinCache::self().lookupAndTake( m_skinPath, m_fileNameInfix );
87} 91}
diff --git a/noncore/multimedia/opieplayer2/skin.h b/noncore/multimedia/opieplayer2/skin.h
index bafebd3..067b6c4 100644
--- a/noncore/multimedia/opieplayer2/skin.h
+++ b/noncore/multimedia/opieplayer2/skin.h
@@ -38,6 +38,9 @@ public:
38 Skin( const QString &fileNameInfix ); 38 Skin( const QString &fileNameInfix );
39 ~Skin(); 39 ~Skin();
40 40
41 bool isCachable() const { return m_isCachable; }
42 void setCachable( bool cachable ) { m_isCachable = cachable; }
43
41 QPixmap backgroundPixmap() const; 44 QPixmap backgroundPixmap() const;
42 QImage buttonUpImage() const; 45 QImage buttonUpImage() const;
43 QImage buttonDownImage() const; 46 QImage buttonDownImage() const;
@@ -57,6 +60,7 @@ private:
57 60
58 QString m_fileNameInfix; 61 QString m_fileNameInfix;
59 QString m_skinPath; 62 QString m_skinPath;
63 bool m_isCachable : 1;
60 64
61 SkinData *d; 65 SkinData *d;
62 66