Skip to content
Commit 0905b073 authored by Bart De Vries's avatar Bart De Vries Committed by Nate Graham
Browse files

Importer: convert all file operations to allow remote URLs

Summary:
All file operations are updated to allow remote URLs, both on the source
and destination side.  This consists mainly of converting local file/dir
operations to KIO calls.
Remote source was already mostly covered.
To support remote destinations, a few adaptations were needed:
 - If destination is remote or a remote server mounted locally, then do
   not create the temporary directory as a subdir of the destination,
   but create it locally using default QTemporaryDir().
 - When comparing file contents, if destination is remote, use
   KIO::storedGet to get the file contents in one go.  This is much
   simpler and more robust than using asynchronous KIO::open calls,
   but has the drawback that the file is read in one go instead of in
   chunks.

Test Plan:
Added unit tests for remote source and destination.
Also tested manually by running gwenview_importer with a combination
of remote and local destinations, covering smb and sftp protocols, as
well as remote server mounted locally (e.g. cifs mount).
Also tested on multiple files with the same name existing in source
directory; both identical and different in content.

Reviewers: #gwenview, ngraham

Reviewed By: #gwenview, ngraham

Subscribers: ngraham, #gwenview

Tags: #gwenview

Differential Revision: https://phabricator.kde.org/D24875
parent d3acacad
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment