[PATCH] BUG 172567 support non ASCII user name to login in

Thiago Macieira thiago at kde.org
Tue Oct 14 12:53:35 BST 2008


David Faure wrote:
>On Monday 13 October 2008, Thiago Macieira wrote:
>> David Faure wrote:
>> >Hmm, but creating a QCoreApplication in kdeinit is a bad idea, since
>> > kdeinit forks+dlopens kdeinit modules (and kioslaves), which will
>> > then end up with two Q[Core]Applications...
>> >
>> >Is there a way to initialize fromLocal8Bit/toLocal8Bit without a
>> > QCoreApplication?
>>
>> Yes:
>> 	setlocale(LC_ALL, "");
>
>... is already done in kinit.cpp, so I'm still confused by all this
>(it's done too late maybe?)

Could be, I don't know. I'd have to debug into Qt code to find out why the 
local 8 bit codec isn't working. It uses iconv for that.

>> But there's no guarantee that something else won't break in the
>> future. Qt is not supported without QCoreApplication. QFile, for
>> instance.
>>
>> When I looked at the code, I thought it was klauncher (the second
>> phase, the one that actually uses Qt). I hadn't realised that kdeinit4
>> itself used Qt code.
>
>kdeinit4 has to look for stuff (libs, executables, etc.); for that it
> uses KStandardDirs and QFile::encodeName/decodeName; hopefully this
> doesn't really count as "QFile" usage ;). There's a call to
> QFont::initialize but that's actually a performance optimization (doing
> it only once for all kde apps).

QFile::encodeName is exactly the encoding issue...

You can do this:
	{
		QCoreApplication app(argc, argv);
	}

That will create and destroy the application. It should be enough to 
initialise Qt.

We can also think of providing a static method like the QFont one you 
mentioned.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081014/4757946f/attachment.sig>


More information about the kde-core-devel mailing list