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

List:       kde-commits
Subject:    extragear/utils/kpager
From:       Pino Toscano <pino () kde ! org>
Date:       2015-11-19 21:47:54
Message-ID: E1ZzX3a-0006zP-GR () scm ! kde ! org
[Download RAW message or body]

SVN commit 1444717 by pino:

remove dead code for background drawing

this code has been basically not used at all since the switch from
kdesktop to plasma (so since kde 4.0), and neither plasma in kde 4.x
nor plasma 5.x (so far) have any kind of api to get the wallpaper of
each virtual desktop

in case this functionality is available in plasma, it will be possible
to reintroduce it back in kpager, but written clean from scratch
(without all the current hacks)


 M  +0 -1      CMakeLists.txt  
 M  +0 -3      config.cpp  
 M  +0 -7      config.ui  
 M  +0 -116    desktop.cpp  
 M  +0 -11     desktop.h  
 M  +0 -5      kpager.cpp  
 M  +0 -1      kpager.h  
 M  +0 -3      kpager.kcfg  
 D             ksharedpixmap.cpp  
 D             ksharedpixmap.h  


--- trunk/extragear/utils/kpager/CMakeLists.txt #1444716:1444717
@@ -15,7 +15,6 @@
    kpager.cpp 
    config.cpp 
    windowdrag.cpp
-   ksharedpixmap.cpp
    main.cpp )
 qt4_add_dbus_adaptor( kpager_SRCS org.kde.KPager.xml kpager.h KPagerMainWindow )
 kde4_add_kcfg_files(kpager_SRCS settings.kcfgc)
--- trunk/extragear/utils/kpager/config.cpp #1444716:1444717
@@ -37,9 +37,6 @@
 
     QWidget *main = new QWidget(this);
     m_ui.setupUi(main);
-#ifndef CAN_LOAD_BACKGROUND
-    m_ui.kcfg_showBackground->hide();
-#endif
     main->layout()->setMargin(0);
     KPageWidgetItem *item = addPage(main, "main");
     item->setHeader(""); // hide the header
--- trunk/extragear/utils/kpager/config.ui #1444716:1444717
@@ -40,13 +40,6 @@
         </widget>
        </item>
        <item>
-        <widget class="QCheckBox" name="kcfg_showBackground">
-         <property name="text">
-          <string>Show background</string>
-         </property>
-        </widget>
-       </item>
-       <item>
         <widget class="QCheckBox" name="kcfg_showWindows">
          <property name="text">
           <string>Show windows</string>
--- trunk/extragear/utils/kpager/desktop.cpp #1444716:1444717
@@ -30,7 +30,6 @@
 #include <kwindowsystem.h>
 #include <ksharedconfig.h>
 #include <kdebug.h>
-#include <ksharedpixmap.h>
 #include <kmenu.h>
 #include <netwm.h>
 #include <QPainter>
@@ -52,10 +51,6 @@
 {
   m_desk = desk;
   m_name = KWindowSystem::desktopName(m_desk);
-  m_bgSmallPixmap=0L;
-  m_bgCommonSmallPixmap=0L;
-  m_bgPixmap = 0L;
-  m_bgDirty=true;
   m_grabWindows=false;
   setAcceptDrops(true);
   setAttribute(Qt::WA_NoSystemBackground, true);
@@ -66,8 +61,6 @@
 
 Desktop::~Desktop()
 {
-  delete m_bgPixmap;
-  delete m_bgSmallPixmap;
 }
 
 void Desktop::mouseMoveEvent( QMouseEvent *ev )
@@ -183,61 +176,6 @@
   return pixmap.transformed(m);
 }
 
-void Desktop::loadBgPixmap(void)
-{
-//  if (!m_bgDirty) return;
-/*
-  org::kde::kdesktop::Background kdesktop( "org.kde.kdesktop", "/Background", \
                QDBusConnection::sessionBus() ); 
-  QDBusReply<bool> reply = kdesktop.isCommon();
-  m_isCommon = reply;
-  if  ( m_isCommon && m_desk!=1 ) return;
-  QDataStream args2( data2, QIODevice::WriteOnly );
-  args2 << m_desk-1 << 0 << 0 << -1 << -1 << 200 << 150 ;
-  if (client->call("kdesktop", "KBackgroundIface",
-	"wallpaper(int,int,int,int,int,int,int)", data2, replyType, replyData))
-  {
-    QDataStream reply(replyData, QIODevice::ReadOnly);
-    if (replyType == "QPixmap") {
-      QPixmap pixmap;
-      reply >> pixmap;
-      if (!pixmap.isNull())
-      {
-        kDebug() << "getting small bg through dcop\n";
-	if (m_isCommon)
-	{
-	  if (m_bgSmallPixmap) { delete m_bgSmallPixmap; m_bgSmallPixmap=0L; }
-
-	  if (!m_bgCommonSmallPixmap) m_bgCommonSmallPixmap=new QPixmap(pixmap);
-	  else *m_bgCommonSmallPixmap=pixmap;
-	}
-	else
-	{
-	  if (m_bgCommonSmallPixmap)
-	  {
-	    delete m_bgCommonSmallPixmap;
-	    m_bgCommonSmallPixmap=0L;
-	  }
-
-	  if (!m_bgSmallPixmap) m_bgSmallPixmap=new QPixmap(pixmap);
-	  else *m_bgSmallPixmap=pixmap;
-	}
-        return;
-      }
-    }
-  }
-  kDebug() << "getting whole bg through shpixmap\n";
-  kdesktop.setExport(1);
-
-  if (!m_bgPixmap)
-  {
-     m_bgPixmap = new KSharedPixmap;
-     connect(m_bgPixmap, SIGNAL(done(bool)), SLOT(backgroundLoaded(bool)));
-  }
-
-  m_bgPixmap->loadFromShared(QString("DESKTOP%1").arg(m_isCommon?1:m_desk));
- */
-}
-
 void Desktop::paintWindow(QPainter &p, const KWindowInfo *info, bool onDesktop) \
