[Uml-devel] branches/work/soc-umbrello/umbrello/dialogs

Andi Fischer andi.fischer at hispeed.ch
Mon Jan 2 09:57:30 UTC 2012


SVN commit 1271066 by fischer:

Krazy2 issues about Qt classes that should not be used fixed.

 M  +8 -11     codeeditor.cpp  
 M  +7 -6      codeeditor.h  


--- branches/work/soc-umbrello/umbrello/dialogs/codeeditor.cpp #1271065:1271066
@@ -5,7 +5,7 @@
  *   (at your option) any later version.                                   *
  *                                                                         *
  *   copyright (C) 2003  Brian Thomas  <brian.thomas at gsfc.nasa.gov>        *
- *   copyright (C) 2004-2011                                               *
+ *   copyright (C) 2004-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -56,7 +56,7 @@
  * Constructor.
  */
 CodeEditor::CodeEditor(const QString & text, CodeViewerDialog * parent, CodeDocument * doc)
-  : QTextEdit(text, parent)
+  : KTextEdit(text, parent)
 {
     init(parent, doc);
 }
@@ -65,7 +65,7 @@
  * Constructor.
  */
 CodeEditor::CodeEditor(CodeViewerDialog * parent, CodeDocument * doc)
-  : QTextEdit(parent)
+  : KTextEdit(parent)
 {
     init(parent, doc);
 }
@@ -89,11 +89,8 @@
 
     // uDebug() << "text block list size=" << m_textBlockList.size();
     while (!m_textBlockList.isEmpty()) {
-        TextBlock* tb = m_textBlockList.takeFirst();
-        if (tb != NULL) {
-            delete tb;
+        /*;TODO:? delete */ m_textBlockList.takeFirst();
         }
-    }
     m_tbInfoMap.clear();
 }
 
@@ -150,7 +147,7 @@
         updateTextBlockFromText (m_lastTextBlockToBeEdited);
         m_lastTextBlockToBeEdited = 0;
     }
-    return QTextEdit::close();
+    return KTextEdit::close();
 }
 
 /**
@@ -236,7 +233,7 @@
     if ((e->key() == 10) || (e->key() == 13) || (e->text() == "\r\n")) {
         m_newLinePressed = true;
     }
-    QTextEdit::keyPressEvent(e);
+    KTextEdit::keyPressEvent(e);
 }
 
 /**
@@ -302,7 +299,7 @@
                 }
             }
         }
-        QTextEdit::append(text); // put actual text in. Use insert instead of append so history is preserved?
+        KTextEdit::append(text); // put actual text in. Use insert instead of append so history is preserved?
     }
     else {
         isInsert = true;
@@ -1502,7 +1499,7 @@
  * If connections are right, then the UMLObject will send out the modified()
  * signal which will trigger a call to re-generate the appropriate code within
  * the code document. Our burden is to appropriately prepare the tool: we clear
- * out ALL the textblocks in the QTextEdit widget and then re-show them
+ * out ALL the textblocks in the KTextEdit widget and then re-show them
  * after the dialog disappears.
  */
 void CodeEditor::rebuildView(int startCursorPos)
--- branches/work/soc-umbrello/umbrello/dialogs/codeeditor.h #1271065:1271066
@@ -5,20 +5,21 @@
  *   (at your option) any later version.                                   *
  *                                                                         *
  *   copyright (C) 2003 Brian Thomas  <brian.thomas at gsfc.nasa.gov>         *
- *   copyright (C) 2004-2011                                               *
+ *   copyright (C) 2004-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
 #ifndef CODEEDITOR_H
 #define CODEEDITOR_H
 
+#include "codeviewerstate.h"
+#include "textblocklist.h"
+
+#include <ktextedit.h>
+
 #include <QtCore/QString>
 #include <QtCore/QList>
-#include <QtGui/QTextEdit>
 
-#include "codeviewerstate.h"
-#include "textblocklist.h"
-
 class CodeViewerDialog;
 class CodeComment;
 class CodeDocument;
@@ -62,7 +63,7 @@
 };
 
 
-class CodeEditor : public QTextEdit
+class CodeEditor : public KTextEdit
 {
     Q_OBJECT
 public:




More information about the umbrello-devel mailing list