<table><tr><td style="">elvisangelaccio created this revision.<br />elvisangelaccio added a reviewer: rthomsen.<br />elvisangelaccio added a subscriber: kde-utils-devel.<br />elvisangelaccio set the repository for this revision to rARK Ark.<br />elvisangelaccio added a project: Ark.</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/D1749" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The goal of task <a href="https://phabricator.kde.org/T916" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">T916</a> is to stop disabling the Part UI while extracting an entry. To do so, we need first to make sure that no race condition would occur if extracting two or more entries in parallel.</p>
<p>A race condition might occur in <tt style="background: #ebebeb; font-size: 13px;">Part::slotOpenExtractedEntry()</tt>, where <tt style="background: #ebebeb; font-size: 13px;">m_openFileMode</tt> is a global member that could be accessed concurrently between different threads. We can stop using this variable if we introduce dedicated jobs for preview/opening of files. This way we can simply do a dynamic_cast on the local <tt style="background: #ebebeb; font-size: 13px;">job</tt> variable, to check whether the user wants to open or open-with the file.</p>
<p>Preview is totally unrelated so it can be moved into a different slot. We can also make sure that the <tt style="background: #ebebeb; font-size: 13px;">PreviewJob</tt> deletes the temporary directory upon completion.</p></div></div><br /><div><strong>TEST PLAN</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">Preview, open and open-with an entry in an archive.</li>
<li class="remarkup-list-item">Make sure that the temporary directory is deleted when closing ark</li>
<li class="remarkup-list-item">Make sure that an open file can still be edited (and the archive is updated)</li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>rARK Ark</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D1749" rel="noreferrer">https://phabricator.kde.org/D1749</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/kerfuffle/data/archive-malicious.json<br />
autotests/kerfuffle/jobstest.cpp<br />
kerfuffle/archive_kerfuffle.cpp<br />
kerfuffle/archive_kerfuffle.h<br />
kerfuffle/jobs.cpp<br />
kerfuffle/jobs.h<br />
part/archivemodel.cpp<br />
part/archivemodel.h<br />
part/part.cpp<br />
part/part.h</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>elvisangelaccio, rthomsen<br /><strong>Cc: </strong>kde-utils-devel, tctara<br /></div>