homescreenapp/hsdomainmodel/src/hswallpaper.cpp
changeset 36 cdae8c6c3876
parent 35 f9ce957a272c
child 39 4e8ebe173323
--- a/homescreenapp/hsdomainmodel/src/hswallpaper.cpp	Fri Mar 19 09:27:44 2010 +0200
+++ b/homescreenapp/hsdomainmodel/src/hswallpaper.cpp	Fri Apr 16 14:54:01 2010 +0300
@@ -18,24 +18,14 @@
 #include <QDir>
 #include <QPainter>
 #include "hswallpaper.h"
-#include "hswallpaper_p.h"
 #include "hsscene.h"
 
-HsWallpaperPrivate::HsWallpaperPrivate()
-  : mOrientation(Qt::Vertical)
-{
-}
- 
-HsWallpaperPrivate::~HsWallpaperPrivate()
+HsWallpaper::HsWallpaper(QGraphicsItem *parent)
+  : HbWidget(parent),
+    mOrientation(Qt::Vertical)
 {
 }
 
-HsWallpaper::HsWallpaper(QGraphicsItem *parent)
-    : HbWidget(parent)
-{
-    mD.reset(new HsWallpaperPrivate);
-}
-
 HsWallpaper::~HsWallpaper()
 {
 }
@@ -48,18 +38,18 @@
     Q_UNUSED(widget);
 
     Qt::Orientation orientation = HsScene::orientation();
-    if (orientation != mD->mOrientation) {
-        mD->mOrientation = orientation;
-        mD->mImage = QPixmap();
+    if (orientation != mOrientation) {
+        mOrientation = orientation;
+        mImage = QPixmap();
         if (orientation == Qt::Horizontal) {
-            mD->mImage.load(mD->mLImagePath);
+            mImage.load(mLImagePath);
         } else {
-            mD->mImage.load(mD->mPImagePath);
+            mImage.load(mPImagePath);
         }
     }
 
-    if (!mD->mImage.isNull()) {
-        painter->drawPixmap(rect().toRect(), mD->mImage);
+    if (!mImage.isNull()) {
+        painter->drawPixmap(rect().toRect(), mImage);
     }
 }
 
@@ -74,26 +64,26 @@
 bool HsWallpaper::setImagesByPaths(const QString &landscapeImagePath,
                                    const QString &portraitImagePath)
 {
-    mD->mLImagePath = landscapeImagePath;
-    mD->mPImagePath = portraitImagePath;
-    mD->mOrientation = HsScene::orientation();
+    mLImagePath = landscapeImagePath;
+    mPImagePath = portraitImagePath;
+    mOrientation = HsScene::orientation();
     
-    if (mD->mOrientation == Qt::Horizontal) {
-        return mD->mImage.load(mD->mLImagePath);
+    if (mOrientation == Qt::Horizontal) {
+        return mImage.load(mLImagePath);
     } else {
-        return mD->mImage.load(mD->mPImagePath);
+        return mImage.load(mPImagePath);
     }
 }
 
 bool HsWallpaper::removeImages()
 {
-    if (mD->mLImagePath != wallpaperPath(Qt::Horizontal)) {
-        QFile::remove(mD->mLImagePath);
-        mD->mLImagePath.clear();
+    if (mLImagePath != wallpaperPath(Qt::Horizontal)) {
+        QFile::remove(mLImagePath);
+        mLImagePath.clear();
     }
-    if (mD->mPImagePath != wallpaperPath(Qt::Vertical)) {
-        QFile::remove(mD->mPImagePath);
-        mD->mPImagePath.clear();
+    if (mPImagePath != wallpaperPath(Qt::Vertical)) {
+        QFile::remove(mPImagePath);
+        mPImagePath.clear();
     }    
     return true;
 }