[Bug 72830] Crash when switching between compiling output levels

Simon Hausmann hausmann at kde.org
Fri Feb 6 13:49:02 UTC 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
      
http://bugs.kde.org/show_bug.cgi?id=72830      
hausmann at kde.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From hausmann at kde.org  2004-02-06 13:48 -------
Subject: qt-copy/src/widgets

CVS commit by hausmann: 

- don't call text().length() twice, in QTextEdit::createPopupMenu. It's
  terribly inefficient to do that when the content is large and gets
  converted to html. Instead now length() gets called instead, and only
  once. Patch will be in next release.

CCMAIL: 72830-done at bugs.kde.org


  M +3 -6      qtextedit.cpp   1.44


--- qt-copy/src/widgets/qtextedit.cpp  #1.43:1.44
@@ -5479,10 +5479,7 @@ QPopupMenu *QTextEdit::createPopupMenu( 
     popup->setItemEnabled( d->id[ IdPaste ], !isReadOnly() && !QApplication::clipboard()->text( d->clipboard_mode ).isEmpty() );
 #endif
-    popup->setItemEnabled( d->id[ IdClear ], !isReadOnly() && !text().isEmpty() );
-#ifdef QT_TEXTEDIT_OPTIMIZATION
-    popup->setItemEnabled( d->id[ IdSelectAll ], d->optimMode ? d->od->len : (bool)text().length() );
-#else
-    popup->setItemEnabled( d->id[ IdSelectAll ], (bool)text().length() );
-#endif
+    const bool isEmptyDocument = (length() == 0);
+    popup->setItemEnabled( d->id[ IdClear ], !isReadOnly() && !isEmptyDocument );
+    popup->setItemEnabled( d->id[ IdSelectAll ], !isEmptyDocument );
     return popup;
 #else




More information about the KDevelop-devel mailing list