const  {
     switch (Settings::windowDrawMode())
@@ -404,29 +342,6 @@
 //  p.setPen(Qt::black);
 //  p.drawRect(rect());
 
-#ifdef CAN_LOAD_BACKGROUND
-  if (Settings::showBackground())
-  {
-    if ( ( !m_isCommon && !m_bgSmallPixmap )
-      || (m_isCommon && !m_bgCommonSmallPixmap) )
-	loadBgPixmap();
-
-    if ( ( !m_isCommon && m_bgSmallPixmap && !m_bgSmallPixmap->isNull() )
-	|| ( m_isCommon &&
-		m_bgCommonSmallPixmap && !m_bgCommonSmallPixmap->isNull() ) )
-    {
-      QPixmap tmp;
-      if ( m_isCommon )
-	tmp=fastScalePixmap(*m_bgCommonSmallPixmap, width(),height());
-      else
-	tmp=fastScalePixmap(*m_bgSmallPixmap, width(),height());
-
-      p.drawPixmap(0,0,tmp);
-    }
-     else p.fillRect(rect(), Qt::gray);
-  }
-  else
-#endif
     p.fillRect(rect(), palette().brush(QPalette::Mid));
 
     // set in/active pen
@@ -620,34 +535,6 @@
   return KWindowSystem::currentDesktop()==m_desk;
 }
 
-void Desktop::backgroundLoaded(bool b)
-{
-  if (b)
-  {
-    if (m_isCommon)
-    {
-      if (m_bgSmallPixmap) { delete m_bgSmallPixmap; m_bgSmallPixmap=0L ; };
-
-      if (!m_bgCommonSmallPixmap) m_bgCommonSmallPixmap=new QPixmap;
-      *m_bgCommonSmallPixmap=scalePixmap(m_bgPixmap->pixmap(),200,150);
-    }
-    else
-    {
-      if (m_bgCommonSmallPixmap) { delete m_bgCommonSmallPixmap;
-		m_bgCommonSmallPixmap=0L ; };
-
-      if (!m_bgSmallPixmap) m_bgSmallPixmap=new QPixmap;
-      *m_bgSmallPixmap=fastScalePixmap(m_bgPixmap->pixmap(),200,150);
-    }
-    delete m_bgPixmap;
-    m_bgPixmap=0L;
-
-
-    if (m_isCommon) pager()->updateAllDesktops();
-    else update();
-  } else kDebug() << "Error getting the background\n";
-}
-
 QSize Desktop::sizeHint() const
 {
   return QSize(67,50);
@@ -676,7 +563,4 @@
     }
 }
 
-QPixmap *Desktop::m_bgCommonSmallPixmap=0L;
-bool Desktop::m_isCommon=false;
-
 #include "desktop.moc"
--- trunk/extragear/utils/kpager/desktop.h #1444716:1444717
@@ -32,8 +32,6 @@
 
 #include <settings.h>
 
-class KSharedPixmap;
-
 class QPainter;
 class QPoint;
 
@@ -74,11 +72,7 @@
   void updateDesktopName();
 
   bool m_grabWindows;
-public Q_SLOTS:
-  void backgroundLoaded(bool b);
 
-  void loadBgPixmap();
-
 protected:
   void mousePressEvent( QMouseEvent *ev );
   void mouseMoveEvent( QMouseEvent *ev );
@@ -93,11 +87,6 @@
 
   int m_desk;
   QString m_name;
-  KSharedPixmap *m_bgPixmap;
-  bool m_bgDirty;
-  QPixmap *m_bgSmallPixmap;
-  static QPixmap *m_bgCommonSmallPixmap;
-  static bool m_isCommon;
   Settings::EnumWindowTransparentMode m_transparentMode;
 
   QPixmap paintNewWindow(const KWindowInfo *info) const;
--- trunk/extragear/utils/kpager/kpager.cpp #1444716:1444717
@@ -567,11 +567,6 @@
         m_grabWinTimer->start(1000);
 }
 
-void KPager::slotBackgroundChanged(int desk)
-{
-    m_desktops[desk-1]->loadBgPixmap();
-}
-
 void KPager::sendToDesktop(QAction *action)
 {
     int desk = action->data().toInt();
--- trunk/extragear/utils/kpager/kpager.h #1444716:1444717
@@ -105,7 +105,6 @@
     void slotGrabWindows();
 
 protected Q_SLOTS:
-    void slotBackgroundChanged(int);
     void clientPopupAboutToShow();
     void clientPopupActivated(QAction*);
     void desktopPopupAboutToShow();
--- trunk/extragear/utils/kpager/kpager.kcfg #1444716:1444717
@@ -17,9 +17,6 @@
         <choice name="Vertical" />
       </choices>
     </entry>
-    <entry key="showBackground" type="Bool">
-      <default>true</default>
-    </entry>
     <entry key="showName" type="Bool">
       <default>false</default>
     </entry>


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

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