<table><tr><td style="">rjvbb 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/D7995" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Milian Wolff wrote on 20171116::12:22:21 re: "<a href="https://phabricator.kde.org/D7995" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">D7995</a>: KDevelop: address dirwatching inefficiency (WIP/PoC)"</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><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);">I won't accept it with traces of useless stuff in it.</pre></div></blockquote>

<p>And I won't have my name associated with something that's not to par with my own standards. At the very least I'll have to remove my (C) notice.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><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);">Unclear behavior? That needs to be fixed in KDirWatch upstream then.</pre></div></blockquote>

<p>The unclearness yes, but it's not up to us to decide whether KDW::addDir() should ignore duplicates or keep some kind of internal track as it appears to be doing.</p>

<p>The proposed improvement adds the directory to the watched list each time that directory is loaded and reloaded. That's unnecessary and that should be enough reason to verify if a directory is already watched before handing it off to KDW::addDir(), and one logical place to do that is in ProjectWatcher .</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><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);">FUD. I'm a Qt dev, and I told you how it works which should be reliable for your purpose here.</pre></div></blockquote>

<p>That has turned out not to be the case, I already told you I've seen deadlock-like situations.</p>

<p>Citing Konrad Rosenbaum from the development ML:</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);">> With Qt there are some simple rules:
<snip> 
> For calls across threads use QueuedConnection explicitly.. (In most cases
> Qt detects this automatically, but there are some special cases usually
> involving moveToThread().)
<snip>
> Do not make any assumptions about the order of signals or slots. Try to
> avoid the assumption that a signal only returns after the slot has been
> executed (or that it returns immediately) - you'll mess with connection
> settings soon enough after you forgot that you rely on it. Regard signals
> as fire-and-forget-but-maybe-take-some-time-with-unknown-effects.

> The combination of these will ensure that your application behaves in an
> acceptable manner.</pre></div>

<p>That's not FUD, that's common sensical defensive programming (taking the form of "let's add a flag that normally should be added automatically"). I frankly don't understand why we're even having this discussion.</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/D7995" rel="noreferrer">https://phabricator.kde.org/D7995</a></div></div><br /><div><strong>To: </strong>rjvbb, KDevelop, mwolff<br /><strong>Cc: </strong>aaronpuchert, arrowdodger, kfunk, dfaure, mwolff, brauch, kdevelop-devel, njensen, geetamc, Pilzschaf, akshaydeo, surgenight<br /></div>