KUriFilter: don't return an error on non-existing files.
ClosedPublic

Authored by dfaure on Dec 5 2017, 9:16 PM.

Details

Summary

This allows to use partially-typed paths for completion purposes.

Test Plan

Adjusted unittest passes.

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dfaure requested review of this revision.Dec 5 2017, 9:16 PM
dfaure created this revision.

Will this fix typing ~/foo when foo does not exist return an invalid URL?

That's exactly what this fixes (not only ~/foo but also /foo/bar). Out of curiosity, in which context (app) were you seeing that issue?

I can't seem to be able to properly run this(whatever changes I make to the kshorturifilter.cpp seem to be ignored?!) but on paper looks good to me. Do we mark D8920 as abandoned, or wait for this to commit then the new dir property of KUrlNavigator can be pushed as well.

I was just testing this. With this patch, a non-existing ~/test:

  1. Dolphin goes to /home/dh/test, and a red box tells the folder does not exist. This is better than the protocol-error message, so https://bugs.kde.org/show_bug.cgi?id=372813 should be fixed.
  2. In the file open-dialog: This expands also to /home/dh/test, but does not raise an error. So the contents of the listview remains the same.

In summary:

  1. is certainly better with this patch.
  2. file open dialog was possibly better without this patch, since "~/home" <enter> resulted in "/" and not silently in some location that does not exist. This should probably be improved in the file-open dialog itself?

All in all, this patch is an improvement.

What you mention about the file dialog happens with any non-existing dir, so it's unrelated to this patch. I agree that it should be improved somehow, in the file dialog, hopefully not with a messagebox but something more builtin.

Anyhow, can I get this one approved, if we all agree on it?

dhaumann accepted this revision.Dec 14 2017, 11:01 AM

From my side this looks good. A second OK is always better, but I'd be OK if you go ahead. Thanks for the ping!

This revision is now accepted and ready to land.Dec 14 2017, 11:01 AM

@dfaure Better push today than one day before release. ;)

This revision was automatically updated to reflect the committed changes.
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 18 2017, 9:47 AM