Bug 425163

Summary: Kate is spewing kf5.kio.kdirmodel: protocol mismatch: "" vs "file"
Product: [Frameworks and Libraries] frameworks-kio Reporter: Andreas Nordal <andreas_nordal_4>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kdelibs-bugs-null, kresimircindric, nate
Priority: NOR    
Version First Reported In: 5.73.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.75
Sentry Crash Report:

Description Andreas Nordal 2020-08-09 15:12:46 UTC
SUMMARY
Annoying error message in the terminal.

STEPS TO REPRODUCE
touch file.txt && kate file.txt

OBSERVED RESULT
kf5.kio.kdirmodel: protocol mismatch: "" vs "file"

EXPECTED RESULT


SOFTWARE/OS VERSIONS
kate 20.04.3
openSUSE Tumbleweed 20200807

KDE Plasma Version: 5.19
KDE Frameworks Version: 5.72.0
Qt Version: 5.15

ADDITIONAL INFORMATION
Kwrite does not suffer from this.
Comment 1 KC 2020-08-14 05:39:56 UTC
Same thing on Arch Linux, with Kate 20.04.3.
Comment 2 Bug Janitor Service 2020-09-18 10:43:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/140
Comment 3 David Faure 2020-09-20 20:06:15 UTC
Git commit 17508a45e1688c68d3855006dbba254dbb707c09 by David Faure, on behalf of Ahmad Samir.
Committed on 20/09/2020 at 20:05.
Pushed by dfaure into branch 'master'.

KDirOperator: don't call setCurrentItem on an empty url

A previous commit re-enabled dir highlighting, which is supposed to
highlight the dir we've just left when going back/up. However when a
KFileWidget is first created/opened there is no such item to highlight.
If setCurrentItem is called with on an empty url, KDirModel::expandToUrl
would call expandAllParentsUntil on that url which would show this warning:
'protocol mismatch: "" vs "file"'.

This also fixes an issue where if you open a file in kate, then invoke the
open file dialog the currently open file isn't selected/highlighted in the
view.
FIXED-IN: 5.75

M  +2    -1    src/filewidgets/kdiroperator.cpp

https://invent.kde.org/frameworks/kio/commit/17508a45e1688c68d3855006dbba254dbb707c09