<table><tr><td style="">Lekensteyn created this revision.<br />Lekensteyn added reviewers: ngraham, dfaure, fvogt.<br />Lekensteyn added a project: Frameworks.<br />Lekensteyn requested review of this revision.
</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/D19027">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>When the Save File dialog is in use with filters, any relative path<br />
would trigger warnings due to KIO::stat receiving an invalid URL in<br />
KFileWidgetPrivate::updateLocationEditExtension. Fix the warning by<br />
ensuring that relative paths are valid file URLs.</p>
<p>Add a bunch of tests to check the expected properties while at it. These<br />
tests pass regardless of the fix but after the fix, warnings are gone.</p>
<p>BUG: 373119</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Before the kfilewidget.cpp change:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="console" 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 style="color: #000080">$ ninja bin/kfilewidgettest && bin/kfilewidgettest testFilterChange testSetFilterForSave</span>
<span style="color: #808080">Config: Using QtTest library 5.12.0, Qt 5.12.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.2.1 20181127)</span>
<span style="color: #808080">PASS : KFileWidgetTest::initTestCase()</span>
<span style="color: #808080">QWARN : KFileWidgetTest::testFilterChange() kf5.kio.core: Invalid URL: QUrl("some.txt")</span>
<span style="color: #808080">QWARN : KFileWidgetTest::testFilterChange() kf5.kio.core: Invalid URL: QUrl("some.txt")</span>
<span style="color: #808080">QWARN : KFileWidgetTest::testFilterChange() kf5.kio.core: Invalid URL: QUrl("some.txt")</span>
<span style="color: #808080">Qt: Session management error: networkIdsList argument is NULL</span>
<span style="color: #808080">PASS : KFileWidgetTest::testFilterChange()</span>
<span style="color: #808080">QWARN : KFileWidgetTest::testSetFilterForSave(some.txt) kf5.kio.core: Invalid URL: QUrl("some.txt")</span>
<span style="color: #808080">QWARN : KFileWidgetTest::testSetFilterForSave(some.txt) kf5.kio.core: Invalid URL: QUrl("some.txt")</span>
<span style="color: #808080">PASS : KFileWidgetTest::testSetFilterForSave(some.txt)</span>
<span style="color: #808080">PASS : KFileWidgetTest::testSetFilterForSave(extensionless name)</span>
<span style="color: #808080">PASS : KFileWidgetTest::testSetFilterForSave(existing file)</span>
<span style="color: #808080">QWARN : KFileWidgetTest::testSetFilterForSave(some.2019) kf5.kio.core: Invalid URL: QUrl("some.2019")</span>
<span style="color: #808080">QWARN : KFileWidgetTest::testSetFilterForSave(some.2019) kf5.kio.core: Invalid URL: QUrl("some.txt")</span>
<span style="color: #808080">PASS : KFileWidgetTest::testSetFilterForSave(some.2019)</span>
<span style="color: #808080">QWARN : KFileWidgetTest::testSetFilterForSave(some.html) kf5.kio.core: Invalid URL: QUrl("some.html")</span>
<span style="color: #808080">QWARN : KFileWidgetTest::testSetFilterForSave(some.html) kf5.kio.core: Invalid URL: QUrl("some.txt")</span>
<span style="color: #808080">PASS : KFileWidgetTest::testSetFilterForSave(some.html)</span>
<span style="color: #808080">PASS : KFileWidgetTest::cleanupTestCase()</span></pre></div>
<p>After the change, all <tt style="background: #ebebeb; font-size: 13px;">QWARN</tt> lines are gone.</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/D19027">https://phabricator.kde.org/D19027</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/kfilewidgettest.cpp<br />
src/filewidgets/kfilewidget.cpp</div></div></div><br /><div><strong>To: </strong>Lekensteyn, ngraham, dfaure, fvogt<br /><strong>Cc: </strong>kde-frameworks-devel, michaelh, ngraham, bruns<br /></div>