aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/fakevim
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fakevim')
-rw-r--r--src/plugins/fakevim/fakevimactions.cpp8
-rw-r--r--src/plugins/fakevim/fakevimactions.h10
-rw-r--r--src/plugins/fakevim/fakevimhandler.cpp8
3 files changed, 12 insertions, 14 deletions
diff --git a/src/plugins/fakevim/fakevimactions.cpp b/src/plugins/fakevim/fakevimactions.cpp
index 7440257eead..b4d568c7f07 100644
--- a/src/plugins/fakevim/fakevimactions.cpp
+++ b/src/plugins/fakevim/fakevimactions.cpp
@@ -244,7 +244,7 @@ FakeVimSettings::FakeVimSettings()
FakeVimSettings::~FakeVimSettings() = default;
-FvBaseAspect *FakeVimSettings::item(const Key &name)
+FvBaseAspect *FakeVimSettings::item(const Utils::Key &name)
{
return m_nameToAspect.value(name, nullptr);
}
@@ -265,8 +265,8 @@ QString FakeVimSettings::trySetValue(const QString &name, const QString &value)
void FakeVimSettings::setup(FvBaseAspect *aspect,
const QVariant &value,
- const Key &settingsKey,
- const Key &shortName,
+ const Utils::Key &settingsKey,
+ const Utils::Key &shortName,
const QString &labelText)
{
aspect->setSettingsKey("FakeVim", settingsKey);
@@ -282,7 +282,7 @@ void FakeVimSettings::setup(FvBaseAspect *aspect,
Q_UNUSED(labelText)
#endif
- const Key longName = settingsKey.toLower();
+ const Key longName = settingsKey.toByteArray().toLower();
if (!longName.isEmpty()) {
m_nameToAspect[longName] = aspect;
m_aspectToName[aspect] = longName;
diff --git a/src/plugins/fakevim/fakevimactions.h b/src/plugins/fakevim/fakevimactions.h
index ac4256eca02..1ad91bb968c 100644
--- a/src/plugins/fakevim/fakevimactions.h
+++ b/src/plugins/fakevim/fakevimactions.h
@@ -25,8 +25,6 @@ namespace FakeVim::Internal {
#ifdef FAKEVIM_STANDALONE
-using Key = QByteArray;
-
class FvBaseAspect
{
public:
@@ -37,15 +35,15 @@ public:
virtual void setDefaultVariantValue(const QVariant &) {}
virtual QVariant variantValue() const { return {}; }
virtual QVariant defaultVariantValue() const { return {}; }
- void setSettingsKey(const Key &group, const Key &key);
- Key settingsKey() const;
+ void setSettingsKey(const Utils::Key &group, const Utils::Key &key);
+ Utils::Key settingsKey() const;
void setCheckable(bool) {}
void setDisplayName(const QString &) {}
void setToolTip(const QString &) {}
private:
- Key m_settingsGroup;
- Key m_settingsKey;
+ Utils::Key m_settingsGroup;
+ Utils::Key m_settingsKey;
};
template <class ValueType>
diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp
index 4a5d8e0415b..a1bee53b6ad 100644
--- a/src/plugins/fakevim/fakevimhandler.cpp
+++ b/src/plugins/fakevim/fakevimhandler.cpp
@@ -6125,7 +6125,7 @@ bool FakeVimHandler::Private::handleExSetCommand(const ExCommand &cmd)
if (!error.isEmpty())
showMessage(MessageError, error);
} else {
- Utils::Key optionName = Utils::keyFromString(cmd.args);
+ QString optionName = cmd.args;
bool toggleOption = optionName.endsWith('!');
bool printOption = !toggleOption && optionName.endsWith('?');
@@ -6136,14 +6136,14 @@ bool FakeVimHandler::Private::handleExSetCommand(const ExCommand &cmd)
if (negateOption)
optionName.remove(0, 2);
- FvBaseAspect *act = s.item(optionName);
+ FvBaseAspect *act = s.item(Utils::keyFromString(optionName));
if (!act) {
showMessage(MessageError, Tr::tr("Unknown option:") + ' ' + cmd.args);
} else if (act->defaultVariantValue().type() == QVariant::Bool) {
bool oldValue = act->variantValue().toBool();
if (printOption) {
showMessage(MessageInfo, QLatin1String(oldValue ? "" : "no")
- + act->settingsKey().toLower());
+ + act->settingsKey().toByteArray().toLower());
} else if (toggleOption || negateOption == oldValue) {
act->setVariantValue(!oldValue);
}
@@ -6152,7 +6152,7 @@ bool FakeVimHandler::Private::handleExSetCommand(const ExCommand &cmd)
} else if (toggleOption) {
showMessage(MessageError, Tr::tr("Trailing characters:") + ' ' + cmd.args);
} else {
- showMessage(MessageInfo, act->settingsKey().toLower() + "="
+ showMessage(MessageInfo, act->settingsKey().toByteArray().toLower() + "="
+ act->variantValue().toString());
}
}