<table><tr><td style="">pino 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/D17289">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/D17289#432577" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D17289#432577</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;"><p>no need for making it "deterministic" in any way. There is no benefit in doing that.</p></blockquote>

<p>I think there is so, it's the whole point of this PR.</p></div>
</blockquote>

<p>Not really: it says that a temporary directory for every kdevelop instance is created, making sure it is used also indirectly (e.g. when not using Qt), so that temporary files created by clang are stored there (and thus automatically cleaned at exit).<br />
There is simply nothing that requires the user ID to be part of the name, nor the session UUID, nor even the "kdevelop" string FWIW (I suggested there mostly to help identifying it).</p>

<p>All this PR ought to do is something along the lines of</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="c++" 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);"><span class="n">QTemporaryDir</span> <span style="color: #004012">tempDir</span><span class="p">(</span><span class="n">QDir</span><span style="color: #aa2211">::</span><span class="n">tempPath</span><span class="p">()</span> <span style="color: #aa2211">+</span> <span style="color: #766510">"/kdevelop.XXXXXX"</span><span class="p">);</span>
<span style="color: #aa4000">if</span> <span class="p">(</span><span style="color: #aa2211">!</span><span class="n">tempDir</span><span class="p">.</span><span class="n">isValid</span><span class="p">())</span> <span class="p">{</span> <span style="color: #74777d">/* complain, fall back, whatever */</span> <span class="p">}</span>
<span class="n">qputenv</span><span class="p">(</span><span style="color: #766510">"TEMP"</span><span class="p">,</span> <span class="n">QFile</span><span style="color: #aa2211">::</span><span class="n">encodeName</span><span class="p">(</span><span class="n">tempDir</span><span class="p">.</span><span class="n">path</span><span class="p">()));</span>
<span class="n">qputenv</span><span class="p">(</span><span style="color: #766510">"TMP"</span><span class="p">,</span> <span class="n">QFile</span><span style="color: #aa2211">::</span><span class="n">encodeName</span><span class="p">(</span><span class="n">tempDir</span><span class="p">.</span><span class="n">path</span><span class="p">()));</span></pre></div>

<ul class="remarkup-list">
<li class="remarkup-list-item">short name as it can be, still recognizable</li>
<li class="remarkup-list-item">automatically cleaned at exit</li>
<li class="remarkup-list-item">with the right permissions to restrict it to the current user only</li>
</ul>

<p>... and that's it. (Of course, with the QTemporaryDir object as CorePrivate class member.)<br />
Doing this also on Windows should be good anyway: if <tt style="background: #ebebeb; font-size: 13px;">TMPDIR</tt> and <tt style="background: #ebebeb; font-size: 13px;">TMP</tt> are used, then the QTemporaryDir will be used; otherwise, it will be just an empty temporary directory.</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/D17289">https://phabricator.kde.org/D17289</a></div></div><br /><div><strong>To: </strong>rjvbb, KDevelop, kfunk, mwolff, pino<br /><strong>Cc: </strong>aaronpuchert, mwolff, pino, kfunk, kdevelop-devel, gennad, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>