<table><tr><td style="">kfunk 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/D16218">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D16218#343380" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D16218#343380</a>, <a href="https://phabricator.kde.org/p/rjvbb/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@rjvbb</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><ul class="remarkup-list">
<li class="remarkup-list-item">Why does this patch look so much more verbose than the solution proposed on <a href="http://doc.qt.io/qt-5/unix-signals.html" class="remarkup-link" target="_blank" rel="noreferrer">http://doc.qt.io/qt-5/unix-signals.html</a>?</li>
</ul></blockquote>

<p>Probably because it's a patch against existing code, which needs changes due to the fact that I thought I'd had to avoid static globals.</p></div>
</blockquote>

<p>Not sure what you mean by that, but see my last remark in this reply.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><ul class="remarkup-list">
<li class="remarkup-list-item">Why the alternative implementations? Why do we need to the non-QSocketNotifier variant? You realize that every "alternative solution" or <tt style="background: #ebebeb; font-size: 13px;">#ifdef</tt> puts more maintenance burden on us?</li>
</ul></blockquote>

<p>Who said I wanted to have both committed - the title has <tt style="background: #ebebeb; font-size: 13px;">WIP</tt> in it for a reason?! I've explained why there are 2 alternatives (re-read goal 2). There's another reason why avoiding QSocketNotifier could be useful: using a semaphore doesn't require spending 2 file descriptors on something you might never need (it isn't hard to run into the open fd limit with KDevelop, esp. when not running Linux).</p></blockquote>

<p>This KDevelop problem is not solved by saving those 2 of those file descriptors.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Should be a separate patch, I suppose that's close to a one-line patch against the current code base.</p></blockquote>

<p>Which is also why it could be just as well part of a complete overhaul of the whole signal handling stuff, IMHO.</p></blockquote>

<p>No, because we now have to discuss several different things as part of one review again, a repeating pattern which makes these discussion so dreadful and exhausting.</p>

<ol class="remarkup-list">
<li class="remarkup-list-item">There's this one behavioral change you wanted, which would fix the bug, a one- or two-line patch, which could be possibly even added to 5.3.</li>
<li class="remarkup-list-item">Then there's a refactoring patch which should go to master branch, way more invasive and bound to fail for some users on the first iteration.</li>
</ol>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Side note: All the signal handling functionality should be factored out into classes/functions as much as possible in order to simplify the code (cf. <a href="http://doc.qt.io/qt-5/unix-signals.html" class="remarkup-link" target="_blank" rel="noreferrer">http://doc.qt.io/qt-5/unix-signals.html</a> again -- it does that nicely).</p></blockquote>

<p>Which goes against the principle used otherwise to avoid global symbols and stuff everything of that sort into classes...</p></blockquote>

<p>There's no single "global symbol" (and I guess by that you mean "global static"), only class statics. And this implementation is undeniably more easy to read than a scattered dump of blocks of signal-handling related code into an existing class. Not doing so again makes it harder to reason about the code and increases complexity.</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/D16218">https://phabricator.kde.org/D16218</a></div></div><br /><div><strong>To: </strong>rjvbb, KDevelop, kfunk<br /><strong>Cc: </strong>brauch, kfunk, arrowd, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight<br /></div>