Re: C++ exceptions
Vladimir Prus wrote:[color=blue]
>1. Add "try/catch" in each of 30 slots
>2. Introduce 30 new function and use heavy template magic, or macros, to
>call those 30 new function from slots with added try/catch.[/color]
Let me make it clear: exceptions are not to trasverse KDELibs and Qt code.=
If any of your 30 slots calls a function that may throw an exception, you=20
MUST catch it in the slot.
Allowing the exception to reach the Qt signal/slot mechanism is bound to=20
fail and, quite possibly, core dump.
>An ideal solution would be to have some base KException class, and a
> signal KApplication::onException(KException&) that I can connect to for
> error reporting. But implementing that would require lots of try/catch
> inside kdelibs, so I'm not sure that's workable.[/color]
I don't think exception handling in kdelibs code is something you can=20
expect realistically. For one thing, Qt 4 has been released and it does=20
not use exceptions. So KDE Library code will probably follow suit.
That's why KDE libraries are compiled with -fno-exceptions. And, as I said=
before, specific libraries and applications can turn exceptions back on,=20
if they so need it.
But let me repeat: all exceptions must be caught before KDELibs/Qt code is=
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
5. Swa he g=C3=A9anhwearf t=C3=B3 timbran, and hwonne he c=C3=B3m, l=C3=A1!=
Unix cw=C3=A6=C3=B0 "Hello,=20
World". =C7=BCfre =C7=BDghwilc w=C3=A6s gl=C3=A6d and seo woruld w=C3=A6s f=
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
-----END PGP SIGNATURE-----
Content-Type: text/plain; charset="us-ascii"
>> Visit [url]http://mail.kde.org/mailman/listinfo/kde-devel#unsub[/url] to unsubscribe <<[/color][/color]