summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-11 13:12:29 (UTC)
committer simon <simon>2002-12-11 13:12:29 (UTC)
commitcd5e96b40ceae9158e5cb01e71769e895ea7a3c1 (patch) (side-by-side diff)
tree0a5e1961a31096f995e00215d851c3af8e8ae877
parent57a776c8345422a0fc32b3fb9d604be1c050d201 (diff)
downloadopie-cd5e96b40ceae9158e5cb01e71769e895ea7a3c1.zip
opie-cd5e96b40ceae9158e5cb01e71769e895ea7a3c1.tar.gz
opie-cd5e96b40ceae9158e5cb01e71769e895ea7a3c1.tar.bz2
- moved default skin name reading over to skin class
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp9
-rw-r--r--noncore/multimedia/opieplayer2/skin.cpp21
-rw-r--r--noncore/multimedia/opieplayer2/skin.h6
3 files changed, 26 insertions, 10 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp
index 0d1c8b6..ab23aa8 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.cpp
+++ b/noncore/multimedia/opieplayer2/mediawidget.cpp
@@ -27,5 +27,2 @@
-#include <qpe/config.h>
-#include <qpe/qpeapplication.h>
-
MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name )
@@ -71,7 +68,3 @@ void MediaWidget::loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCo
{
- Config cfg( "OpiePlayer" );
- cfg.setGroup( "Options" );
- QString name = cfg.readEntry( "Skin","default" );
-
- Skin skin( name, fileNameInfix );
+ Skin skin( fileNameInfix );
loadSkin( skinInfo, buttonCount, skin );
diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp
index d3918d1..8281b20 100644
--- a/noncore/multimedia/opieplayer2/skin.cpp
+++ b/noncore/multimedia/opieplayer2/skin.cpp
@@ -4,5 +4,17 @@
#include <qpe/resource.h>
+#include <qpe/config.h>
Skin::Skin( const QString &name, const QString &fileNameInfix )
- : m_name( name ), m_fileNameInfix( fileNameInfix )
+ : m_fileNameInfix( fileNameInfix )
+{
+ init( name );
+}
+
+Skin::Skin( const QString &fileNameInfix )
+ : m_fileNameInfix( fileNameInfix )
+{
+ init( defaultSkinName() );
+}
+
+void Skin::init( const QString &name )
{
@@ -81,2 +93,9 @@ QImage Skin::buttonMaskImage( const QString &fileName ) const
+QString Skin::defaultSkinName()
+{
+ Config cfg( "OpiePlayer" );
+ cfg.setGroup( "Options" );
+ return cfg.readEntry( "Skin", "default" );
+}
+
/* vim: et sw=4 ts=4
diff --git a/noncore/multimedia/opieplayer2/skin.h b/noncore/multimedia/opieplayer2/skin.h
index ee19f4b..58f1849 100644
--- a/noncore/multimedia/opieplayer2/skin.h
+++ b/noncore/multimedia/opieplayer2/skin.h
@@ -13,2 +13,3 @@ public:
Skin( const QString &name, const QString &fileNameInfix );
+ Skin( const QString &fileNameInfix );
@@ -24,6 +25,9 @@ public:
+ static QString defaultSkinName();
+
private:
+ void init( const QString &name );
+
void addButtonToMask( int tag, const QImage &maskImage ) const;
- QString m_name;
QString m_fileNameInfix;