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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/desktop/shell
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2010-12-13 1:48:41
Message-ID: 20101213014841.8D2C3AC8A7 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1205928 by aseigo:

ensure we always get a "lastsize" entry in the config


 M  +6 -4      panelview.cpp  


--- trunk/KDE/kdebase/workspace/plasma/desktop/shell/panelview.cpp #1205927:1205928
@@ -831,8 +831,8 @@
     disconnect(this, SIGNAL(sceneRectAboutToChange()), this, SLOT(pinchContainmentToCurrentScreen()));
     bool horizontal = isHorizontal();
 
-    int sw = screenGeom.width();
-    int sh = screenGeom.height();
+    const int sw = screenGeom.width();
+    const int sh = screenGeom.height();
 
     Plasma::Containment *c = containment();
     QSizeF min = c->minimumSize();
@@ -957,10 +957,12 @@
         c->resize(max);
     }
 
-    if (m_lastHorizontal != horizontal ||
-        m_lastSeenSize != (horizontal ? sw : sh)) {
+    // write to the config file if the size has changed, or if we haven't recorded the lastsize
+    // previously which ensures we'll always have a value even after first run
+    const bool writeConfig = m_lastSeenSize != (horizontal ? sw : sh) || !sizes.hasKey("lastsize");
         m_lastHorizontal = horizontal;
         m_lastSeenSize = (horizontal ? sw : sh);
+    if (writeConfig) {
         sizes.writeEntry("lastsize", m_lastSeenSize);
         configNeedsSaving();
     }
[prev in list] [next in list] [prev in thread] [next in thread] 

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