[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    KMainWindow/KAboutData allows invalid names (was:
From:       Matthew Woehlke <mw_triad () users ! sourceforge ! net>
Date:       2009-08-10 20:08:02
Message-ID: h5pun3$gp2$1 () ger ! gmane ! org
[Download RAW message or body]

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?

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

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic