<table><tr><td style="">ahmadsamir created this revision.<br />ahmadsamir added reviewers: Frameworks, dfaure.<br />Herald added a project: Frameworks.<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/D29427">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The deprecated ctor that took a KActionCollection param called the new<br />
ctor (that doesn't take an actionCollection before) m_actionCollection was<br />
assigned. This caused the menu actions never to get added to the<br />
actionCollection as it was still nullptr. This caused crashes in<br />
applications that still use the deprecated ctor, e.g. this bug in<br />
konsole <a href="https://bugs.kde.org/show_bug.cgi?id=420820" class="remarkup-link" target="_blank" rel="noreferrer">https://bugs.kde.org/show_bug.cgi?id=420820</a>.</p>

<p>Since we can't assign m_actionCollection in the initializer list because<br />
then the constructor delegation would follow a member initializer<br />
(info courtsey of the compiler), introduce a helper init method to<br />
reduce code duplication between the two ctor's.</p>

<p>Thanks to Friedrich W. H. Kossebau for figuring it out<br />
<a href="https://phabricator.kde.org/D28800#663274" class="remarkup-link" target="_blank" rel="noreferrer">https://phabricator.kde.org/D28800#663274</a>.</p>

<p>CCBUG: 420820</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>make && ctest</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R294 KBookmarks</div></div></div><br /><div><strong>BRANCH</strong><div><div>l-bookmarkmenu-assign-actioncoll (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29427">https://phabricator.kde.org/D29427</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/kbookmarkmenu.cpp<br />
src/kbookmarkmenu.h</div></div></div><br /><div><strong>To: </strong>ahmadsamir, Frameworks, dfaure<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns<br /></div>