Skip to content
Commit a78d525e authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

Fix scoping issues with Screen::DecodingOptions

Summary:
Move the Q_DECLARE_OPERATORS_FOR_FLAGS macro declaration for the
DecodingOption enum to the Konsole namespace. This should fix a bug that
happens when KeyboardTranslator.h is included in Screen.h (either
directly or indirectly), where the compiler doesn't find the |() operator
of the QFlags class.

I haven't pinpointed where the conflicting |() operator is coming from
exactly, but moving the macro declaration to the Konsole namespace
matches how other QFlags are used through out the code (and matches
upstream doc examples).

Test Plan:
- Add this include to Screen.h and try to compile:
  #include "KeyboardTranslator.h"

- The compilation fails in SessionController.cpp:
error: invalid conversion from 'int' to 'Konsole::Screen::DecodingOption'
The line it fails on is 1200:
QString selectedText = _view->screenWindow()->selectedText(Screen::PreserveLineBreaks | Screen::TrimLeadingWhitespace | Screen::TrimTrailingWhitespace);

- Apply the diff and build ...
parent 7e040b61
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