[PATCH] RFC: Changing the language of individual KDE programs
Krzysztof Lichota
krzysiek at lichota.net
Wed Mar 28 18:14:32 BST 2007
David Faure napisaĆ(a):
>>> OK I think the Qt3 way would be to just have a QMap in the dialog
>>> that associates the button with whatever it needs to be associated
>>> with. Then you don't need this void* usage and this extra class
>>> [which even pollutes the header that you want to make public :)]. I
>>> strongly recomment a QMap<QPushButton*, SomeStruct> to avoid the
>>> new/deletes and risks of memleaks.
>> Mapping from pushbutton to struct is only part of the problem. The other
>> part is how to identify which button was pushed? clicked() signal does
>> not carry this information.
>
> Calling sender() from the slot. (if the slot is only called by a signal, never directly!)
Here is the patch with all your comments incorporated :)
KPushButtonWithData is removed, protected members (apart from slots) are
moved to private data using d-pointer.
OK to commit?
Krzysztof Lichota
-------------- next part --------------
A non-text attachment was scrubbed...
Name: switch-app-language3.diff
Type: text/x-patch
Size: 21652 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070328/1c7544c1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070328/1c7544c1/attachment.sig>
More information about the kde-core-devel
mailing list