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

List:       kde-commits
Subject:    [plasma-desktop] containments/desktop/package/contents/ui: Remove pointless timer
From:       David Edmundson <kde () davidedmundson ! co ! uk>
Date:       2015-03-22 13:24:45
Message-ID: E1YZfrx-0007EQ-LS () scm ! kde ! org
[Download RAW message or body]

Git commit 3c86020a1804b125bad7e221322fe3dcfa40d7ae by David Edmundson.
Committed on 22/03/2015 at 14:24.
Pushed by davidedmundson into branch 'master'.

Remove pointless timer

There is a connection on backgroundHints changing, we don't need to put
the initial setting on a timer, it will update anyway. The comment next
to it made no sense, we know the plasmoid top level component is
comlete.

Testing shows everything is faster as we don't paint a background on
notes only to remove it again.

M  +7    -16   containments/desktop/package/contents/ui/AppletAppearance.qml

http://commits.kde.org/plasma-desktop/3c86020a1804b125bad7e221322fe3dcfa40d7ae

diff --git a/containments/desktop/package/contents/ui/AppletAppearance.qml \
b/containments/desktop/package/contents/ui/AppletAppearance.qml index \
                53f2bcc..e0e8395 100644
--- a/containments/desktop/package/contents/ui/AppletAppearance.qml
+++ b/containments/desktop/package/contents/ui/AppletAppearance.qml
@@ -66,20 +66,6 @@ Item {
     onMinimumWidthChanged: appletItem.width = Math.max(minimumWidth, width);
     onMinimumHeightChanged: appletItem.height = Math.max(minimumHeight, height);
 
-
-    //FIXME: this delay is because backgroundHints gets updated only after a while \
                in qml applets
-    Timer {
-        id: appletTimer
-        interval: 50
-        repeat: false
-        running: false
-        onTriggered: {
-            updateBackgroundHints();
-            applet.parent = appletContainer;
-            applet.anchors.fill = appletContainer;
-        }
-    }
-
     function updateBackgroundHints() {
         hasBackground = (applet.backgroundHints != "NoBackground");
         if (applet.backgroundHints == 1) {
@@ -303,9 +289,14 @@ Item {
                 }
 
                 onAppletChanged: {
-                    if (applet) {
-                        appletTimer.running = true;
+                    if (!applet) {
+                        return;
                     }
+
+                    applet.parent = appletContainer;
+                    applet.anchors.fill = appletContainer;
+                    
+                    updateBackgroundHints();
                 }
                 Connections {
                     target: appletHandle.item


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

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