Merge lp:~jeremywootten/pantheon-files/fix-count-items-selected into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Approved by: PerfectCarl
Approved revision: 1714
Merged at revision: 1722
Proposed branch: lp:~jeremywootten/pantheon-files/fix-count-items-selected
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 56 lines (+4/-9)
1 file modified
src/View/OverlayBar.vala (+4/-9)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/fix-count-items-selected
Reviewer Review Type Date Requested Status
PerfectCarl (community) Approve
Review via email: mp+246794@code.launchpad.net

Commit message

Fix item count in Overlay

Description of the change

This branch fixes a bug in the overlay causing it to show "0 items selected" when multiple files (not including folders) are selected.

To test:

FUNCTION:
1) Select different numbers of files (not including folders) in icon or Miller view. The overlay shows the appropriate number of items selected.

REGRESSIONS:
2) Select different combinations of files and folders in Icon or Miller view. The overlay shows appropriate information.

To post a comment you must log in.
Revision history for this message
PerfectCarl (name-is-carl) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/View/OverlayBar.vala'
--- src/View/OverlayBar.vala 2014-11-13 20:24:33 +0000
+++ src/View/OverlayBar.vala 2015-01-16 23:47:13 +0000
@@ -94,14 +94,11 @@
94 }94 }
9595
96 private void real_update (GLib.List<GOF.File>? files) {96 private void real_update (GLib.List<GOF.File>? files) {
97 count = 0;
98 goffile = null;97 goffile = null;
99 folders_count = 0;98 folders_count = 0;
100 files_count = 0;99 files_count = 0;
101 files_size = 0;100 files_size = 0;
102101
103 /* cancel any pending subfolder scan */
104 //cancellable.cancel ();
105 if (files != null) {102 if (files != null) {
106 visible = showbar;103 visible = showbar;
107104
@@ -127,7 +124,7 @@
127 image_cancellable = null;124 image_cancellable = null;
128 }125 }
129126
130 if (goffile != null) {127 if (goffile != null) { /* a single file is hovered or selected */
131 if (goffile.is_network_uri_scheme ()) {128 if (goffile.is_network_uri_scheme ()) {
132 status = goffile.get_display_target_uri ();129 status = goffile.get_display_target_uri ();
133 } else if (!goffile.is_folder ()) {130 } else if (!goffile.is_folder ()) {
@@ -143,7 +140,7 @@
143 status = "%s - %s".printf (goffile.info.get_name (), goffile.formated_type);140 status = "%s - %s".printf (goffile.info.get_name (), goffile.formated_type);
144141
145 }142 }
146 } else {143 } else { /* hovering over multiple selection */
147 string str = null;144 string str = null;
148 if (folders_count > 1) {145 if (folders_count > 1) {
149 str = _("%u folders").printf (folders_count);146 str = _("%u folders").printf (folders_count);
@@ -161,9 +158,8 @@
161 files_count);158 files_count);
162 else159 else
163 str += _(" selected");160 str += _(" selected");
164 } else {161 } else /* folder_count = 0 and files_count > 0 */
165 str = _("%u items selected (%s)").printf (count, format_size ((int64) files_size));162 str = _("%u items selected (%s)").printf (files_count, format_size ((int64) files_size));
166 }
167163
168 status = str;164 status = str;
169165
@@ -177,7 +173,6 @@
177 foreach (var gof in files) {173 foreach (var gof in files) {
178 if (gof.is_folder ()) {174 if (gof.is_folder ()) {
179 folders_count++;175 folders_count++;
180 //scan_folder (gof.location);
181 } else {176 } else {
182 files_count++;177 files_count++;
183 files_size += PropertiesWindow.file_real_size (gof);178 files_size += PropertiesWindow.file_real_size (gof);

Subscribers

People subscribed via source and target branches

to all changes: