[content-hub] Do not create new copy of a document, if it already exists in $HOME/Documents

Bug #1432394 reported by Stefano Verzegnassi
26
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Ubuntu Document Viewer App
Fix Released
Low
Stefano Verzegnassi

Bug Description

Currently, if a user tries to open a document from external apps (e.g. filemanager-app), a new copy will be created in $HOME/Documents.

There are anyway some cases that we don't want this happens:
1) When opening a document from $HOME/Documents using filemanager-app.
     A new copy of the file is created in the same folder.
2) When opening a document from any path, and a copy of the same file already exists in $HOME/Documents.

In order to achieve this without using too much resources on mobile devices, we should check three conditions:
1) A file with the same name already exists in $HOME/Documents.
2) If the check at 1) returns true, we should check if the two files have the same size.
3) IIRC while importing a document through content-hub, the lastModified() date-time provided by QFileInfo[1] is preserved (but created() time changes). If that's true, we should check also for this parameter.

If all the used conditions are true, content-hub is trying to import a document which was already imported in the past: the app should finalize the active transfer without copying the file, but still notify the user that the transfer has been successfully completed.

[1] http://doc.qt.io/qt-5/qfileinfo.html#lastModified

Tags: bitesize

Related branches

tags: added: bitesize
description: updated
Changed in ubuntu-docviewer-app:
status: Triaged → In Progress
assignee: nobody → Stefano Verzegnassi (verzegnassi-stefano)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

Fix committed into lp:ubuntu-docviewer-app/reboot at revision None, scheduled for release in ubuntu-docviewer-app, milestone Unknown

Changed in ubuntu-docviewer-app:
status: In Progress → Fix Committed
Changed in ubuntu-docviewer-app:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.