very uncool KJSDebugDialog bug

Ian Reinhart Geiser ian at
Tue Aug 10 14:42:24 BST 2004

On Tuesday 10 August 2004 04:43 am, David Faure wrote:
> On Tuesday 10 August 2004 08:34, Ian Reinhart Geiser wrote:
> > I have been trying to fix the bug where konqi dialogs span 3 or 4
> > screens, and found the actual evil cause.  In KJSDebugWin i found this
> > nugget: QString msg = i18n("An error occurred while attempting to run a
> > script on this page.\n\n%1 line %2:\n%3")
> >                   .arg(sourceFragment->sourceFile->url)
> >                   .arg(sourceFragment->baseLine+ctx.curStmtFirstLine()-1)
> >                   .arg(exceptionMsg);
> > Now whats evil is if the URL line has a %2 or %3 in it, we get dialog
> > boxes that are pretty impressive in size.
> I don't see how the presence of %2 in the URL makes the result any bigger
> (only more wrong), but it's easily fixed with a multi-arg syntax, like
 The %3 is the real killer. Try adding "TypeError: Attempted to access 
'document' property on undefined object (result of expression 
objWin.document)" in the middle of an already long url. ;)   In an ideal 
world all of these are on seperate lines, and the \n's make it all pretty 

>      QString msg = i18n("An error occurred while attempting to run a script
> on this page.\n\n%1 line %2:\n%3")
>                    .arg(sourceFragment->sourceFile->url,
> QString::number(sourceFragment->baseLine+ctx.curStmtFirstLine()-1)),
> exceptionMsg);
Im not sure I follow what the QString::number changes?  Could you please 
explain that a bit more? 

> >
> See, the main problem is the length of the URL itself, independently from
> the %foo mess. Use KStringHandler::rsqueeze(
> sourceFragment->sourceFile->url, 80 ), as usual.
Im inclined to disagree that its the main problem, since if the error message 
is embedded in the URL the sqeeze (what brought me to the conclusion that the 
real error was the message in the url) will hide the actual error message.  
If the error message is outside the url though that might fix the reimaining 
issues with the dialog though.

> > So my question: How could this be effectively solved w/o a string change,
> > or at least a minor one.  This is in about 3 places that i can see, and
> > im not happy with leaving a bug in just because we noticed it this late
> > in the game.
> This bug can be in 3.3 - nobody enables KJSDebugWin :) There will be worse
> things in 3.3, don't worry about that :)
Regardless, I see no reason why not to fix it, if there is an easy fix.

	-ian reinhart geiser
------(Ian Reinhart Geiser)-----<geiseri at>-----
And I ain't gonna laugh, and I ain't gonna play I wish I could be a thousand 
miles away! And the words are all my business Im gonna be the man who sat 
-Jazz Butcher, Nothing Special

More information about the kde-core-devel mailing list