Author: tgoettlicher Date: Thu Apr 21 11:07:30 2011 New Revision: 63846 URL: http://svn.opensuse.org/viewcvs/yast?rev=63846&view=rev Log: - Cleaned-up fix for line breaks in LogView (bnc #684759) Modified: trunk/qt/package/yast2-qt.changes trunk/qt/src/YQLogView.cc Modified: trunk/qt/package/yast2-qt.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/package/yast2-qt.changes?rev=63846&r1=63845&r2=63846&view=diff ============================================================================== --- trunk/qt/package/yast2-qt.changes (original) +++ trunk/qt/package/yast2-qt.changes Thu Apr 21 11:07:30 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Apr 21 11:05:49 CEST 2011 - tgoettlicher@suse.de + +- Cleaned-up fix for line breaks in LogView (bnc #684759) +- V 2.21.2 + +------------------------------------------------------------------- Mon Apr 18 16:16:59 CEST 2011 - tgoettlicher@suse.de - Enable busy cursor for tree widget during time consuming Modified: trunk/qt/src/YQLogView.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQLogView.cc?rev=63846&r1=63845&r2=63846&view=diff ============================================================================== --- trunk/qt/src/YQLogView.cc (original) +++ trunk/qt/src/YQLogView.cc Thu Apr 21 11:07:30 2011 @@ -93,22 +93,32 @@ YQLogView::displayLogText( const string & text ) { QScrollBar *sb = _qt_text->verticalScrollBar(); - QString newString = fromUTF8( text ); - newString[ newString.length() ] = ' '; bool atEnd = sb->value() == sb->maximum(); - if (newString.startsWith(_lastText) && !_lastText.isEmpty() ) { - _qt_text->append(newString.mid(_lastText.length() + 1 )); - } else { + if (newString.startsWith(_lastText) && !_lastText.isEmpty() ) + { + int position = _lastText.length(); + + // prevent double line break caused by QTextEdit::append() + if ( newString.mid( _lastText.length(), 1 ) == QString('\n') ) + position++; + + _qt_text->append( newString.mid( position) ); + } + else + { _qt_text->setPlainText( newString ); } - if (atEnd) { + + if (atEnd) + { _qt_text->moveCursor( QTextCursor::End ); _qt_text->ensureCursorVisible(); } + _lastText = newString; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org