If F4 is pressed to try to edit a remote folder, then an empty file is edited, and an error message is shown. This proposal is aimed to solve that.
Notes: This also happened before applying https://phabricator.kde.org/D27258 ("Manage what happens when a PanelViewerBase (e.g. using Shift+F3) tries to open a nonexistent local file") or applying https://phabricator.kde.org/D27259 ("Manage the use of Shift+F4 when opening a local file that exists, or a remote folder or remote file that exists") though some of the code that was introduced in https://phabricator.kde.org/D27259 was reused in the present code review.
FIXED: [ 418572 ] Errors when pressing F4 on a remote folder
BUG: 418572