[content-hub] Do not create new copy of a document, if it already exists in $HOME/Documents
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.
Related branches
- Ubuntu Phone Apps Jenkins Bot: Approve (continuous-integration)
- Ubuntu Document Viewer Developers: Pending requested
-
Diff: 94 lines (+54/-4)3 files modifiedsrc/app/qml/common/ContentHubProxy.qml (+14/-4)
src/plugin/file-qml-plugin/docviewerutils.cpp (+38/-0)
src/plugin/file-qml-plugin/docviewerutils.h (+2/-0)
tags: | added: bitesize |
description: | updated |
Changed in ubuntu-docviewer-app: | |
status: | Triaged → In Progress |
assignee: | nobody → Stefano Verzegnassi (verzegnassi-stefano) |
Changed in ubuntu-docviewer-app: | |
status: | Fix Committed → Fix Released |
Fix committed into lp:ubuntu-docviewer-app/reboot at revision None, scheduled for release in ubuntu- docviewer- app, milestone Unknown