diff --git a/src/gui/kbbind.cpp b/src/gui/kbbind.cpp index 36e91d13..9f07ccf0 100644 --- a/src/gui/kbbind.cpp +++ b/src/gui/kbbind.cpp @@ -239,8 +239,14 @@ void KbBind::update(QFile& cmd, int notify, bool force){ cmd.write(keyLatin1); // if a macro definiton for the key is given, // add the converted string to key-buffer "macro" - if (act->isMacro() && act->macroContent().length() > 0) { - macros.append("macro " + keyLatin1 + ":" + act->macroContent().toLatin1() + "\n"); + if (act->isMacro()) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + QList macroContent = QStringView(act->value()).split(':'); +#else // QT_VERSION < 6.0.0 + QVector macroContent = act->value().splitRef(':'); +#endif + if (macroContent[1].length() > 0) + macros.append("macro " + keyLatin1 + ":" + macroContent[1].toLatin1() + "\n"); } } else { // Otherwise, write the binding diff --git a/src/gui/keyaction.h b/src/gui/keyaction.h index e0181630..1e5ce8f2 100644 --- a/src/gui/keyaction.h +++ b/src/gui/keyaction.h @@ -31,11 +31,6 @@ public: // Name to send to driver (empty string for unbind) QString driverName() const; - // Returns the string that's passed to the daemon - inline QString macroContent() const { - return _value.split(":")[1]; - } - // Mode-switch action. // 0 for first mode, 1 for second, etc. Constants below for movement options const static int MODE_PREV = -2, MODE_NEXT = -1;