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

List:       kde-devel
Subject:    [Fwd: It's necessary to add a QCoreApplication to kdeinit4]
From:       <wppan () redflag-linux ! com>
Date:       2008-10-14 2:10:26
Message-ID: 48F3FF92.5090708 () redflag-linux ! com
[Download RAW message or body]

["It's necessary to add a QCoreApplication to kdeinit4.eml" (message/rfc822)]

X-Mozilla-Keys: 
Message-ID: <48F3FDE4.7000702@redflag-linux.com>
Date: Tue, 14 Oct 2008 10:03:16 +0800
From: =?GB2312?B?xcvOwMa9?= <wppan@redflag-linux.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080829)
MIME-Version: 1.0
To: kde-core-devel@kde.org
Subject: It's necessary to add a QCoreApplication to kdeinit4
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: 8bit

Hi all,
I made two experiments:
the first program is:
#include <QCoreApplication>
#include <QFile>
#include <stdio.h>
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
printf("%s\n", QFile::encodeName(QString::fromUtf8("/home/ΕΛ")).data());
return 0;
}
the output is:
/home/ΕΛ

the second program is:
#include <QCoreApplication>
#include <QFile>
#include <stdio.h>
int main(int argc, char *argv[])
{
//QCoreApplication app(argc, argv);
printf("%s\n", QFile::encodeName(QString::fromUtf8("/home/ΕΛ")).data());
return 0;
}
the output is:
/home/

QFile::encodeName got wrong file name without a QCoreApplication object !
(my locale is zh_CN.UTF-8)

>From the error messages:
"
trying to create local folder /home/.kde: Permission denied
trying to create local folder /home/.kde: Permission denied
Link points to "/tmp/ksocket-ΕΛ"
trying to create local folder /home/.kde: Permission denied
kdeinit4: Aborting. bind() failed: : No such file or directory
Could not bind to socket
'/home/.kde/socket-localhost.localdomain/kdeinit4__0'
"
I find that maybe something is wrong when binding a socket.

kdelibs/kinit/kinit.cpp
main() function calls kdeinit_library_path() function.
1808 kdeinit_library_path();

and in kdeinit_library_path() function,
1562 QByteArray socketName =
QFile::encodeName(KStandardDirs::locateLocal("socket",
QString("kdeinit4_%1").a rg(QLatin1String(display)), *s_instance));

I think that's the reason why kdeinit4 binds the socket wrongly,
and we should add a QCoreAoolication to make QFile, QDir and other QT
class work in kdeinit4.

Best regards!

pwp



>> 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