kde-core-devel@kde.org
[Top] [All Lists]

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

Subject: Re: [PATCH] RFC: Changing the language of individual KDE programs
From: David Faure
Date: Wed, 28 Mar 2007 10:26:39 +0200
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@xxxxxxx, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

<Prev in Thread] Current Thread [Next in Thread>