kdecore: convert the QString to QByteArray only once in KGlobalPrivate::initFakeComponent()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-12-11 09:40:37 +02:00
parent 65164ccd12
commit 39f0466cac

View file

@ -84,11 +84,11 @@ class KGlobalPrivate
*/
static KComponentData initFakeComponent()
{
QString name = QCoreApplication::applicationName();
if(name.isEmpty())
name = QString::fromLatin1("kde");
return KComponentData(name.toLatin1(), name.toLatin1(),
KComponentData::SkipMainComponentRegistration);
QByteArray name = QCoreApplication::applicationName().toLatin1();
if (name.isEmpty()) {
name = "kde";
}
return KComponentData(name, name, KComponentData::SkipMainComponentRegistration);
}
};