about restricted packages recommendation patches
Harald Sitter
apachelogger at ubuntu.com
Mon Sep 28 10:24:32 BST 2009
Ahoy
yesterday I made Konqueror recommend flash to be installed (via the
common update-notifier-kde dbus call).
First I looked at the patch one thing hit me like lightning however.
It appears that in all implementations done before the application
name was hard coded in the patch. Why that is bad you ask? Because the
application name as seen in the desktop file _AND_ in the KAboutData
object, is, really, like completely, translatable. Meaning Konqueror
might not be called Konqueror in mandarin. This is probably a very
border line case (though I am not speaking all languages supported by
KDE and thus can't judge about this, plus no one can tell if there
might not appear a translated app name in 4.4...), yet we have to
resolve this issue and be it just to prevent issues from arising due
to this hard coding.
As a matter of fact the code change is considerable simple.
In case of Konqueror the following line
+ dbusargs.append(QLatin1String("Konqueror"));
becomes
+ dbusargs.append(KonqFactory::aboutData()->programName());
Konqueror is a bit of a special case because the aboutData object is
part of KonqFactory. For most other apps (I am quite sure about this
for Kaffeine) you would implement the dbus call somewhere near the
KAboutData object (usually to be found in main.cpp), thus you can
access the object directly
+ dbusargs.append(aboutData()->programName());
Described in an app independent name: query the programName from the
KAboutData object (unique to each KApplication). For Qt-only apps,
such as Arora, hard coding can probably remain (unless you find some
global name defintion somewhere, then this defintion should probably
be preferred).
So everyone please jump at the patched apps and refine the patches (I
suppose only Kaffeine and Amarok are patched, though I am not exactly
sure about that?).
General remark: since the programName is not bound to be latin, and
conversion to latin would make the translatedness quite pointless, the
QString returned from programName() is not converted but sent as it
is, on a default karmic system that does work out fine, if anyone
thinks that it could cause problems I am all for doing a conversion to
something. :)
regards,
Harald
More information about the kubuntu-devel
mailing list