Files show "0 bytes" immediately after loading to device

Bug #1483218 reported by Alan Pope 🍺🐧🐱 🦄
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Document Viewer App
Fix Released
Low
Stefano Verzegnassi

Bug Description

Start with a device containing no documents.
Open DocViewer
Copy documents via MTP / adb
Observe the documents appearing in the list.

Note that the file size shows as zero (presumably because DocViewer notices the files arrive before they've finished being written to).

You can force a refresh by switching to grid mode and back to list mode, but it would be nicer if the documents showed up with the correct file size once they have finished copying.

Tags: bitesize

Related branches

Revision history for this message
Phill (phill.l) wrote :

I've identified a bug in `gvfs` that may be causing this in all applications that use the mounted gvfs-fuse filing system to access MTP devices.

Could this bug be a symptom of that? See #1487546.

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

I had a check some time ago and our file watcher properly updates file informations in the model.

Looking at the source code[1], it rather seems that we don't inform the view that an entry in the model has been updated, since the dataChanged() signal[2] is not emitted.

SOLUTION:
Emit dataChanged() signal in DocumentModel::q_fileModified(...)

====
Refs.

[1]: http://bazaar.launchpad.net/~ubuntu-docviewer-dev/ubuntu-docviewer-app/lo-viewer/view/head:/src/plugin/file-qml-plugin/documentmodel.cpp

[2]: http://doc.qt.io/qt-5/qabstractitemmodel.html#dataChanged

tags: added: bitesize
Changed in ubuntu-docviewer-app:
status: New → Triaged
importance: Undecided → Medium
importance: Medium → Low
milestone: none → ww02-2016
Changed in ubuntu-docviewer-app:
milestone: ww02-2016 → ww08-2016
Changed in ubuntu-docviewer-app:
status: Triaged → In Progress
assignee: nobody → Stefano Verzegnassi (verzegnassi-stefano)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

Fix committed into lp:ubuntu-docviewer-app at revision 322, scheduled for release in ubuntu-docviewer-app, milestone ww02-2016

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.