Merge lp:~3v1n0/unity-lens-files/add-path-to-preview into lp:unity-lens-files

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: 265
Merged at revision: 264
Proposed branch: lp:~3v1n0/unity-lens-files/add-path-to-preview
Merge into: lp:unity-lens-files
Diff against target: 36 lines (+26/-0)
1 file modified
src/daemon.vala (+26/-0)
To merge this branch: bzr merge lp:~3v1n0/unity-lens-files/add-path-to-preview
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+280901@code.launchpad.net

Commit message

Daemon: show path of the current file in preview

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

+1

review: Approve
Revision history for this message
Amr Ibrahim (amribrahim1987) wrote :

Has this landed in Xenial?

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Yes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/daemon.vala'
--- src/daemon.vala 2013-07-02 05:55:19 +0000
+++ src/daemon.vala 2015-12-17 18:01:33 +0000
@@ -1046,6 +1046,32 @@
1046 preview.add_action (email_action);1046 preview.add_action (email_action);
1047 }1047 }
1048 }1048 }
1049
1050 try
1051 {
1052 var path = Path.get_dirname (Filename.from_uri (real_uri));
1053 var home = Environment.get_home_dir ();
1054
1055 if (path.has_prefix (home))
1056 {
1057 var relative_path = path.substring (home.length);
1058
1059 if (relative_path[0] == '\0')
1060 {
1061 path = _("Home");
1062 }
1063 else
1064 {
1065 path = "~" + relative_path;
1066 }
1067 }
1068
1069 preview.add_info (new InfoHint ("path", _("Path"), null, path));
1070 }
1071 catch (Error e)
1072 {
1073 warning ("Failed to get path for '%s': %s", real_uri, e.message);
1074 }
1049 }1075 }
1050 else1076 else
1051 {1077 {

Subscribers

People subscribed via source and target branches