<table><tr><td style="">ahmadsamir created this revision.<br />ahmadsamir added a reviewer: Konsole.<br />Restricted Application added a project: Konsole.<br />Restricted Application added a subscriber: konsole-devel.<br />ahmadsamir requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D12797">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Move the Q_DECLARE_OPERATORS_FOR_FLAGS macro declaration for the<br />
DecodingOption enum to the Konsole namespace. This should fix a bug that<br />
happens when KeyboardTranslator.h is included in Screen.h (either<br />
directly or indirectly), where the compiler doesn't find the |() operator<br />
of the QFlags class.</p>

<p>I haven't pinpointed where the conflicting |() operator is coming from<br />
exactly, but moving the macro declaration to the Konsole namespace<br />
matches how other QFlags are used through out the code (and matches<br />
upstream doc examples).</p></div></div><br /><div><strong>TEST PLAN</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">Add this include to Screen.h and try to compile: #include "KeyboardTranslator.h"</li>
</ul>

<ul class="remarkup-list">
<li class="remarkup-list-item">The compilation fails in SessionController.cpp: error: invalid conversion from 'int' to 'Konsole::Screen::DecodingOption' on line 1200: QString selectedText = _view->screenWindow()->selectedText(Screen::PreserveLineBreaks | Screen::TrimLeadingWhitespace | Screen::TrimTrailingWhitespace);</li>
</ul>

<ul class="remarkup-list">
<li class="remarkup-list-item">Apply the diff and build again, the build should complete</li>
</ul>

<ul class="remarkup-list">
<li class="remarkup-list-item">I tested the options from the DecodingOption enum from the Screen class and they still work as before</li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R319 Konsole</div></div></div><br /><div><strong>BRANCH</strong><div><div>screen-decodingOption-scope</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D12797">https://phabricator.kde.org/D12797</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/Screen.h<br />
src/ScreenWindow.h</div></div></div><br /><div><strong>To: </strong>ahmadsamir, Konsole<br /><strong>Cc: </strong>konsole-devel, herrold, ngraham, hindenburg<br /></div>