[Uml-devel] KDE/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Mon Sep 10 03:30:15 UTC 2007


SVN commit 710470 by okellogg:

Handle all enum values in menu selection switch.

 M  +2 -6      activitywidget.cpp  
 M  +4 -0      associationwidget.cpp  
 M  +4 -0      categorywidget.cpp  
 M  +7 -8      combinedfragmentwidget.cpp  
 M  +4 -0      dialogs/activitypage.cpp  
 M  +1 -0      dialogs/activitypage.h  
 M  +5 -0      dialogs/assocpage.cpp  
 M  +4 -0      dialogs/classifierlistpage.cpp  
 M  +5 -0      dialogs/pkgcontentspage.cpp  
 M  +3 -1      entitywidget.cpp  
 M  +2 -5      floatingdashlinewidget.cpp  
 M  +2 -5      objectnodewidget.cpp  
 M  +3 -5      pinwidget.cpp  
 M  +3 -5      preconditionwidget.cpp  
 M  +3 -5      signalwidget.cpp  
 M  +3 -6      statewidget.cpp  
 M  +4 -0      umlwidget.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/activitywidget.cpp #710469:710470
@@ -251,8 +251,6 @@
 }
 
 void ActivityWidget::slotMenuSelection(QAction* action) {
-    bool done = false;
-
     bool ok = false;
     QString name = m_Text;
 
@@ -262,17 +260,15 @@
         name = KInputDialog::getText( i18n("Enter Activity Name"), i18n("Enter the name of the new activity:"), m_Text, &ok );
         if( ok && name.length() > 0 )
             m_Text = name;
-        done = true;
         break;
 
     case ListPopupMenu::mt_Properties:
         showProperties();
-        done = true;
         break;
-    }
 
-    if( !done )
+    default:
         UMLWidget::slotMenuSelection(action);
+    }
 }
 
 void ActivityWidget::showProperties() {
--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp #710469:710470
@@ -2513,6 +2513,10 @@
     case ListPopupMenu::mt_Reset_Label_Positions:
         resetTextPositions();
         break;
+
+    default:
+        kDebug() << "AssociationWidget::slotMenuSelection: Menu_Type "
+            << sel << " not implemented" << endl;
     }//end switch
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/categorywidget.cpp #710469:710470
@@ -101,6 +101,10 @@
       case ListPopupMenu::mt_Union:
           catObj->setType(UMLCategory::ct_Union);
           break;
+
+      default:
+          kDebug() << "CategoryWidget::slotMenuSelection: Menu_Type "
+            << sel << " not implemented" << endl;
     }
     UMLWidget::slotMenuSelection(action);
 }
--- trunk/KDE/kdesdk/umbrello/umbrello/combinedfragmentwidget.cpp #710469:710470
@@ -316,7 +316,6 @@
 
 void CombinedFragmentWidget::slotMenuSelection(QAction* action) {
     bool ok = false;
-    bool done = false;
     QString name = m_Text;
     ListPopupMenu::Menu_Type sel = m_pMenu->getMenuType(action);
     switch (sel) {
@@ -333,8 +332,8 @@
         m_dashLines.back()->setY(getY() + getHeight() / 2);
         m_dashLines.back()->setSize(getWidth(), 0);
         m_pView->setupNewWidget(m_dashLines.back());
-        done = true;
         break;
+
     case ListPopupMenu::mt_Rename:
         if (m_CombinedFragment == Alt) {
             name = KInputDialog::getText( i18n("Enter first alternative"), i18n("Enter first alternative :"), m_Text, &ok );
@@ -345,13 +344,13 @@
         else if (m_CombinedFragment == Loop) {
         name = KInputDialog::getText( i18n("Enter the guard of the loop"), i18n("Enter the guard of the loop:"), m_Text, &ok );
         }
-            if( ok && name.length() > 0 )
-                m_Text = name;
-            done = true;
-            break;
-    }
-   if( !done )
+        if( ok && name.length() > 0 )
+            m_Text = name;
+        break;
+
+    default:
         UMLWidget::slotMenuSelection(action);
+    }
 }
 
 #include "combinedfragmentwidget.moc"
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/activitypage.cpp #710469:710470
@@ -132,6 +132,10 @@
     case ListPopupMenu::mt_Rename:
         slotRename();
         break;
