Skip to content
  • Bart De Vries's avatar
    Importer: convert all file operations to allow remote URLs · 0905b073
    Bart De Vries authored and Nate Graham's avatar Nate Graham committed
    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
    0905b073