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

David Faure faure at kde.org
Wed Mar 28 09:26:39 BST 2007


On Saturday 24 March 2007, Krzysztof Lichota wrote:
> I have implemented "Remove" buttons, moved implementation into separate
> files (switchapplang.{cpp,h}) and fixed some minor issues. 
Please name the files after the classname, without contractions.
kswitchapplicationlanguagedialog.cpp is a bit long, but you chose the classname, not me :-)
Maybe the application can be removed (from both the classname and the filename).

> I have added KPushButtonWithData class, I could not find any other way
> of tying remove push button to label and language button. Maybe it could
> be done better? Any ideas?
Please use QVariant instead of dangerous void*.

Oh, this is Qt3/kde3 code. I hope QVariant can contain the type of data you want to put into it then...

+    protected:
+        /**
+            Fills language button with names of languages for which given application has translation.
+        */
+        void fillApplicationLanguages(KLanguageButton *button);
+        
+        /**
+            Adds one button with language to widget.
+        */
+        void addLanguageButton(const QString & languageCode, bool primaryLanguage);
+        
+        /**
+            Returns list of languages chosen for application or default languages is they are not set.
+        */
+        QStringList applicationLanguageList();
+        
+        QPtrList<KLanguageButton> languageButtons;
+        QGridLayout *languagesLayout;
+        QWidget *page;
Make all of this private, use a d pointer.

Alternatively, don't export the class, and don't install its header - i.e. make it really private to kdeui.

-- 
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