Skip to content

Commit b73e075

Browse files
authored
Merge branch 'main' into danirabbit/abstractdirectoryview-bookmarklist
2 parents ac282c7 + 62b1a52 commit b73e075

File tree

4 files changed

+9
-20
lines changed

4 files changed

+9
-20
lines changed

libcore/Preferences.vala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ namespace Files {
2929
public bool show_remote_thumbnails {set; get; default = true;}
3030
public bool show_local_thumbnails {set; get; default = true;}
3131
public bool show_file_preview {set; get; default = true;}
32-
public bool singleclick_select {set; get; default = false;}
3332
public bool confirm_trash {set; get; default = true;}
34-
public bool force_icon_size {set; get; default = true;}
3533
public bool sort_directories_first { get; set; default = true; }
3634
public bool remember_history { get; set; default = true; }
3735

src/Application.vala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,6 @@ public class Files.Application : Gtk.Application {
263263
private void init_schemas () {
264264
/* Bind settings with GOFPreferences */
265265
var prefs = Files.Preferences.get_default ();
266-
if (app_settings.settings_schema.has_key ("singleclick-select")) {
267-
app_settings.bind ("singleclick-select", prefs, "singleclick-select", GLib.SettingsBindFlags.DEFAULT);
268-
}
269-
270266
Files.app_settings.bind ("show-hiddenfiles", prefs, "show-hidden-files", GLib.SettingsBindFlags.DEFAULT);
271267

272268
Files.app_settings.bind ("show-remote-thumbnails",

src/View/AbstractDirectoryView.vala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ namespace Files {
286286
public signal void path_change_request (GLib.File location, Files.OpenFlag flag, bool new_root);
287287
public signal void selection_changed (GLib.List<Files.File> gof_file);
288288

289+
private static Settings app_settings;
290+
289291
//TODO Rewrite in Object (), construct {} style
290292
protected AbstractDirectoryView (View.Slot _slot) {
291293
slot = _slot;
@@ -411,6 +413,10 @@ namespace Files {
411413
connect_directory_handlers (slot.directory);
412414
}
413415

416+
static construct {
417+
app_settings = new Settings ("io.elementary.files.preferences");
418+
}
419+
414420
~AbstractDirectoryView () {
415421
debug ("ADV destruct"); // Cannot reference slot here as it is already invalid
416422
}
@@ -452,9 +458,8 @@ namespace Files {
452458
prefs.notify["show-local-thumbnails"].connect (on_show_thumbnails_changed);
453459
prefs.notify["sort-directories-first"].connect (on_sort_directories_first_changed);
454460
prefs.notify["date-format"].connect (on_dateformat_changed);
455-
prefs.bind_property (
456-
"singleclick-select", this, "singleclick_select", BindingFlags.DEFAULT | BindingFlags.SYNC_CREATE
457-
);
461+
462+
app_settings.bind ("singleclick-select", this, "singleclick_select", SettingsBindFlags.DEFAULT);
458463

459464
model.set_should_sort_directories_first (Files.Preferences.get_default ().sort_directories_first);
460465
model.row_deleted.connect (on_row_deleted);
@@ -1458,7 +1463,6 @@ namespace Files {
14581463
}
14591464
}
14601465

1461-
var app_settings = new Settings ("io.elementary.files.preferences");
14621466
app_settings.set_boolean ("show-hiddenfiles", show);
14631467
}
14641468

src/View/Window.vala

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public class Files.View.Window : Hdy.ApplicationWindow {
7171
{"go-to", action_go_to, "s"},
7272
{"zoom", action_zoom, "s"},
7373
{"view-mode", action_view_mode, "u", "0" },
74-
{"singleclick-select", null, null, "false", change_state_single_click_select},
7574
{"tabhistory-restore", action_tabhistory_restore, "s" },
7675
{"folders-before-files", null, null, "true", change_state_folders_before_files},
7776
{"forward", action_forward, "i"},
@@ -123,6 +122,7 @@ public class Files.View.Window : Hdy.ApplicationWindow {
123122
add_action (app_settings.create_action ("show-local-thumbnails"));
124123
add_action (app_settings.create_action ("show-remote-thumbnails"));
125124
add_action (app_settings.create_action ("show-hiddenfiles"));
125+
add_action (app_settings.create_action ("singleclick-select"));
126126

127127
add_action_entries (WIN_ENTRIES, this);
128128
undo_actions_set_insensitive ();
@@ -280,9 +280,6 @@ public class Files.View.Window : Hdy.ApplicationWindow {
280280

281281
/** Apply preferences */
282282
var prefs = Files.Preferences.get_default (); // Bound to settings schema by Application
283-
get_action ("show-local-thumbnails").set_state (prefs.show_local_thumbnails);
284-
get_action ("show-remote-thumbnails").set_state (prefs.show_remote_thumbnails);
285-
get_action ("singleclick-select").set_state (prefs.singleclick_select);
286283
get_action ("folders-before-files").set_state (prefs.sort_directories_first);
287284

288285
button_forward.slow_press.connect (() => {
@@ -1038,12 +1035,6 @@ public class Files.View.Window : Hdy.ApplicationWindow {
10381035
doing_undo_redo = false;
10391036
}
10401037

1041-
public void change_state_single_click_select (GLib.SimpleAction action) {
1042-
bool state = !action.state.get_boolean ();
1043-
action.set_state (new GLib.Variant.boolean (state));
1044-
Files.Preferences.get_default ().singleclick_select = state;
1045-
}
1046-
10471038
public void change_state_folders_before_files (GLib.SimpleAction action) {
10481039
bool state = !action.state.get_boolean ();
10491040
action.set_state (new GLib.Variant.boolean (state));

0 commit comments

Comments
 (0)