diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-03-12 22:33:15 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-03-12 22:33:15 +1100 |
| commit | fe5195ca2e51df5d8e26f46ef212a8b755ee854c (patch) | |
| tree | b169744c699fb3c15a11aa6c08545a8c63ae865d /plugin | |
| parent | brightness: use map lookup for DDC monitor matching (diff) | |
| download | caelestia-shell-fe5195ca2e51df5d8e26f46ef212a8b755ee854c.tar.gz caelestia-shell-fe5195ca2e51df5d8e26f46ef212a8b755ee854c.tar.bz2 caelestia-shell-fe5195ca2e51df5d8e26f46ef212a8b755ee854c.zip | |
hyprextras: avoid arg() overhead in applyOptions string building
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/src/Caelestia/Internal/hyprextras.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugin/src/Caelestia/Internal/hyprextras.cpp b/plugin/src/Caelestia/Internal/hyprextras.cpp index 5308524..ab18d2f 100644 --- a/plugin/src/Caelestia/Internal/hyprextras.cpp +++ b/plugin/src/Caelestia/Internal/hyprextras.cpp @@ -84,9 +84,11 @@ void HyprExtras::applyOptions(const QVariantHash& options) { return; } - QString request = "[[BATCH]]"; + QString request; + request.reserve(12 + options.size() * 40); + request += QLatin1String("[[BATCH]]"); for (auto it = options.constBegin(); it != options.constEnd(); ++it) { - request += QString("keyword %1 %2;").arg(it.key(), it.value().toString()); + request += QLatin1String("keyword ") + it.key() + QLatin1Char(' ') + it.value().toString() + QLatin1Char(';'); } makeRequest(request, [this](bool success, const QByteArray& res) { |