On Fri, Oct 10, 2014 at 09:26:11PM -0300, Tomaz Canabrava wrote: > On Fri, Oct 10, 2014 at 6:35 AM, Milian Wolff <[email protected]> wrote: > <snip> > > It's too error prone regarding typos.
This is easily solved by using constants instead of string literals.
const QLatin1String SettingsGroup("blah");
const QLatin1String WidthKey("width");
KConfig c;
KConfigGroup g = c.group(SettingsGroup);
g.setValue(WidthKey, 10);
// otherfile
Kconfig c;
KConfigGroup g = c.group(SettingsGroup);
g.value(WidthKey);
How do you intend to fix string literal typos? IMHO compile-time checks are
better than run-time checks in these cases.
Cheers,
Rafael
--
Rafael Roquetto | [email protected] | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
