Merge lp:~vikoadi/pantheon-files/fix-path-completion into lp:~elementary-apps/pantheon-files/trunk

Proposed by Viko Adi Rahmawan
Status: Merged
Approved by: Danielle Foré
Approved revision: 1607
Merged at revision: 1652
Proposed branch: lp:~vikoadi/pantheon-files/fix-path-completion
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 23 lines (+9/-2)
1 file modified
src/View/LocationBar.vala (+9/-2)
To merge this branch: bzr merge lp:~vikoadi/pantheon-files/fix-path-completion
Reviewer Review Type Date Requested Status
Viko Adi Rahmawan (community) Needs Resubmitting
Jeremy Wootten Approve
Review via email: mp+237313@code.launchpad.net

Commit message

Fix locationbar completion (lp:1376775)

Description of the change

Fix locationbar completion (lp:1376775)

using get_basename () for "/folder/name/" will return "name" in to_search so i just set to_search value to "" if we have "/" as path suffix

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

In line 12, last_slash + 1 < text.length could be changed to last_slash <= text.length to avoid an unnecessary arithmetic operation.

Other than that, I approve.

review: Approve
Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

thanks Jeremy, this bug really drive me mad

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

Thanks for fixing this.

If you have time to try out lp:~jeremywootten/pantheon-files/all-views-vala
I would be grateful. This a substantial re-write of some of the code as
well as addressing a number of bugs so the more testing it gets the better,
to avoid any regressions.

On 10 October 2014 02:32, Viko Adi Rahmawan <email address hidden> wrote:

> thanks Jeremy, this bug really drive me mad
> --
>
> https://code.launchpad.net/~vikoadi/pantheon-files/fix-path-completion/+merge/237313
> You are reviewing the proposed merge of
> lp:~vikoadi/pantheon-files/fix-path-completion into lp:pantheon-files.
>

Revision history for this message
RabbitBot (rabbitbot-a) wrote :

Attempt to merge into lp:pantheon-files failed due to conflicts:

text conflict in src/View/LocationBar.vala

1607. By Viko Adi Rahmawan

merge trunk

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

merge trunk

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/View/LocationBar.vala'
2--- src/View/LocationBar.vala 2014-11-24 21:24:29 +0000
3+++ src/View/LocationBar.vala 2014-11-25 22:50:28 +0000
4@@ -311,10 +311,17 @@
5
6 public void on_need_completion () {
7 File file = get_file_for_path (text);
8- to_search = file.get_basename ();
9+
10+ // don't use get_basename (), it will return "folder" for "/folder/"
11+ int last_slash = text.last_index_of_char ('/');
12+ if (last_slash > -1 && last_slash < text.length)
13+ to_search = text.slice (last_slash + 1, text.length);
14+ else
15+ to_search = "";
16+
17 autocompleted = false;
18 multiple_completions = false;
19-
20+
21 if (to_search != "" && file.has_parent (null))
22 file = file.get_parent ();
23 else

Subscribers

People subscribed via source and target branches

to all changes: