KMainWindow/KAboutData allows invalid names

Matthew Woehlke mw_triad at users.sourceforge.net
Mon Aug 10 23:27:58 BST 2009


Thomas L├╝bking wrote:
> On the one hand i'd say to sanitize this only where necessary, but on the 
> other hand sanitizing QCoreApplication::applicationName() ensures that the app 
> will internally (if not hardcoded...) not mismatch when e.g. trying to export 
> or access this value for dbus usage.
> 
> So i'd (slightly) rather handle this in KAboutData (i think this has to be set 
> for the major and almost only used KApplication c'tor anyway) and drop the 
> check in KMainWindow - but feel quite out of pos to decide this ;-)

Well it would help to keep this on k-c-d, which I think is the proper 
place ;-).

Also.... you need to read the code more closely :-). The dbus path is 
two parts, one which appears to be the class name of the KMainWindow 
(which in my example is the boring "MainWindow_1"), which is sanitized, 
and one which ultimately comes from KAboutData::appName. Given that, I 
wonder if the sanitizing in KMainWindow is actually needed (I don't know 
how you'd get non-identifier characters in there in the first place, but 
since the code exists I have to assume it is possible). However, whether 
or not appData is a valid identifier is a separate issue.

So KMainWindow should probably be fixed regardless of what we do with 
appData; might as well get the ball rolling:
http://reviewboard.kde.org/r/1261/

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




More information about the kde-core-devel mailing list