Merge lp:~arayaq/pantheon-terminal/fix-1351898 into lp:~elementary-apps/pantheon-terminal/trunk
Proposed by
Angel Araya
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Cody Garver | ||||
Approved revision: | 616 | ||||
Merged at revision: | 621 | ||||
Proposed branch: | lp:~arayaq/pantheon-terminal/fix-1351898 | ||||
Merge into: | lp:~elementary-apps/pantheon-terminal/trunk | ||||
Diff against target: |
32 lines (+20/-1) 1 file modified
src/PantheonTerminalWindow.vala (+20/-1) |
||||
To merge this branch: | bzr merge lp:~arayaq/pantheon-terminal/fix-1351898 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
David Gomes (community) | Needs Fixing | ||
Review via email:
|
Commit message
Don't restore tabs with nonexistent paths (lp:1351898)
Description of the change
When restoring the tabs checks which paths does exist and add them, the rest goes omitted. If all the paths are nonexistent creates a single tab at HOME.
To post a comment you must log in.
Good work Araya.
You should change the code style (placement of `{`) to the elementary
coding standard. It can be found on the website, opening braces are not on
a new line etc.
On Aug 20, 2014 8:42 AM, "Angel Araya" <email address hidden> wrote:
> Angel Araya has proposed merging lp:~arayaq/pantheon-terminal/fix-1351898 /code.launchpad .net/~arayaq/ pantheon- terminal/ fix-1351898/ +merge/ 231493 /code.launchpad .net/~arayaq/ pantheon- terminal/ fix-1351898/ +merge/ 231493 rminalWindow. vala' minalWindow. vala 2014-08-09 17:05:43 +0000 minalWindow. vala 2014-08-20 03:11:15 +0000
> into lp:pantheon-terminal.
>
> Requested reviews:
> elementary Apps team (elementary-apps)
>
> For more details, see:
>
> https:/
>
> When restoring the tabs checks which paths does exist and add them, the
> rest goes omitted. If all the paths are nonexistent creates a single tab at
> HOME.
> --
>
> https:/
> Your team elementary Apps team is requested to review the proposed merge
> of lp:~arayaq/pantheon-terminal/fix-1351898 into lp:pantheon-terminal.
>
> === modified file 'src/PantheonTe
> --- src/PantheonTer
> +++ src/PantheonTer
> @@ -407,8 +407,35 @@
> if (tabs.length == 0) {
> new_tab ();
> } else {
> - foreach (string loc in tabs) {
> - new_tab (loc);
> +
> + /* Check wether the dir exists (LP #1351898) */
> + int null_dirs = 0;
> + for (int i = 0; i < tabs.length; i++)
> + {
> + File file = File.new_for_path (tabs[i]);
> + if (file.query_exists () == false)
> + {
> + null_dirs++;
> + tabs[i] = "";
> + }
> +
> + if (null_dirs == tabs.length)
> + {
> + tabs[0] = "~";
> + }
> + }
> +
> + foreach (string loc in tabs)
> + {
> +
> + if (loc == "")
> + {
> + continue;
> + }
> + else
> + {
> + new_tab (loc);
> + }
> }
> }
> } else {
>
>
>