[rkward-cvs] SF.net SVN: rkward: [2089] branches/KDE4_port

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Oct 18 15:02:13 UTC 2007


Revision: 2089
          http://rkward.svn.sourceforge.net/rkward/?rev=2089&view=rev
Author:   tfry
Date:     2007-10-18 08:02:13 -0700 (Thu, 18 Oct 2007)

Log Message:
-----------
Crash while removing lines in console was caused by katepart, fixed in kdelibs. Some cleanups to the code, however

Modified Paths:
--------------
    branches/KDE4_port/TODO_KDE4
    branches/KDE4_port/rkward/rkconsole.cpp
    branches/KDE4_port/rkward/windows/rkcommandlog.cpp

Modified: branches/KDE4_port/TODO_KDE4
===================================================================
--- branches/KDE4_port/TODO_KDE4	2007-10-17 21:48:54 UTC (rev 2088)
+++ branches/KDE4_port/TODO_KDE4	2007-10-18 15:02:13 UTC (rev 2089)
@@ -86,7 +86,6 @@
 	- check whether all selection, editing, navigating really works as expected
 	- is tab completion for file names still crashy?
 		- currently, problem seems to be inside KUrlCompletion
-	- crash when max number of lines reached
 
 rkhtmlwindow:
 	- when this is open, we always seem to crash on close

Modified: branches/KDE4_port/rkward/rkconsole.cpp
===================================================================
--- branches/KDE4_port/rkward/rkconsole.cpp	2007-10-17 21:48:54 UTC (rev 2088)
+++ branches/KDE4_port/rkward/rkconsole.cpp	2007-10-18 15:02:13 UTC (rev 2089)
@@ -613,10 +613,10 @@
 
 	if (RKSettingsModuleConsole::maxConsoleLines ()) {
 		uint c = (uint) doc->lines();
-// TODO: WORKAROUND: Somehow, when removing paragraph 0, the QTextEdit scrolls to the top in between (yes, this also happens when using removeParagaph (0)). Since this may happen very often in newOutput, we're a bit sloppy, and only remove lines after a certain threshold (20) is exceeded. When the command is finished, this will be cleaned up automatically.
+// We remove the superflous lines in chunks of 20 while handling output for better performance. Later, in tryNextInBatch(), we trim down to the correct size.
 		if (c > (RKSettingsModuleConsole::maxConsoleLines () + 20)) {
+// KDE4: does the setUpdatesEnabled (false) still affect performance?
 			view->setUpdatesEnabled (false);		// major performance boost while removing lines!
-			//TODO : deal with the case when there is already a selection
 			doc->removeText (KTextEditor::Range (0, 0, c - RKSettingsModuleConsole::maxConsoleLines (), 0));
 			view->setUpdatesEnabled (true);
 		}
@@ -637,12 +637,13 @@
 	RK_TRACE (APP);
 	if (add_new_line) {
 		if (RKSettingsModuleConsole::maxConsoleLines ()) {
-			uint c = (uint) doc->lines();
-			setUpdatesEnabled (false);
-			for (uint ui = c; ui > RKSettingsModuleConsole::maxConsoleLines (); --ui) {
-				doc->removeLine (0);
+			int c = doc->lines();
+			if (c > RKSettingsModuleConsole::maxConsoleLines ()) {
+				// KDE4 TODO: setUpdatesEnabled(false) still faster?
+				view->setUpdatesEnabled (false);
+				doc->removeText (KTextEditor::Range (0, 0, c - RKSettingsModuleConsole::maxConsoleLines (), 0));
+				view->setUpdatesEnabled (true);
 			}
-			setUpdatesEnabled (true);
 		}
 		if (!doc->lines ()) doc->insertLine (0, QString ());
 		doc->insertText (KTextEditor::Cursor (doc->lines () - 1, 0), prefix);

Modified: branches/KDE4_port/rkward/windows/rkcommandlog.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkcommandlog.cpp	2007-10-17 21:48:54 UTC (rev 2088)
+++ branches/KDE4_port/rkward/windows/rkcommandlog.cpp	2007-10-18 15:02:13 UTC (rev 2089)
@@ -63,7 +63,6 @@
 	initializeActivationSignals ();
 	setFocusPolicy (Qt::ClickFocus);
 
-// KDE4 TODO
 	connect (RKSettings::tracker (), SIGNAL (maxCommandLogLinesChanged()), this, SLOT (maxCommandLogLinesChanged()));
 	maxCommandLogLinesChanged ();
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list