[patch] Two higher-level checks for invalid KProcess initialization

Oswald Buddenhagen ossi at kde.org
Thu Dec 6 22:08:34 GMT 2007


On Thu, Dec 06, 2007 at 10:56:26PM +0100, Jaroslaw Staniek wrote:
> 1. assertion for empty arg list in KProcess::setProgram(QStringList), where 
> the at least the 0th argument should be present -- this gives developers 
> more meaningful assetion than the current one at QList::takeFirst() level).
>
+1

> 2. warning and failure is signalled within krun's runTempService() function 
> when no args are extracted for the process.
>
> --- krun.cpp    (revision 745716)
> +++ krun.cpp    (working copy)
> @@ -634,6 +634,11 @@
> +
> +  if (args.isEmpty()) {
> +      kWarning(7010) << "runTempService: KProcess no args!";
> +      return false;
> +  }
>    kDebug(7010) << "runTempService: KProcess args=" << args;
>
i tend to using a q_assert here as well. other places dealing with
bogus .desktop files seem to do so as well.
the alternative would be a proper messagebox.
david?

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Confusion, chaos, panic - my work here is done.




More information about the kde-core-devel mailing list