+
+    default:
+        kDebug() << "ActivityPage::slotMenuSelection: Menu_Type "
+            << sel << " not implemented" << endl;
     }
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/activitypage.h #710469:710470
@@ -17,6 +17,7 @@
 #include <q3listbox.h>
 //kde includes
 #include <karrowbutton.h>
+#include <kdebug.h>
 //app includes
 
 class StateWidget;
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/assocpage.cpp #710469:710470
@@ -14,6 +14,7 @@
 //Added by qt3to4:
 #include <QHBoxLayout>
 #include <klocale.h>
+#include <kdebug.h>
 #include "assocpropdlg.h"
 
 AssocPage::AssocPage(QWidget *parent, UMLView * v, UMLObject * o) : QWidget(parent) {
@@ -123,6 +124,10 @@
     case ListPopupMenu::mt_Properties:
         slotDoubleClick(m_pAssocLB -> item(m_pAssocLB -> currentItem()));
         break;
+
+    default:
+        kDebug() << "AssocPage::slotPopupMenuSel: Menu_Type "
+            << id << " not implemented" << endl;
     }
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/classifierlistpage.cpp #710469:710470
@@ -384,6 +384,10 @@
     case ListPopupMenu::mt_Properties:
         slotProperties();
         break;
+
+    default:
+        kDebug() << "ClassifierListPage::slotPopupMenuSel: Menu_Type "
+            << id << " not implemented" << endl;
     }
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/pkgcontentspage.cpp #710469:710470
@@ -14,6 +14,7 @@
 //Added by qt3to4:
 #include <QHBoxLayout>
 #include <klocale.h>
+#include <kdebug.h>
 #include "../umlobjectlist.h"
 #include "../uml.h"
 #include "../umldoc.h"
@@ -126,6 +127,10 @@
     case ListPopupMenu::mt_Properties:
         slotDoubleClick(m_pContentLB->item(m_pContentLB->currentItem()));
         break;
+
+    default:
+        kDebug() << "PkgContentsPage::slotPopupMenuSel: Menu_Type "
+            << id << " not implemented" << endl;
     }
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/entitywidget.cpp #710469:710470
@@ -217,9 +217,11 @@
 
         }
         break;
+
+    default:
+        UMLWidget::slotMenuSelection(action);
     }
 
-    UMLWidget::slotMenuSelection(action);
 }
 
 void EntityWidget::saveToXMI( QDomDocument& qDoc, QDomElement& qElement ) {
--- trunk/KDE/kdesdk/umbrello/umbrello/floatingdashlinewidget.cpp #710469:710470
@@ -65,8 +65,6 @@
 }
 
 void FloatingDashLineWidget::slotMenuSelection(QAction* action) {
-    bool done = false;
-
     bool ok = false;
     QString name = m_Text;
 
@@ -76,11 +74,10 @@
         name = KInputDialog::getText( i18n("Enter alternative Name"), i18n("Enter the alternative :"), m_Text, &ok );
         if( ok && name.length() > 0 )
             m_Text = name;
-        done = true;
         break;
-    }
-    if( !done )
+    default:
         UMLWidget::slotMenuSelection(action);
+    }
 }
 
 void FloatingDashLineWidget::setY(int y)
--- trunk/KDE/kdesdk/umbrello/umbrello/objectnodewidget.cpp #710469:710470
@@ -189,7 +189,6 @@
 }
 
 void ObjectNodeWidget::slotMenuSelection(QAction* action) {
-    bool done = false;
     bool ok = false;
     QString name = m_Text;
 
@@ -199,17 +198,15 @@
         name = KInputDialog::getText( i18n("Enter Object Node Name"), i18n("Enter the name of the object node :"), m_Text, &ok );
         if( ok && name.length() > 0 )
             m_Text = name;
-        done = true;
         break;
 
     case ListPopupMenu::mt_Properties:
         showProperties();
-        done = true;
         break;
-    }
 
