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

List:       kde-commits
Subject:    KDE/kdelibs/plasma
From:       Giulio Camuffo <giuliocamuffo () gmail ! com>
Date:       2010-12-16 20:08:16
Message-ID: 20101216200816.9CEB8AC8A8 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1207068 by camuffo:

look for the containment in the QObject hierarchy if it could not be find in the \
QGraphicsItem one. This is needed to  make the applet which are offscreen find their \
containment.


 M  +14 -0     applet.cpp  
 M  +2 -0      containment.cpp  


--- trunk/KDE/kdelibs/plasma/applet.cpp #1207067:1207068
@@ -1513,6 +1513,20 @@
         parent = parent->parentItem();
     }
 
+    if (!c) {
+        //if the applet is an offscreen widget its parentItem will be 0, while its \
parent +        //will be its parentWidget, so here we check the QObject hierarchy.
+        QObject *objParent = this->parent();
+        while (objParent) {
+            Containment *possibleC = qobject_cast<Containment*>(objParent);
+            if (possibleC && possibleC->Applet::d->isContainment) {
+                c = possibleC;
+                break;
+            }
+            objParent = objParent->parent();
+        }
+    }
+
     return c;
 }
 
--- trunk/KDE/kdelibs/plasma/containment.cpp #1207067:1207068
@@ -883,6 +883,7 @@
             currentContainment->d->handles.remove(applet);
         }
         applet->setParentItem(this);
+        applet->setParent(this);
 
         // now move the old config to the new location
         //FIXME: this doesn't seem to get the actual main config group containing \
plugin=, etc @@ -893,6 +894,7 @@
         disconnect(applet, SIGNAL(activate()), currentContainment, \
SIGNAL(activate()));  } else {
         applet->setParentItem(this);
+        applet->setParent(this);
     }
 
     d->applets << applet;


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

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