<table><tr><td style="">rjvbb reclaimed this revision.<br />rjvbb added a comment.<br />This revision now requires changes to proceed.
</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/D16882">View Revision</a></tr></table><br /><div><div><p>Re-opening because I found an actual flaw in KDevelop after noticing that context menu duplication still occurred when only the active view receives the aboutToShowContextMenu signal.</p>

<p>The <tt style="background: #ebebeb; font-size: 13px;">addedContextMenu</tt> member exists because <tt style="background: #ebebeb; font-size: 13px;">"we want to remove the added stuff when the menu hides"</tt>. This should of course read "when the menu reopens in again, possibly in a different view".<br />
The flaw here is that the design forgets that the context menu instance is shared among views. It expects <tt style="background: #ebebeb; font-size: 13px;">d->addedContextMenu</tt> to exist and contain the QMenu added by a previous view, but this cannot be the case in the current implementation where the variable is only allocated when the menu is first opened in a given view.<br />
If the <tt style="background: #ebebeb; font-size: 13px;">addedContextMenu</tt> is to be removed in JIT-fashion before reopening the context menu, it should be a static variable.</p>

<p>Fix upcoming.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D16882">https://phabricator.kde.org/D16882</a></div></div><br /><div><strong>To: </strong>rjvbb, KDevelop, kossebau<br /><strong>Cc: </strong>kossebau, kde-frameworks-devel, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>