Skip to content

ContentItem: Expose copy() method

fixes https://github.com/ubports/ubuntu-touch/issues/1766 if merged with ubports/development/apps/lomiri-music-app!72 (merged)

fixes https://gitlab.com/ubports/core/content-hub/-/issues/3

Moving a file is not allowed due to app armor restriction on content_exchange policy. It fails at deleting the source file in HubIncoming directory.

This MR mark deprecated the move() methods and expose a copy() method instead. App that use move() method should switch to copy instead.

Moreover using QFile::copy (used as the fallback in content-hub when QFile::rename fails) does not trigger the expected inotify event for media-scanner since Qt5.12 way of copying file ( by using a temporary file, see https://code.woboq.org/qt5/qtbase/src/corelib/io/qfile.cpp.html#811 ). Except if we decide to build Qt with QT_NO_TEMPORARYFILE we should use fstream binary copy instead like this MR do

Edited by Lionel Duboeuf

Merge request reports