[rkward-cvs] SF.net SVN: rkward:[2912] trunk/rkward/rkward/misc/rkprogresscontrol.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Jun 29 10:28:24 UTC 2010


Revision: 2912
          http://rkward.svn.sourceforge.net/rkward/?rev=2912&view=rev
Author:   tfry
Date:     2010-06-29 10:28:23 +0000 (Tue, 29 Jun 2010)

Log Message:
-----------
Fix infinite (timed) recursion issue in RKProgressControl (this would lead to 100% CPU usage in some cases).

Modified Paths:
--------------
    trunk/rkward/rkward/misc/rkprogresscontrol.cpp

Modified: trunk/rkward/rkward/misc/rkprogresscontrol.cpp
===================================================================
--- trunk/rkward/rkward/misc/rkprogresscontrol.cpp	2010-06-29 09:55:51 UTC (rev 2911)
+++ trunk/rkward/rkward/misc/rkprogresscontrol.cpp	2010-06-29 10:28:23 UTC (rev 2912)
@@ -2,7 +2,7 @@
                           rkprogresscontol  -  description
                              -------------------
     begin                : Sun Sep 10 2006
-    copyright            : (C) 2006, 2007, 2008, 2009 by Thomas Friedrichsmeier
+    copyright            : (C) 2006, 2007, 2008, 2009, 2010 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -237,7 +237,8 @@
 		output_box->setStretchFactor (output_text, 10);
 	}
 	setDetailsWidget (output_box);
-	connect (this, SIGNAL(aboutToShowDetails()), this, SLOT(scrollDown()));
+	// it's important to use a queued connection, here. Otherwise, if the details widget gets shown due to error output, scrollDown() would only scroll to the position directly *above* the new output.
+	connect (this, SIGNAL(aboutToShowDetails()), this, SLOT(scrollDown()), Qt::QueuedConnection);
 
 	KDialog::ButtonCodes button_codes = KDialog::Cancel;
 	if (mode_flags & RKProgressControl::OutputSwitchable) button_codes |= KDialog::Details;
@@ -287,9 +288,6 @@
 void RKProgressControlDialog::scrollDown () {
 	RK_TRACE (MISC);
 
-	// oh what an ugly hack... (to cope with changing slider position just when the details widget becomes visible
-	if (!output_text->isVisible ()) QTimer::singleShot (0, this, SLOT(scrollDown()));
-
 	QScrollBar *bar = output_text->verticalScrollBar ();
 	if (bar) bar->setValue (bar->maximum ());
 }


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