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

Subscribers

People subscribed via source and target branches

to all changes: