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

Andi Fischer andi.fischer at hispeed.ch
Sat Feb 12 09:12:08 UTC 2011


SVN commit 1219991 by fischer:

Separation of the debug code from umlnamespace into debug_utils. Filtering of debug messages added. Enter Ctrl + D to open selection window.

 M  +8 -0      CMakeLists.txt  
 A             debug (directory)  
 A             debug/debug_utils.cpp   [License: GPL (v2+)]
 A             debug/debug_utils.h   [License: GPL (v2+)]
 M  +19 -8     uml.cpp  
 M  +7 -5      umldoc.cpp  
 M  +1 -19     umlnamespace.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/CMakeLists.txt #1219990:1219991
@@ -19,6 +19,7 @@
 include_directories(
   ${LIBXML2_INCLUDE_DIR}
   ${LIBXSLT_INCLUDE_DIR}
+  ${CMAKE_CURRENT_SOURCE_DIR}/debug/
   ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/
   ${CMAKE_CURRENT_SOURCE_DIR}/clipboard/
   ${CMAKE_CURRENT_SOURCE_DIR}/codeimport/
@@ -42,10 +43,16 @@
   ${CMAKE_CURRENT_SOURCE_DIR}/codegenerators/xml/
   ${CMAKE_CURRENT_SOURCE_DIR}/codegenwizard/
   ${CMAKE_CURRENT_SOURCE_DIR}/controller/
+  ${CMAKE_CURRENT_SOURCE_DIR}/docgenerators/
+  ${CMAKE_CURRENT_SOURCE_DIR}/refactoring/
   ${CMAKE_CURRENT_SOURCE_DIR}/widgets/
   ${Boost_INCLUDE_DIR}
 )
 
