[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Removing background pic from kcmlocale
From:       Rik Hemsley <rik () kde ! org>
Date:       2001-07-29 14:06:15
[Download RAW message or body]

Patch attached, please review.

Rik


["klocalesample.diff" (text/plain)]

? klocalesample.diff
Index: klocalesample.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/locale/klocalesample.cpp,v
retrieving revision 1.20
diff -u -3 -p -r1.20 klocalesample.cpp
--- klocalesample.cpp	2000/09/23 21:45:18	1.20
+++ klocalesample.cpp	2001/07/29 14:03:38
@@ -24,13 +24,9 @@
  */
 
 #include <qdatetime.h>
-#include <qevent.h>
 #include <qlabel.h>
-#include <qimage.h>
 #include <qwhatsthis.h>
 #include <qlayout.h>
-#include <qobjectlist.h>
-#include <qpixmap.h>
 #include <qtimer.h>
 
 #include <kglobal.h>
@@ -83,28 +79,6 @@ KLocaleSample::KLocaleSample(KLocaleAdva
   lay->setColStretch(0, 1);
   lay->setColStretch(1, 3);
 
-  // background pixmap stuff
-  QString path = locate("data",
-			QString::fromLatin1("kcmlocale/pics/background.png"));
-  QPixmap bgPix( path );
-
-  if ( !bgPix.isNull() ) {
-      bgImage = bgPix.convertToImage();
-
-      const QObjectList *list = children();
-      if ( list ) {
-	  QObject *o;
-	  QObjectListIt it( *list );
-	  while ( (o = it.current()) ) {
-	      if ( o->isWidgetType() )
-		  static_cast<QWidget*>(o)->setBackgroundOrigin(ParentOrigin);
-	      ++it;
-	  }
-
-	  setBackground( bgPix );
-      }
-  }
-
   QTimer *timer = new QTimer(this, "clock_timer");
   connect(timer, SIGNAL(timeout()), this, SLOT(slotUpdateTime()));
   timer->start(1000);
@@ -159,31 +133,3 @@ void KLocaleSample::update()
   QWhatsThis::add( timeSample, str );
 }
 
-void KLocaleSample::resizeEvent( QResizeEvent *e )
-{
-    QWidget::resizeEvent( e );
-
-    if ( !bgImage.isNull() ) {
-	QPixmap pix;
-        pix = bgImage.smoothScale( width(), height() );
-	setBackground( pix );
-    }
-}
-
-void KLocaleSample::setBackground( const QPixmap& pix )
-{
-    setBackgroundPixmap( pix );
-
-    const QObjectList *list = children();
-    if ( list ) {
-	QObject *o;
-	QObjectListIt it( *list );
-	while ( (o = it.current()) ) {
-	    if ( o->isWidgetType() )
-		static_cast<QWidget*>( o )->setBackgroundPixmap( pix );
-	    ++it;
-	}
-
-	setBackgroundPixmap( pix );
-    }
-}
Index: klocalesample.h
===================================================================
RCS file: /home/kde/kdebase/kcontrol/locale/klocalesample.h,v
retrieving revision 1.8
diff -u -3 -p -r1.8 klocalesample.h
--- klocalesample.h	2000/06/29 17:40:05	1.8
+++ klocalesample.h	2001/07/29 14:03:38
@@ -25,7 +25,6 @@
 #ifndef __KLOCALESAMPLE_H__
 #define __KLOCALESAMPLE_H__
 
-#include <qimage.h>
 #include <qwidget.h>
 
 class QLabel;
@@ -47,10 +46,6 @@ public slots:
 protected slots:
   void slotUpdateTime();
 
-protected:
-  virtual void resizeEvent(QResizeEvent *);
-  void setBackground(const QPixmap&);
-
 private:
   KLocaleAdvanced *locale;
   QLabel *numberSample, *labNumber;
@@ -58,7 +53,6 @@ private:
   QLabel *timeSample, *labTime;
   QLabel *dateSample, *labDate;
   QLabel *dateShortSample, *labDateShort;
-  QImage bgImage;
 };
 
 #endif


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic