KMainWindow/KAboutData allows invalid names (was: QDBusConnection::registerObject: "Invalid object path given" - help?)

Matthew Woehlke mw_triad at
Mon Aug 10 21:08:02 BST 2009

Thomas L├╝bking wrote:
> Am Monday 10 August 2009 schrieb Matthew Woehlke:
>> So... what? I can't use '-' in the name of a program? Or what do I need
>> to change so that I can use '-' everywhere *except* the dbus path?
> actually it appears that kmainwindow.cpp #367ff should handle that for you
> maybe QChar::isLetterOrNumber() interprets "-" as number
> -> should be:
> if (!(pathname[i].isLetter() || pathname[i].isDigit())

Yup, that looks like a bug. Want to fix it, or shall I?

However, it's not the problem I am having, though you pointed me in the 
right direction. Apparently KAboutData::appName must be a valid 
identifier (regex "([:letter:]|[:digit:]|_)+"). This is neither 
documented (not in KAboutData, anyway) nor enforced (until it hits the 
assert registering with dbus), nor is there sanitizing being done on it 
in KAboutData, unlike KMainWindow.

Is the above restriction supposed to exist? If not, KMainWindow needs to 
sanitize also the appName when building the dbus path. Else IMO the API 
doc for KAboutName should at least mention this restriction, if not 
enforce it in at least the KApplication ctor, if not KAboutData (or both).

I guess appName never shows up anywhere visible to the user?

Please do not quote my e-mail address unobfuscated in message bodies.
Never give up on learning

>> Visit to unsubscribe <<

More information about the kde-core-devel mailing list