mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 10:22:49 +00:00
kde-menu: keep references to QByteArray objects
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
8a4df31980
commit
1f8c7b9f4d
1 changed files with 10 additions and 8 deletions
|
@ -39,18 +39,21 @@ static bool utf8 = false;
|
||||||
static bool bPrintMenuId = false;
|
static bool bPrintMenuId = false;
|
||||||
static bool bPrintMenuName = false;
|
static bool bPrintMenuName = false;
|
||||||
|
|
||||||
|
static QByteArray convert(const QString &txt)
|
||||||
|
{
|
||||||
|
return (utf8 ? txt.toUtf8() : txt.toLocal8Bit());
|
||||||
|
}
|
||||||
|
|
||||||
static void result(const QString &txt)
|
static void result(const QString &txt)
|
||||||
{
|
{
|
||||||
if (utf8) {
|
const QByteArray txtbytes = convert(txt);
|
||||||
puts(txt.toUtf8());
|
puts(txtbytes.constData());
|
||||||
} else {
|
|
||||||
puts(txt.toLocal8Bit());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void error(int exitCode, const QString &txt)
|
static void error(int exitCode, const QString &txt)
|
||||||
{
|
{
|
||||||
qWarning("kde-menu: %s", txt.toLocal8Bit().data());
|
const QByteArray txtbytes = convert(txt);
|
||||||
|
qWarning("kde-menu: %s", txtbytes.constData());
|
||||||
exit(exitCode);
|
exit(exitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +83,6 @@ static void findMenuEntry(KServiceGroup::Ptr parent, const QString &name, const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char *description = I18N_NOOP(
|
const char *description = I18N_NOOP(
|
||||||
|
|
Loading…
Add table
Reference in a new issue