-    if( !done )
+    default:
         UMLWidget::slotMenuSelection(action);
+    }
 }
 
 void ObjectNodeWidget::showProperties() {
--- trunk/KDE/kdesdk/umbrello/umbrello/pinwidget.cpp #710469:710470
@@ -172,8 +172,6 @@
 }
 
 void PinWidget::slotMenuSelection(QAction* action) {
-    bool done = false;
-
     bool ok = false;
     QString name = m_Text;
 
@@ -183,11 +181,11 @@
         name = KInputDialog::getText( i18n("Enter Pin Name"), i18n("Enter the pin name :"), m_Text, &ok );
         if( ok )
             setName(name);
-        done = true;
         break;
-    }
-    if( !done )
+
+    default:
         UMLWidget::slotMenuSelection(action);
+    }
 }
 
 
--- trunk/KDE/kdesdk/umbrello/umbrello/preconditionwidget.cpp #710469:710470
@@ -121,8 +121,6 @@
 
 
 void PreconditionWidget::slotMenuSelection(QAction* action) {
-    bool done = false;
-
     bool ok = false;
     QString name = m_Text;
 
@@ -132,12 +130,12 @@
         name = KInputDialog::getText( i18n("Enter Precondition Name"), i18n("Enter the precondition :"), m_Text, &ok );
         if( ok && name.length() > 0 )
             m_Text = name;
-        done = true;
         calculateWidget();
         break;
-    }
-    if( !done )
+
+    default:
         UMLWidget::slotMenuSelection(action);
+    }
 }
 
 void PreconditionWidget::calculateWidget() {
--- trunk/KDE/kdesdk/umbrello/umbrello/signalwidget.cpp #710469:710470
@@ -197,8 +197,6 @@
 }
 
 void SignalWidget::slotMenuSelection(QAction* action) {
-    bool done = false;
-
     bool ok = false;
     QString name = m_Text;
 
@@ -208,11 +206,11 @@
         name = KInputDialog::getText( i18n("Enter signal name"), i18n("Enter the signal name :"), m_Text, &ok );
         if( ok && name.length() > 0 )
             setName(name);
-        done = true;
         break;
-    }
-    if( !done )
+
+    default:
         UMLWidget::slotMenuSelection(action);
+    }
 }
 
 
--- trunk/KDE/kdesdk/umbrello/umbrello/statewidget.cpp #710469:710470
@@ -156,7 +156,6 @@
 }
 
 void StateWidget::slotMenuSelection(QAction* action) {
-    bool done = false;
     bool ok = false;
     QString name = getName();
 
@@ -166,23 +165,21 @@
         name = KInputDialog::getText( i18n("Enter State Name"), i18n("Enter the name of the new state:"), getName(), &ok );
         if( ok && name.length() > 0 )
             setName( name );
-        done = true;
         break;
 
     case ListPopupMenu::mt_Properties:
         showProperties();
-        done = true;
         break;
+
     case ListPopupMenu::mt_New_Activity:
         name = KInputDialog::getText( i18n("Enter Activity"), i18n("Enter the name of the new activity:"), i18n("new activity"), &ok );
         if( ok && name.length() > 0 )
             addActivity( name );
-        done = true;
         break;
-    }
 
-    if( !done )
+    default:
         UMLWidget::slotMenuSelection(action);
+    }
 }
 
 bool StateWidget::addActivity( const QString &activity ) {
--- trunk/KDE/kdesdk/umbrello/umbrello/umlwidget.cpp #710469:710470
@@ -401,6 +401,10 @@
             ft->handleRename();
             break;
         }
+
+    default:
+        kDebug() << "UMLWidget::slotMenuSelection: Menu_Type "
+            << sel << " not implemented" << endl;
     }
 }
 




More information about the umbrello-devel mailing list