Merge lp:~vikoadi/scratch/restore-opened-files into lp:~elementary-apps/scratch/scratch

Proposed by Viko Adi Rahmawan
Status: Merged
Approved by: Cody Garver
Approved revision: 1307
Merged at revision: 1321
Proposed branch: lp:~vikoadi/scratch/restore-opened-files
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 54 lines (+2/-19)
2 files modified
src/MainWindow.vala (+1/-1)
src/Widgets/DocumentView.vala (+1/-18)
To merge this branch: bzr merge lp:~vikoadi/scratch/restore-opened-files
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+221765@code.launchpad.net

Commit message

Revert back to only modify opened-file on every window closing, fixes "Show last open tabs" feature

Description of the change

Revert back to only modify opened-file on every window closing, fixes "Show last open tabs" feature

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/MainWindow.vala'
2--- src/MainWindow.vala 2014-05-20 10:58:53 +0000
3+++ src/MainWindow.vala 2014-06-02 16:26:30 +0000
4@@ -452,7 +452,7 @@
5 docs.concat (view.docs.copy ());
6 });
7
8- string[] opened_files = { "" };//new string[docs.length ()];
9+ string[] opened_files = {};//new string[docs.length ()];
10 docs.foreach ((doc) => {
11 if (doc.file != null && doc.exists ())
12 opened_files += doc.file.get_uri ();
13
14=== modified file 'src/Widgets/DocumentView.vala'
15--- src/Widgets/DocumentView.vala 2014-04-13 17:12:52 +0000
16+++ src/Widgets/DocumentView.vala 2014-06-02 16:26:30 +0000
17@@ -164,12 +164,6 @@
18 doc.source_view.focus_in_event.connect (this.on_focus_in_event);
19 doc.source_view.drag_data_received.connect (this.drag_received);
20
21- // Update the opened-files setting
22- if (settings.show_at_start == "last-tabs" && doc.file != null) {
23- var files = settings.schema.get_strv ("opened-files");
24- files += doc.file.get_uri ();
25- settings.schema.set_strv ("opened-files", files);
26- }
27 }
28
29 private void on_doc_removed (Granite.Widgets.Tab tab) {
30@@ -179,17 +173,6 @@
31 doc.source_view.focus_in_event.disconnect (this.on_focus_in_event);
32 doc.source_view.drag_data_received.disconnect (this.drag_received);
33
34- // Update the opened-files setting
35- if (settings.show_at_start == "last-tabs") {
36- var files = settings.schema.get_strv ("opened-files");
37- string[] opened = { "" };
38- foreach (var file in files) {
39- if (file != doc.get_uri ())
40- opened += file;
41- }
42- settings.schema.set_strv ("opened-files", opened);
43- }
44-
45 // Check if the view is empty
46 if (this.is_empty ())
47 empty ();
48@@ -237,4 +220,4 @@
49 }
50 }
51 }
52-}
53\ No newline at end of file
54+}

Subscribers

People subscribed via source and target branches