--Boundary-00=_6fz09zflEUeoLCP Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, The following patch does two things: - Removed unnecessary variable whose associated code was removed recently. This is an internal variable and hence is safe from BIC. - Fix the problem of the line widget not being properly updated when ::setReadOnly is called. To see the effect, compile the unit test and toggle and untoggle the Read Only button. Regards, Dawit A. --Boundary-00=_6fz09zflEUeoLCP Content-Type: text/x-diff; charset="us-ascii"; name="klineedit.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="klineedit.diff" Index: klineedit.cpp =================================================================== RCS file: /home/kde/kdelibs/kdeui/klineedit.cpp,v retrieving revision 1.151 diff -u -p -b -B -w -r1.151 klineedit.cpp --- klineedit.cpp 2002/10/18 12:12:31 1.151 +++ klineedit.cpp 2002/11/14 05:37:09 @@ -49,7 +49,6 @@ public: { completionBox = 0L; handleURLDrops = true; - smartTextUpdate = false; grabReturnKeyEvents = false; } ~KLineEditPrivate() @@ -60,7 +59,6 @@ public: int squeezedEnd; int squeezedStart; bool handleURLDrops; - bool smartTextUpdate; bool grabReturnKeyEvents; QString squeezedText; @@ -178,27 +176,33 @@ void KLineEdit::makeCompletion( const QS void KLineEdit::setReadOnly(bool readOnly) { - QPalette p = palette(); + // Do not do anything if read only does not + // require state change... + if (readOnly == isReadOnly ()) + return; + + QLineEdit::setReadOnly (readOnly); + if (readOnly) { + setSqueezedText ( text() ); + + QPalette p = palette(); QColor color = p.color(QPalette::Disabled, QColorGroup::Background); p.setColor(QColorGroup::Base, color); p.setColor(QColorGroup::Background, color); + setPalette(p); } else { - QColor color = p.color(QPalette::Normal, QColorGroup::Base); - p.setColor(QColorGroup::Base, color); - p.setColor(QColorGroup::Background, color); if (!d->squeezedText.isEmpty()) { setText(d->squeezedText); d->squeezedText = QString::null; } - } - setPalette(p); - QLineEdit::setReadOnly (readOnly); + unsetPalette (); + } } void KLineEdit::setSqueezedText( const QString &text) --Boundary-00=_6fz09zflEUeoLCP--