summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp1
-rw-r--r--noncore/multimedia/opieplayer2/skin.cpp4
-rw-r--r--noncore/multimedia/opieplayer2/skin.h4
3 files changed, 9 insertions, 0 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
@@ -70,2 +70,3 @@ void MediaWidget::loadDefaultSkin( const GUIInfo &guiInfo )
Skin skin( guiInfo.fileNameInfix );
+ skin.setCachable( false );
loadSkin( guiInfo.buttonInfo, guiInfo.buttonCount, skin );
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
@@ -79,3 +79,6 @@ Skin::~Skin()
{
+ if ( m_isCachable )
SkinCache::self().store( m_skinPath, m_fileNameInfix, d );
+ else
+ delete d;
}
@@ -84,2 +87,3 @@ void Skin::init( const QString &name )
{
+ m_isCachable = true;
m_skinPath = "opieplayer2/skins/" + name;
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
@@ -40,2 +40,5 @@ public:
+ bool isCachable() const { return m_isCachable; }
+ void setCachable( bool cachable ) { m_isCachable = cachable; }
+
QPixmap backgroundPixmap() const;
@@ -59,2 +62,3 @@ private:
QString m_skinPath;
+ bool m_isCachable : 1;