Merge lp:~teemperor/pantheon-terminal/fix-1353010-comma-in-paths into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by Raphael Isemann
Status: Merged
Approved by: David Gomes
Approved revision: 594
Merged at revision: 595
Proposed branch: lp:~teemperor/pantheon-terminal/fix-1353010-comma-in-paths
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 114 lines (+20/-17)
3 files modified
org.pantheon.terminal.gschema.xml (+2/-2)
src/PantheonTerminalWindow.vala (+16/-13)
src/Settings.vala (+2/-2)
To merge this branch: bzr merge lp:~teemperor/pantheon-terminal/fix-1353010-comma-in-paths
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Raphael Isemann (community) Needs Resubmitting
Niclas Lockner (community) Needs Fixing
Review via email: mp+229712@code.launchpad.net

Commit message

Fixes remember-tabs setting, changes the type of dconf-key to a string-array.

Description of the change

We change the type of the dconf-key to a string-array.

Code stays 1 to 1 like the previous code, this is just about fixing the bug.

Codecleanup will be a different merge-request.

To post a comment you must log in.
Revision history for this message
Niclas Lockner (niclasl) wrote :

The value of the remember-tabs dconf key isn't respected. Saved tabs are restored even if remember-tabs is false.

The branch fixes the related bug though.

review: Needs Fixing
594. By Raphael Isemann

We are now respecting the remember-tabs setting

Revision history for this message
Raphael Isemann (teemperor) wrote :

Thanks for the review, it should work now.

review: Needs Resubmitting
Revision history for this message
Raphael Isemann (teemperor) wrote :

Oh wait, didn't wanted to review with resubmit...

Revision history for this message
David Gomes (davidgomes) :
review: Approve
Revision history for this message
David Gomes (davidgomes) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'org.pantheon.terminal.gschema.xml'
2--- org.pantheon.terminal.gschema.xml 2014-04-29 12:59:41 +0000
3+++ org.pantheon.terminal.gschema.xml 2014-08-07 08:59:07 +0000
4@@ -34,8 +34,8 @@
5 <summary>The saved state of the window.</summary>
6 <description>The saved state of the window.</description>
7 </key>
8- <key name="tabs" type="s">
9- <default>""</default>
10+ <key name="tabs" type="as">
11+ <default>[]</default>
12 <summary>List of tabs which were active when the window was closed</summary>
13 <description>List of tabs which were active when the window was closed</description>
14 </key>
15
16=== modified file 'src/PantheonTerminalWindow.vala'
17--- src/PantheonTerminalWindow.vala 2014-08-05 23:02:15 +0000
18+++ src/PantheonTerminalWindow.vala 2014-08-07 08:59:07 +0000
19@@ -38,7 +38,7 @@
20
21 public TerminalWidget current_terminal = null;
22 private bool is_fullscreen = false;
23- private string saved_tabs;
24+ private string[] saved_tabs;
25
26 const string ui_string = """
27 <ui>
28@@ -275,7 +275,7 @@
29 saved_state.window_width = settings.window_width;
30 saved_state.opening_x = -1;
31 saved_state.opening_y = -1;
32- saved_state.tabs = "";
33+ saved_state.tabs = {};
34 }
35
36 private void on_tab_added (Granite.Widgets.Tab tab) {
37@@ -399,7 +399,7 @@
38 }
39
40 private void reset_saved_tabs () {
41- saved_state.tabs = "";
42+ saved_state.tabs = {};
43 }
44
45 private void on_switch_page (Granite.Widgets.Tab? old,
46@@ -411,16 +411,19 @@
47 }
48
49 private void open_tabs () {
50- string tabs = saved_tabs;
51- if (tabs == "" || !settings.remember_tabs ||
52- tabs.replace (",", " ").strip () == "") {
53- new_tab ();
54- } else {
55- foreach (string loc in tabs.split (",")) {
56- if (loc != "")
57+ string[] tabs = saved_tabs;
58+ if (settings.remember_tabs) {
59+ if (tabs.length == 0) {
60+ new_tab ();
61+ } else {
62+ foreach (string loc in tabs) {
63 new_tab (loc);
64+ }
65 }
66+ } else {
67+ new_tab ("");
68 }
69+
70 }
71
72 private void new_tab (string directory="", string? program=null) {
73@@ -523,12 +526,12 @@
74 protected override bool delete_event (Gdk.EventAny event) {
75 update_saved_window_state ();
76 action_quit ();
77- string tabs = "";
78+ string[] tabs = {};
79 var tabs_to_terminate = new GLib.List <TerminalWidget> ();
80
81 foreach (var t in terminals) {
82 t = (TerminalWidget) t;
83- tabs += t.get_shell_location () + ",";
84+ tabs += t.get_shell_location ();
85 if (t.has_foreground_process ()) {
86 var d = new ForegroundProcessDialog.before_close ();
87 if (d.run () == 1) {
88@@ -675,4 +678,4 @@
89 action_fullscreen }
90 };
91 }
92-}
93+}
94\ No newline at end of file
95
96=== modified file 'src/Settings.vala'
97--- src/Settings.vala 2014-07-03 23:20:40 +0000
98+++ src/Settings.vala 2014-08-07 08:59:07 +0000
99@@ -40,7 +40,7 @@
100 public int window_width { get; set; }
101 public int window_height { get; set; }
102 public PantheonTerminalWindowState window_state { get; set; }
103- public string tabs { get; set; }
104+ public string[] tabs { get; set; }
105 public int opening_x { get; set; }
106 public int opening_y { get; set; }
107
108@@ -77,4 +77,4 @@
109 base ("org.pantheon.terminal.settings");
110 }
111 }
112-}
113+}
114\ No newline at end of file

Subscribers

People subscribed via source and target branches