[PATCH] RFC: Changing the language of individual KDE programs

David Faure faure at kde.org
Wed Mar 28 22:12:58 BST 2007


On Wednesday 28 March 2007, Krzysztof Lichota wrote:
> +#include <klanguagebutton.h>
> +#include <kpushbutton.h>
> +
> +class QGridLayout;
> +class KPushButtonWithData;

All this can be removed now.

> +        SwitchApplicationLanguage, ///< @since 3.5.7
Remove trailing comma.
> +      menuSwitchLanguage = 5,
Same here ;)

>  +    if (signalSender->inherits("KPushButton") == false)
Inherits is fragile, it breaks when classes get renamed (as happened with Qt4).
Please do
  const KPushButton *removeButton = ::qt_cast<const KPushButton*>(signalSender);
  if (!removeButton) {
    kdError...
    return;
  }
(Might need a const_cast here if find() doesn't work with the const pointer, not sure).

> +        KConfigGroupSaver saver(config, "Locale");
KConfigGroup was already in 3.x, no? Save time on the kde4 porting by doing
KConfigGroup group(config, "Locale");
group.writeEntry("Language", languageString);
config->sync();

With the above, the patch looks fine to me, please commit.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list