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@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