<table><tr><td style="">rjvbb created this revision.<br />rjvbb added a reviewer: Frameworks.<br />Herald added a project: Frameworks.<br />rjvbb 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/D22801">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Prevent qWarning() messages that can arise when browsing samba shares:</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);">QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
QFileInfo::absolutePath: Constructed with empty filename
# possibly many more</pre></div>
<p>The source of the empty paths isn't clear (see the backtrace in the "Test Plan"); I never noticed the warnings until I upgraded kio-extras to 19.04.3 and Samba to 4.8.9 and my MSWin rig to Win10 1903.<br />
It's probably a good idea to handle this case gracefully.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Backtrace without the patch:</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);">* thread #1, name = 'dolphin', stop reason = breakpoint 1.1
frame #0: 0x00007ffff10969c7 libQt5Core.so.5`QFileInfo::absolutePath(this=<unavailable>) const at qfileinfo.cpp:586:9
583 if (d->isDefaultConstructed) {
584 return QLatin1String("");
585 } else if (d->fileEntry.isEmpty()) {
-> 586 qWarning("QFileInfo::absolutePath: Constructed with empty filename");
587 return QLatin1String("");
588 }
589 return d->getFileName(QAbstractFileEngine::AbsolutePathName);
(lldb) bt
* thread #1, name = 'dolphin', stop reason = breakpoint 1.1
* frame #0: 0x00007ffff10969c7 libQt5Core.so.5`QFileInfo::absolutePath(this=<unavailable>) const at qfileinfo.cpp:586:9
frame #1: 0x00007ffff48442c6 libKF5KIOCore.so.5`KMountPoint::List::findByPath(this=0x00007fffffffd3c0, path=<unavailable>) const at kmountpoint.cpp:422:41
frame #2: 0x00007ffff6721eaf libKF5KIOWidgets.so.5`KIO::PreviewJobPrivate::startPreview(this=0x0000000000f6bae0) at previewjob.cpp:327:33
frame #3: 0x00007ffff1180c4e libQt5Core.so.5`QObject::event(this=0x00000000010443e0, e=<unavailable>) at qobject.cpp:1252:18
frame #4: 0x00007ffff273a84d libQt5Widgets.so.5`QApplicationPrivate::notify_helper(this=<unavailable>, receiver=0x00000000010443e0, e=0x000000000105c690) at qapplication.cpp:3722:31
frame #5: 0x00007ffff273bba9 libQt5Widgets.so.5`QApplication::notify(this=<unavailable>, receiver=<unavailable>, e=<unavailable>) at qapplication.cpp:0:9
frame #6: 0x00007ffff1157f53 libQt5Core.so.5`QCoreApplication::notifyInternal2(receiver=0x00000000010443e0, event=0x000000000105c690) at qcoreapplication.cpp:1031:18
frame #7: 0x00007ffff1158d9f libQt5Core.so.5`QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) [inlined] QCoreApplication::sendEvent(receiver=<unavailable>, event=<unavailable>) at qcoreapplication.h:233:44
frame #8: 0x00007ffff1158d8b libQt5Core.so.5`QCoreApplicationPrivate::sendPostedEvents(receiver=0x0000000000000000, event_type=0, data=0x000000000061ba50) at qcoreapplication.cpp:1706
frame #9: 0x00007ffff11a9623 libQt5Core.so.5`postEventSourceDispatch(s=0x000000000078e860, (null)=<unavailable>, (null)=<unavailable>)(void*), void*) at qeventdispatcher_glib.cpp:276:5
frame #10: 0x00007fffe96bf0e5 libglib-2.0.so.0`g_main_context_dispatch at gmain.c:3170:27
frame #11: 0x00007fffe96bef57 libglib-2.0.so.0`g_main_context_dispatch(context=<unavailable>) at gmain.c:3835
frame #12: 0x00007fffe96bf7b5 libglib-2.0.so.0`g_main_context_iterate(context=<unavailable>, block=<unavailable>, dispatch=<unavailable>, self=<unavailable>) at gmain.c:3908:5
frame #13: 0x00007fffe96bfa21 libglib-2.0.so.0`g_main_context_iteration(context=0x00007fffd8003030, may_block=1) at gmain.c:3969:12
frame #14: 0x00007ffff11a90db libQt5Core.so.5`QEventDispatcherGlib::processEvents(this=0x0000000000790120, flags=<unavailable>) at qeventdispatcher_glib.cpp:425:18
frame #15: 0x00007ffff1153baf libQt5Core.so.5`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) [inlined] QEventLoop::processEvents(this=<unavailable>, flags=<unavailable>) at qeventloop.cpp:134:51
frame #16: 0x00007ffff1153b95 libQt5Core.so.5`QEventLoop::exec(this=0x00007fffffffda70, flags=<unavailable>) at qeventloop.cpp:212
frame #17: 0x00007ffff11585fa libQt5Core.so.5`QCoreApplication::exec() at qcoreapplication.cpp:1304:32
frame #18: 0x00007ffff7b4d753 libkdeinit5_dolphin.so`::kdemain(argc=<unavailable>, argv=<unavailable>) at main.cpp:168:12
frame #19: 0x00007ffff02d3f45 libc.so.6`__libc_start_main(main=(dolphin`main at dolphin_dummy.cpp:3:43), argc=1, argv=0x00007fffffffdc78, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffdc68) at libc-start.c:287
frame #20: 0x0000000000400979 dolphin`_start + 41</pre></div>
<p>With the patch in place I can browse</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/D22801">https://phabricator.kde.org/D22801</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/core/kmountpoint.cpp</div></div></div><br /><div><strong>To: </strong>rjvbb, Frameworks<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, sbergeron, michaelh, ngraham, bruns<br /></div>