Merge lp://staging/~stolowski/unity-lens-files/unity-lens-files.previews into lp://staging/unity-lens-files

Proposed by Paweł Stołowski
Status: Merged
Approved by: Michal Hruby
Approved revision: 251
Merged at revision: 232
Proposed branch: lp://staging/~stolowski/unity-lens-files/unity-lens-files.previews
Merge into: lp://staging/unity-lens-files
Diff against target: 389 lines (+246/-35)
5 files modified
configure.ac (+1/-1)
src/daemon.vala (+208/-7)
src/folder.vala (+11/-1)
src/locate.vala (+11/-11)
src/utils.vala (+15/-15)
To merge this branch: bzr merge lp://staging/~stolowski/unity-lens-files/unity-lens-files.previews
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
Review via email: mp+118700@code.staging.launchpad.net

Commit message

Implemented support for previews.

Description of the change

Implemented support for previews.

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote :

First of all, please bump the required libunity version to 5.93 in configure script.

8 + scope.preview_uri.connect (preview);

Wrong indent.

16 + private void count_directory_items (string top_dir, ref int count, ref int64 total_size, bool recurse=false)

Can you rename the top_dir to express clearly if it's a uri or a path? (I see File.new_for_uri, and "string path" later). Or perhaps pass it a File + use File.get_child()).

61 + return "%lld B".printf (size);

The format string differs for 32 and 64bit machines, use int64.FORMAT

69 + return "%.1f GB".printf ((float)size / (1000*1000*1000));

I'm not sure if we're supposed to use 10-based or 2^10-based numbers, IIRC the filters use 2^10, but there's lp:882352.

74 + debug (@"Previewing: $uri");

Please don't use template strings in functions which support printf-formatting.

More generally, there are quite a few uncaught exceptions that vala reports, would be nice to handle those (especially when inside loops - see the count* method).

Also too many warnings about deprecated FILE_ATTRIBUTE usage, we now require vala 0.16, so running a tiny sed on the sources would be awesome ;)

review: Needs Fixing
Revision history for this message
Michal Hruby (mhr3) wrote :

And one more: previewing "inode/folder" gives "Open File" action, should be "Open Fodler".

Revision history for this message
Paweł Stołowski (stolowski) wrote :

Fixed according to comment and latest changes from design.
10-based number are in line with nautilus.

Revision history for this message
Michal Hruby (mhr3) wrote :

Looking good, one thing I noticed:

162 + preview.add_info (new InfoHint.with_variant ("file-count", _("Number of files"), null, new GLib.Variant.uint32(count)));

The latest design puts this info into "Size" field.

Revision history for this message
Paweł Stołowski (stolowski) wrote :

Fixed to match latest design.

Revision history for this message
Michal Hruby (mhr3) wrote :

Yey!

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

No commit message specified.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches