<table><tr><td style="">dfaure added a comment.
</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/D25561">View Revision</a></tr></table><br /><div><div><p>Yeah, but these days with lambdas, we can find out who emitted the signal, without the need for an identifier as signal argument...</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">connect(urlLabel, qOverload<>(&KUrlLabel::leftClickedUrl), this, [this, urlLabel]() { selectFolder(urlLabel->url()); } );</pre></div>
<p>should work too.<br />
This way the application can choose whether it wants the URL or the KUrlLabel pointer in the slot, or whatever else.</p>
<p>I'm not 100% sure what's best -- e.g. QPushButton has clicked() without arguments, while KJob as result(KJob*) because it's convenient for the slot. With lambdas we don't really need the KJob* anymore. Capturing the local job variable instead would even remove some static_cast to subclasses in a number of cases. But the porting effort would be huge, so I'm reluctant :-)</p>
<p>I guess this is most closely related to QPushButton though. In the simple case (different slot for each button or URLLabel) the signal with 0 arguments was always enough, and for the dynamic case (N buttons or N URLLabels) we have lambdas nowadays. Seems true for both, so I vote for deprecating the signals with an argument, and for porting KMail to my lambda above right away.</p>
<p>Opinions?</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R236 KWidgetsAddons</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D25561">https://phabricator.kde.org/D25561</a></div></div><br /><div><strong>To: </strong>mlaurent, dfaure, kossebau<br /><strong>Cc: </strong>cfeck, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns<br /></div>