Commit 4042fa70 authored by hluk's avatar hluk Committed by hjk

FakeVim: Get rid of signed/unsigned compare compiler warning

Change-Id: I9647eb7a3679e6a1a545d8ed71d9c531e1691d25
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 8c6cb64d
......@@ -784,6 +784,12 @@ static const QMap<QString, int> &vimKeyNames()
return k;
}
bool isControlModifier(const Qt::KeyboardModifiers &mods)
{
static const int ctrl = HostOsInfo::controlModifier();
return (mods & ctrl) == ctrl;
}
Range::Range()
: beginPos(-1), endPos(-1), rangemode(RangeCharMode)
......@@ -938,12 +944,12 @@ public:
bool is(int c) const
{
return m_xkey == c && m_modifiers != HostOsInfo::controlModifier();
return m_xkey == c && !isControl();
}
bool isControl() const
{
return m_modifiers == HostOsInfo::controlModifier();
return isControlModifier(m_modifiers);
}
bool isControl(int c) const
......@@ -2215,7 +2221,7 @@ bool FakeVimHandler::Private::wantsOverride(QKeyEvent *ev)
}
// We are interested in overriding most Ctrl key combinations.
if (mods == HostOsInfo::controlModifier()
if (isControlModifier(mods)
&& !config(ConfigPassControlKey).toBool()
&& ((key >= Key_A && key <= Key_Z && key != Key_K)
|| key == Key_BracketLeft || key == Key_BracketRight)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment