Blob Blame History Raw
--- trunk/extragear/utils/yakuake/app/mainwindow.cpp	2009/04/07 00:27:24	950384
+++ trunk/extragear/utils/yakuake/app/mainwindow.cpp	2009/04/11 18:32:17	952380
@@ -473,31 +473,55 @@
 
 void MainWindow::updateWindowWidthMenu()
 {
-    QAction* action;
+    QAction* action = 0;
 
-    m_windowWidthMenu->clear(); 
-
-    for (int i = 10; i <= 100; i += 10)
+    if (m_windowWidthMenu->isEmpty())
+    {
+        for (int i = 10; i <= 100; i += 10)
+        {
+            action = m_windowWidthMenu->addAction(QString::number(i) + '%');
+            action->setCheckable(true);
+            action->setData(i);
+            action->setChecked(i == Settings::width());
+        }
+    }
+    else
     {
-        action = m_windowWidthMenu->addAction(QString::number(i) + '%');
-        action->setCheckable(true);
-        action->setData(i);
-        action->setChecked(i == Settings::width());
+        QListIterator<QAction*> i(m_windowWidthMenu->actions());
+
+        while (i.hasNext())
+        {
+            action = i.next();
+
+            action->setChecked(action->data().toInt() == Settings::width());
+        }
     }
 }
 
 void MainWindow::updateWindowHeightMenu()
 {
-    QAction* action;
+    QAction* action = 0;
 
-    m_windowHeightMenu->clear(); 
-
-    for (int i = 10; i <= 100; i += 10)
+    if (m_windowHeightMenu->isEmpty())
+    {
+        for (int i = 10; i <= 100; i += 10)
+        {
+            action = m_windowHeightMenu->addAction(QString::number(i) + '%');
+            action->setCheckable(true);
+            action->setData(i);
+            action->setChecked(i == Settings::height());
+        }
+    }
+    else
     {
-        action = m_windowHeightMenu->addAction(QString::number(i) + '%');
-        action->setCheckable(true);
-        action->setData(i);
-        action->setChecked(i == Settings::height());
+        QListIterator<QAction*> i(m_windowHeightMenu->actions());
+
+        while (i.hasNext())
+        {
+            action = i.next();
+
+            action->setChecked(action->data().toInt() == Settings::height());
+        }
     }
 }