summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <[email protected]>2017-04-22 00:23:15 -0400
committerKurt Hindenburg <[email protected]>2017-04-22 00:23:15 -0400
commite45db267923c1a9b4a07585a06fdc028a1142b16 (patch)
treec4592f5869f20a915ddb5612ef41d09b705b9b5b
parenta2b6a81b45680deaa0dca62f502d52ef49b359bd (diff)
Add () around '& Qt flags'
-rw-r--r--src/TerminalDisplay.cpp12
-rw-r--r--src/Vt102Emulation.cpp14
2 files changed, 13 insertions, 13 deletions
diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp
index 64f7342..740cb10 100644
--- a/src/TerminalDisplay.cpp
+++ b/src/TerminalDisplay.cpp
@@ -2010,7 +2010,7 @@ void TerminalDisplay::mousePressEvent(QMouseEvent* ev)
bool selected = _screenWindow->isSelected(pos.x(), pos.y());
// Drag only when the Control key is held
- if ((!_ctrlRequiredForDrag || (ev->modifiers() & Qt::ControlModifier != 0u)) && selected) {
+ if ((!_ctrlRequiredForDrag || ((ev->modifiers() & Qt::ControlModifier) != 0u)) && selected) {
_dragInfo.state = diPending;
_dragInfo.start = ev->pos();
} else {
@@ -2125,11 +2125,11 @@ void TerminalDisplay::mouseMoveEvent(QMouseEvent* ev)
// key is being held down, which overrides this.
if (!_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier)) {
int button = 3;
- if (ev->buttons() & Qt::LeftButton != 0u)
+ if ((ev->buttons() & Qt::LeftButton) != 0u)
button = 0;
- if (ev->buttons() & Qt::MidButton != 0u)
+ if ((ev->buttons() & Qt::MidButton) != 0u)
button = 1;
- if (ev->buttons() & Qt::RightButton != 0u)
+ if ((ev->buttons() & Qt::RightButton) != 0u)
button = 2;
emit mouseSignal(button,
@@ -2162,7 +2162,7 @@ void TerminalDisplay::mouseMoveEvent(QMouseEvent* ev)
if (_actSel == 0) return;
// don't extend selection while pasting
- if (ev->buttons() & Qt::MidButton != 0u) return;
+ if ((ev->buttons() & Qt::MidButton) != 0u) return;
extendSelection(ev->pos());
}
@@ -2404,7 +2404,7 @@ void TerminalDisplay::updateLineProperties()
void TerminalDisplay::processMidButtonClick(QMouseEvent* ev)
{
if (_mouseMarks || ((ev->modifiers() & Qt::ShiftModifier) != 0u)) {
- const bool appendEnter = ev->modifiers() & Qt::ControlModifier != 0u;
+ const bool appendEnter = (ev->modifiers() & Qt::ControlModifier) != 0u;
if (_middleClickPasteMode == Enum::PasteFromX11Selection) {
pasteFromX11Selection(appendEnter);
diff --git a/src/Vt102Emulation.cpp b/src/Vt102Emulation.cpp
index 22314e1..bf60018 100644
--- a/src/Vt102Emulation.cpp
+++ b/src/Vt102Emulation.cpp
@@ -1024,7 +1024,7 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent* event)
states |= KeyboardTranslator::ApplicationKeypadState;
// check flow control state
- if (modifiers & Qt::ControlModifier != 0u) {
+ if ((modifiers & Qt::ControlModifier) != 0u) {
switch (event->key()) {
case Qt::Key_S:
emit flowControlKeyPressed(true);
@@ -1050,17 +1050,17 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent* event)
// Alt+[Character] results in Esc+[Character] being sent
// (unless there is an entry defined for this particular combination
// in the keyboard modifier)
- const bool wantsAltModifier = entry.modifiers() & entry.modifierMask() & Qt::AltModifier != 0u;
- const bool wantsMetaModifier = entry.modifiers() & entry.modifierMask() & Qt::MetaModifier != 0u;
- const bool wantsAnyModifier = entry.state() &
- entry.stateMask() & KeyboardTranslator::AnyModifierState != 0;
+ const bool wantsAltModifier = ((entry.modifiers() & entry.modifierMask() & Qt::AltModifier) != 0u);
+ const bool wantsMetaModifier = ((entry.modifiers() & entry.modifierMask() & Qt::MetaModifier) != 0u);
+ const bool wantsAnyModifier = ((entry.state() &
+ entry.stateMask() & KeyboardTranslator::AnyModifierState) != 0);
- if ( (modifiers & Qt::AltModifier != 0u) && !(wantsAltModifier || wantsAnyModifier)
+ if ( ((modifiers & Qt::AltModifier) != 0u) && !(wantsAltModifier || wantsAnyModifier)
&& !event->text().isEmpty() )
{
textToSend.prepend("\033");
}
- if ( (modifiers & Qt::MetaModifier != 0u) && !(wantsMetaModifier || wantsAnyModifier)
+ if ( ((modifiers & Qt::MetaModifier) != 0u) && !(wantsMetaModifier || wantsAnyModifier)
&& !event->text().isEmpty() )
{
textToSend.prepend("\[email protected]");