sftp: port to Result system to force serialization of error/finish condition

Authored by sitter on Feb 4 2020, 12:26 PM.

Description

sftp: port to Result system to force serialization of error/finish condition

Summary:
the Result system was originally introduced to the FTP slave and now also
makes an appearance in the SFTP slave. the system introduces a separation
between logic and fronting API class to more tightly control when state
changing calls (finished()/error()) are made. since these calls may only
be made once during a given command multiple calls are at the very least
indicative of bad code and at worst cause severe state confusion for the
slavebase that it won't be able to recover from, rendering the slave
instance broken.

in the internal class Results are returned whenever an error can appear and
these Results must be handled in some form. the only way to effectively
produce user visible errors is to forward results up the call chain.

Test Plan:

  • connect
  • copy remotely
  • overwrite remotely
  • copy to local
  • overwrite to local
  • copy from local to remote
  • copy form local to remote and overwrite

Reviewers: dfaure, feverfew

Reviewed By: dfaure, feverfew

Subscribers: kde-frameworks-devel, kfm-devel

Tags: Dolphin, Frameworks

Differential Revision: https://phabricator.kde.org/D27153