Merge lp:~lemonboy/pantheon-files/update-free-space into lp:~elementary-apps/pantheon-files/trunk

Proposed by The Lemon Man
Status: Merged
Approved by: Jeremy Wootten
Approved revision: 1967
Merged at revision: 1988
Proposed branch: lp:~lemonboy/pantheon-files/update-free-space
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 48 lines (+19/-12)
1 file modified
src/View/Sidebar.vala (+19/-12)
To merge this branch: bzr merge lp:~lemonboy/pantheon-files/update-free-space
Reviewer Review Type Date Requested Status
Jeremy Wootten Approve
Review via email: mp+276658@code.launchpad.net

Commit message

Update the size-related fields for networked filesystems.

To post a comment you must log in.
Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

The indicator does not update until the Sidebar is refreshed and this does not happen unless e.g. the bookmarks are moved, renamed, deleted. However, the freespace indicator does display correctly for NFS at the time of mounting. It should be clarified whether this is sufficient to meet the requirements of the bounty; the bug report is not specific on this matter. I would say the freespace indicators should update whenever the freespace changes for any of the mounted volumes (not just NFS).

1967. By The Lemon Man

Update the sidebar on uri change.

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

The free space now updates on reload (F5). This has to be done manually for local mounts if the free space changes due to pasting or deleting files since this does not trigger a reload for local devices (FileMonitor signals are used to update the view).
While it would be nice to have the freespace indicators automatically update, it can be added in another branch. I will approve this branch.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/View/Sidebar.vala'
2--- src/View/Sidebar.vala 2015-11-14 13:21:54 +0000
3+++ src/View/Sidebar.vala 2015-11-15 20:44:29 +0000
4@@ -559,16 +559,22 @@
5 var mount = volume.get_mount ();
6 if (mount != null) {
7 var root = mount.get_default_location ();
8- add_place (Marlin.PlaceType.MOUNTED_VOLUME,
9- iter,
10- mount.get_name (),
11- mount.get_icon (),
12- root.get_uri (),
13- null,
14- volume,
15- mount,
16- 0,
17- root.get_parse_name ());
18+ var it = add_place (Marlin.PlaceType.MOUNTED_VOLUME,
19+ iter,
20+ mount.get_name (),
21+ mount.get_icon (),
22+ root.get_uri (),
23+ null,
24+ volume,
25+ mount,
26+ 0,
27+ root.get_parse_name ());
28+
29+ uint64 fs_capacity, fs_free;
30+ get_filesystem_space (root, out fs_capacity, out fs_free);
31+ store.@set (it,
32+ Column.FREE_SPACE, fs_free,
33+ Column.DISK_SIZE, fs_capacity);
34 } else {
35 /* see comment above in why we add an icon for an unmounted mountable volume */
36 var name = volume.get_name ();
37@@ -2007,8 +2013,9 @@
38 }
39
40 private void loading_uri_callback (string location) {
41- set_matching_selection (location);
42- slot_location = location;
43+ set_matching_selection (location);
44+ slot_location = location;
45+ update_places();
46 }
47
48 private void trash_state_changed_cb (Marlin.TrashMonitor trash_monitor, bool state) {

Subscribers

People subscribed via source and target branches

to all changes: