Advance Wayland and KDE package bring-up

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-14 10:51:06 +01:00
parent 51f3c21121
commit cf12defd28
15214 changed files with 20594243 additions and 269 deletions
@@ -0,0 +1,52 @@
/*
SPDX-FileCopyrightText: 2017 Alexander Potashev <aspotashev@gmail.com>
SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "ktoolbarhelper_p.h"
#include <QList>
#include <KLocalizedString>
namespace KToolbarHelper
{
QString i18nToolBarName(const QDomElement &element)
{
QDomElement textElement;
bool textElementFound = false;
const QList<QString> textKeys = {QStringLiteral("text"), QStringLiteral("Text")};
for (const QString &key : textKeys) {
QDomNode textNode = element.namedItem(key);
if (textNode.isElement()) {
textElement = textNode.toElement();
textElementFound = true;
break;
}
}
if (!textElementFound) {
return element.attribute(QStringLiteral("name"));
}
QByteArray domain = textElement.attribute(QStringLiteral("translationDomain")).toUtf8();
QByteArray text = textElement.text().toUtf8();
QByteArray context = textElement.attribute(QStringLiteral("context")).toUtf8();
if (domain.isEmpty()) {
domain = element.ownerDocument().documentElement().attribute(QStringLiteral("translationDomain")).toUtf8();
if (domain.isEmpty()) {
domain = KLocalizedString::applicationDomain();
}
}
QString i18nText;
if (!text.isEmpty() && !context.isEmpty()) {
i18nText = i18ndc(domain.constData(), context.constData(), text.constData());
} else if (!text.isEmpty()) {
i18nText = i18nd(domain.constData(), text.constData());
}
return i18nText;
}
} // namespace KToolbarHelper