diff --git a/decorations/decorationbridge.cpp b/decorations/decorationbridge.cpp index fbff6787ed..ba41d6a6c7 100644 --- a/decorations/decorationbridge.cpp +++ b/decorations/decorationbridge.cpp @@ -38,6 +38,7 @@ along with this program. If not, see . // Qt #include +#include #include namespace KWin @@ -202,6 +203,41 @@ KDecoration2::Decoration *DecorationBridge::createDecoration(Client *client) return deco; } +static +QString settingsProperty(const QVariant &variant) +{ + if (QLatin1String(variant.typeName()) == QLatin1String("KDecoration2::BorderSize")) { + return QString::number(variant.toInt()); + } else if (QLatin1String(variant.typeName()) == QLatin1String("QVector")) { + const auto &b = variant.value>(); + QString buffer; + for (auto it = b.begin(); it != b.end(); ++it) { + if (it != b.begin()) { + buffer.append(QStringLiteral(", ")); + } + buffer.append(QString::number(int(*it))); + } + return buffer; + } + return variant.toString(); +} + +QString DecorationBridge::supportInformation() const +{ + QString b; + b.append(QStringLiteral("Plugin: %1\n").arg(m_plugin)); + b.append(QStringLiteral("Theme: %1\n").arg(m_theme)); + b.append(QStringLiteral("Blur: %1\n").arg(m_blur)); + const QMetaObject *metaOptions = m_settings->metaObject(); + for (int i=0; ipropertyCount(); ++i) { + const QMetaProperty property = metaOptions->property(i); + if (QLatin1String(property.name()) == QLatin1String("objectName")) { + continue; + } + b.append(QStringLiteral("%1: %2\n").arg(property.name()).arg(settingsProperty(m_settings->property(property.name())))); + } + return b; +} } // Decoration } // KWin diff --git a/decorations/decorationbridge.h b/decorations/decorationbridge.h index 76bd471e15..6c78e9088c 100644 --- a/decorations/decorationbridge.h +++ b/decorations/decorationbridge.h @@ -65,6 +65,8 @@ public: return m_settings; } + QString supportInformation() const; + private: void loadMetaData(const QJsonObject &object); void findTheme(const QVariantMap &map); diff --git a/workspace.cpp b/workspace.cpp index 8f572d7681..01cd784755 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1342,6 +1342,12 @@ QString Workspace::supportInformation() const break; } support.append(QStringLiteral("\n\n")); + if (auto bridge = Decoration::DecorationBridge::self()) { + support.append(QStringLiteral("Decoration\n")); + support.append(QStringLiteral("==========\n")); + support.append(bridge->supportInformation()); + support.append(QStringLiteral("\n")); + } support.append(QStringLiteral("Options\n")); support.append(QStringLiteral("=======\n")); const QMetaObject *metaOptions = options->metaObject();