Merge lp:~tintou/pantheon-files/file-chooser-no-static into lp:~elementary-apps/pantheon-files/trunk

Proposed by Corentin Noël
Status: Merged
Approved by: Danielle Foré
Approved revision: 2575
Merged at revision: 2575
Proposed branch: lp:~tintou/pantheon-files/file-chooser-no-static
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 45 lines (+8/-8)
2 files modified
filechooser-module/FileChooserDialog.vala (+6/-6)
filechooser-module/Plugin.vala (+2/-2)
To merge this branch: bzr merge lp:~tintou/pantheon-files/file-chooser-no-static
Reviewer Review Type Date Requested Status
Danielle Foré Approve
Adam Bieńkowski (community) code / testing Approve
Review via email: mp+325261@code.launchpad.net

Commit message

* Don't use static fields when it depends on the class, use unowned variables when needed

To post a comment you must log in.
Revision history for this message
Adam Bieńkowski (donadigo) wrote :

Great, fixes the issue, thanks.

review: Approve (code / testing)
Revision history for this message
Danielle Foré (danrabbit) wrote :

Can confirm, does the thing :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'filechooser-module/FileChooserDialog.vala'
2--- filechooser-module/FileChooserDialog.vala 2017-02-11 17:48:07 +0000
3+++ filechooser-module/FileChooserDialog.vala 2017-06-07 17:44:50 +0000
4@@ -23,12 +23,6 @@
5 * in the Gtk+3 source code package. Changes to that file could break this code.
6 ***/
7 public class CustomFileChooserDialog : Object {
8- private static Gtk.FileChooserDialog chooser_dialog;
9- private static Gtk.Widget rootwidget;
10-
11- private static Gtk.Box container_box;
12- private static Gtk.Button? gtk_folder_button = null;
13-
14 /* Response to get parent of the bottom box */
15 private const int BUTTON_RESPONSE = -6;
16
17@@ -38,6 +32,12 @@
18 private const string[] GTK_TREEVIEW_PATH = { "browse_files_stack", "browse_files_swin", "browse_files_tree_view" };
19 private const string PLACES_SIDEBAR_PATH = "places_sidebar";
20
21+ private unowned Gtk.FileChooserDialog chooser_dialog;
22+ private unowned Gtk.Widget rootwidget;
23+
24+ private unowned Gtk.Box container_box;
25+ private unowned Gtk.Button? gtk_folder_button = null;
26+
27 private GLib.Queue<string> previous_paths;
28 private GLib.Queue<string> next_paths;
29
30
31=== modified file 'filechooser-module/Plugin.vala'
32--- filechooser-module/Plugin.vala 2017-02-10 19:35:18 +0000
33+++ filechooser-module/Plugin.vala 2017-06-07 17:44:50 +0000
34@@ -22,9 +22,9 @@
35
36 public class PantheonModule.FileChooserDialog : GLib.Object {
37 /* Catching dialogs section by: tintou (https://launchpad.net/~tintou) */
38- Gee.TreeSet<Gtk.FileChooserDialog> tree_set;
39+ Gee.TreeSet<unowned Gtk.FileChooserDialog> tree_set;
40 public FileChooserDialog () {
41- tree_set = new Gee.TreeSet<Gtk.FileChooserDialog> ();
42+ tree_set = new Gee.TreeSet<unowned Gtk.FileChooserDialog> ();
43 /* We need to register the Gtk.Dialog class first */
44 (typeof (Gtk.Dialog)).class_ref ();
45 /* It's the only way to get every new window */

Subscribers

People subscribed via source and target branches

to all changes: