[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: PATCH: KonqRun::askSave and URLs containing '%'
From:       David Faure <david () mandrakesoft ! com>
Date:       2001-08-29 20:35:46
[Download RAW message or body]

On Jeudi 30 Août 2001 01:01, Maarten ter Huurne wrote:
> On Wednesday 29 August 2001 19:20, David Faure wrote:
> 
> > Looks good to me, except for the "if the arg is null then %n remains"
> > specification. Shouldn't null give an empty substitution ? Or "(null)"
> > maybe. But a %n in a message to be read by the user is going to look very
> > ugly.
> 
> It is my intention that it will look ugly to the user, because null strings 
> are probably bugs. If they are easy to spot, there is a better chance they 
> get fixed.
> 
> Because the default arguments are null when not specified, it seemed like a 
> logical choice to keep the "%n". So if you specify 3 arguments, "%4" and 
> above will not be substituted and will remind you that you passed too little 
> arguments.

Provided that the developers tests e.g. the dialog box. Of course he should,
but sometimes (rare error messages, for instance), this isn't the case.
Or something that happens very rarely (depending on the input data).
You can't rely on all cases being tested before hand, some happen "live" ;-)
I think (null) is a better solution.

> > Note: your switch() lacks a "default:" case.
> 
> Is that dangerous or just unconventional?

The latter - some compilers warn about it.

> If none of the cases match, argn should still be pointing to QString::null 
> which it was initialised to, causing no substitution to take place and the 
> '%' being added to the output instead.
Then "default: break;" is simply missing, to keep compilers happy.

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://perso.mandrakesoft.com/~david/ , http://www.konqueror.org/
KDE, Making The Future of Computing Available Today

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic