mirror of
https://github.com/ckb-next/ckb-next.git
synced 2026-10-10 12:27:21 -04:00
gui: keyaction, kbbind - Resolve macro content retrieval in KbBind::update()
This makes it easier to append the repetition delay.
This commit is contained in:
+8
-2
@@ -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<QStringView> macroContent = QStringView(act->value()).split(':');
|
||||
#else // QT_VERSION < 6.0.0
|
||||
QVector<QStringRef> macroContent = act->value().splitRef(':');
|
||||
#endif
|
||||
if (macroContent[1].length() > 0)
|
||||
macros.append("macro " + keyLatin1 + ":" + macroContent[1].toLatin1() + "\n");
|
||||
}
|
||||
} else {
|
||||
// Otherwise, write the binding
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user