<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/D14072">View Revision</a></tr></table><br /><div><div><p>This commit breaks kfileplacesmodeltest.</p>

<p>$ bin/kfileplacesmodeltest testInitialState testInitialList testInternalBookmarksHaveIds</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Start testing of KFilePlacesModelTest <strong>*</strong>****</li>
</ul>

<p>Config: Using QtTest library 5.12.0, Qt 5.12.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 7.3.1 20180323 [gcc-7-branch revision 258812])<br />
QDEBUG : KFilePlacesModelTest::initTestCase() 18:21:44.046 kfileplacesmodeltest(22234) ?[32mSolid::Backends::Fake::FakeManager::parseMachineFile?[0m void Solid::Backends::Fake::FakeManager::parseMachineFile() Parsing fake computer XML:  "/d/kde/src/5/frameworks/kio/autotests/fakecomputer.xml"</p>

<p>PASS   : KFilePlacesModelTest::initTestCase()<br />
PASS   : KFilePlacesModelTest::testInitialState()<br />
PASS   : KFilePlacesModelTest::testInitialList()<br />
FAIL!  : KFilePlacesModelTest::testInternalBookmarksHaveIds() '!ids.contains(id)' returned FALSE. (Duplicated ID found!)</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);">Loc: [/d/kde/src/5/frameworks/kio/autotests/kfileplacesmodeltest.cpp(315)]</pre></div>

<p>PASS   : KFilePlacesModelTest::cleanupTestCase()<br />
Totals: 4 passed, 1 failed, 0 skipped, 0 blacklisted, 75ms</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Finished testing of KFilePlacesModelTest <strong>*</strong>****</li>
</ul>

<p>I have debugged it a little bit but I don't really understand the overall logic.</p>

<p>Many bookmarks have a UDI (like /org/kde/solid/fakehw/fstab/thehost/solidpath) and no URL, and those are the ones that are duplicated now.</p>

<p>When this code is called again, those bookmarks are now skipped in the first iteration, and therefore added by the next foreach (the one which says "Add bookmarks for the remaining devices, they were previous unknown").</p>

<p>Maybe this skipping should only be done for bookmarks with an empty UDI?</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D14072">https://phabricator.kde.org/D14072</a></div></div><br /><div><strong>To: </strong>jtamate, dfaure, Frameworks<br /><strong>Cc: </strong>kde-frameworks-devel, michaelh, ngraham, bruns<br /></div>