+set(libdebug_SRCS
+    debug/debug_utils.cpp
+)
+
 set(libcodegenerator_SRCS
     codegenerators/codegenfactory.cpp
     codegenerators/codegenpolicyext.cpp
@@ -428,6 +435,7 @@
 set (umbrello_SRCS
     ${umbrello_SRCS}
     ${libcontroller_SRCS}
+    ${libdebug_SRCS}
     ${libdialogs_SRCS}
     ${librefactoring_SRCS}
     ${libcodegenwizard_SRCS}
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.cpp #1219990:1219991
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2010                                               *
+ *   copyright (C) 2002-2011                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -34,6 +34,7 @@
 #include "widget_utils.h"
 #include "icon_utils.h"
 #include "model_utils.h"
+#include "debug_utils.h"
 // dialogs
 #include "classwizard.h"
 #include "codegenerationwizard.h"
@@ -42,13 +43,13 @@
 #include "importprojectdlg.h"
 #include "settingsdlg.h"
 #include "classimport.h"
-#include "refactoring/refactoringassistant.h"
+#include "refactoringassistant.h"
 // clipboard
 #include "umlclipboard.h"
 #include "umldragdata.h"
 // docgenerators
-#include "docgenerators/docbookgenerator.h"
-#include "docgenerators/xhtmlgenerator.h"
+#include "docbookgenerator.h"
+#include "xhtmlgenerator.h"
 
 // kde includes
 #include <kaction.h>
@@ -58,7 +59,6 @@
 #include <krecentfilesaction.h>
 #include <kconfig.h>
 #include <kcursor.h>
-#include <kdebug.h>
 #include <kfiledialog.h>
 #include <klocale.h>
 #include <kmenubar.h>
@@ -146,6 +146,8 @@
     initClip();
     readOptions();
 
+    Tracer::instance()->registerClass(metaObject()->className());
+
     //get a reference to the Code->Active Language and to the Diagram->Zoom menu
     m_langSelect = findMenu(QString("active_lang_menu") );
 
@@ -2435,6 +2437,13 @@
         e->accept();
         break;
 
+    case Qt::Key_D:
+        if (e->modifiers() & Qt::ControlModifier) {  // Ctrl + D
+            DEBUG(DBG_SRC) << "Ctrl + D is pressed. Show debug config dialog...";
+            Tracer::instance()->show();
+        }
+        break;
+
     default:
         e->ignore();
     }
@@ -2555,7 +2564,7 @@
 {
     m_view = view;
     if (view == NULL) {
-        uDebug() << "view is NULL";
+        DEBUG(DBG_SRC) << "view is NULL";
         docWindow()->newDocumentation();
         return;
     }
@@ -2583,7 +2592,9 @@
     if (lvitem) {
         m_listView->setCurrentItem(lvitem);
     }
-    uDebug() << "name=" << view->getName() << ", isOpen=" << view->isOpen() << ", id=" << ID2STR(view->getID());
+    DEBUG(DBG_SRC) << "name=" << view->getName()
+                   << ", isOpen=" << view->isOpen()
+                   << ", id=" << ID2STR(view->getID());
 }
 
 /**
@@ -2819,7 +2830,7 @@
 {
     if (cmd != NULL) {
         m_pUndoStack->push(cmd);
-        uDebug() << cmd->text() << " [" << m_pUndoStack->count() << "]";
+        DEBUG(DBG_SRC) << cmd->text() << " [" << m_pUndoStack->count() << "]";
     }
 
     UMLApp::app()->enableUndo(true);
--- trunk/KDE/kdesdk/umbrello/umbrello/umldoc.cpp #1219990:1219991
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *  copyright (C) 2002-2010                                                *
+ *  copyright (C) 2002-2011                                                *
  *  Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                   *
  ***************************************************************************/
 
@@ -31,8 +31,6 @@
 #include "classifierlistitem.h"
 #include "object_factory.h"
 #include "import_rose.h"
-#include "model_utils.h"
-#include "widget_utils.h"
 #include "uml.h"
 #include "umllistview.h"
 #include "umllistviewitem.h"
@@ -44,10 +42,13 @@
 #include "listpopupmenu.h"
 #include "cmds.h"
 #include "diagramprintpage.h"
+// utils
+#include "debug_utils.h"
+#include "model_utils.h"
+#include "widget_utils.h"
 
 // kde includes
 #include <kdeversion.h>
-#include <kdebug.h>
 #include <kio/job.h>
 #include <kio/netaccess.h>
 #include <klocale.h>
@@ -98,6 +99,7 @@
     m_pCurrentRoot(0),
     m_bClosing(false)
 {
+    Tracer::instance()->registerClass(metaObject()->className());
 }
 
 /**
@@ -1367,7 +1369,7 @@
  */
 void UMLDoc::changeCurrentView(Uml::IDType id)
 {
-    uDebug() << "id=" << ID2STR(id);
+    DEBUG(DBG_SRC) << "id=" << ID2STR(id);
     UMLApp* pApp = UMLApp::app();
     UMLView* view = findView(id);
     if (view) {
--- trunk/KDE/kdesdk/umbrello/umbrello/umlnamespace.h #1219990:1219991
@@ -13,7 +13,6 @@
 
 #include <string>
 #include <QtCore/QString>
-#include <kdebug.h>
 
 /**
  * @author Paul Hensgen
@@ -342,23 +341,6 @@
 # define STR2ID(id)  qPrintable(id)
 # define ID2STR(id)  QString(id.c_str())
 
-// convenience macros for console output to the Umbrello area
-#define uDebug()   kDebug(8060)
-#define uError()   kError(8060)
-#define uWarning() kWarning(8060)
+#include "debug_utils.h"
 
-#define DISABLE_COPY(Class)                     \
-    Class(const Class &);                       \
-    Class &operator=(const Class &);
-
-#define uIgnoreZeroPointer(a) if (!a) { uDebug() << "zero pointer detected" << __FILE__ << __LINE__; continue; }
-
-/**
- * In a Q_OBJECT class define any enum as Q_ENUMS.
- * With the above the following macro returns the name of a given enum.
- * This can be used in debug output.
- * TODO: convert it to a function.
- */
-#define ENUM_NAME(o,e,v) (o::staticMetaObject.enumerator(o::staticMetaObject.indexOfEnumerator(#e)).valueToKey((v)))
-
 #endif




More information about the umbrello-devel mailing list