19
19
*/
20
20
21
21
[DBus (name = " org.freedesktop.systemd1.Manager" )]
22
- public interface SystemdManager : GLib . Object {
23
- public abstract async string get_unit_file_state (string unit_file ) throws GLib . Error ;
24
- public abstract async void enable_unit_files (string [] unit_files , bool runtime , bool replace ) throws GLib . Error ;
25
- public abstract async void start_unit (string name , string mode ) throws GLib . Error ;
22
+ public interface SystemdManager : Object {
23
+ public abstract async string get_unit_file_state (string unit_file ) throws Error ;
24
+ public abstract async void enable_unit_files (string [] unit_files , bool runtime , bool replace ) throws Error ;
25
+ public abstract async void start_unit (string name , string mode ) throws Error ;
26
26
}
27
27
28
- public class SettingsDaemon.Backends.Housekeeping : GLib . Object {
29
- private GLib . Settings housekeeping_settings;
28
+ public class SettingsDaemon.Backends.Housekeeping : Object {
29
+ private Settings housekeeping_settings;
30
30
private SystemdManager ? systemd;
31
31
32
32
construct {
33
- housekeeping_settings = new GLib . Settings (" io.elementary.settings-daemon.housekeeping" );
33
+ housekeeping_settings = new Settings (" io.elementary.settings-daemon.housekeeping" );
34
34
housekeeping_settings. changed. connect (() = > {
35
35
enable_systemd_tmpfiles. begin ();
36
36
write_systemd_tmpfiles_config. begin ();
@@ -48,8 +48,8 @@ public class SettingsDaemon.Backends.Housekeeping : GLib.Object {
48
48
private async void enable_systemd_tmpfiles () {
49
49
if (systemd == null ) {
50
50
try {
51
- systemd = yield GLib . Bus . get_proxy (
52
- GLib . BusType . SESSION ,
51
+ systemd = yield Bus . get_proxy (
52
+ BusType . SESSION ,
53
53
" org.freedesktop.systemd1" ,
54
54
" /org/freedesktop/systemd1"
55
55
);
@@ -75,15 +75,15 @@ public class SettingsDaemon.Backends.Housekeeping : GLib.Object {
75
75
// Write (or delete) a config file in ~/.config/user-tmpfiles.d to configure the systemd timer for cleaning up the user's
76
76
// downloads folder based on the configured age in GSettings
77
77
private async void write_systemd_tmpfiles_config () {
78
- var config_path = GLib . Path . build_filename (
79
- GLib . Environment . get_user_config_dir (),
78
+ var config_path = Path . build_filename (
79
+ Environment . get_user_config_dir (),
80
80
" user-tmpfiles.d" ,
81
81
" io.elementary.settings-daemon.downloads-folder.conf"
82
82
);
83
83
84
84
var downloads_cleanup_enabled = housekeeping_settings. get_boolean (" cleanup-downloads-folder" );
85
85
86
- var config_file = GLib . File . new_for_path (config_path);
86
+ var config_file = File . new_for_path (config_path);
87
87
if (! config_file. get_parent (). query_exists ()) {
88
88
if (! downloads_cleanup_enabled) {
89
89
// No point continuing if cleanup isn't enabled
@@ -100,11 +100,11 @@ public class SettingsDaemon.Backends.Housekeeping : GLib.Object {
100
100
101
101
int downloads_cleanup_days = housekeeping_settings. get_int (" old-files-age" );
102
102
103
- var downloads_folder = GLib . Environment . get_user_special_dir (
104
- GLib . UserDirectory . DOWNLOAD
103
+ var downloads_folder = Environment . get_user_special_dir (
104
+ UserDirectory . DOWNLOAD
105
105
);
106
106
107
- var home_folder = GLib . Environment . get_home_dir ();
107
+ var home_folder = Environment . get_home_dir ();
108
108
if (File . new_for_path (home_folder). equal (File . new_for_path (downloads_folder))) {
109
109
// TODO: Possibly throw a notification as a warning here? This will currently just silently fail
110
110
// and no downloads will be cleaned up, despite the setting being enabled
@@ -117,7 +117,7 @@ public class SettingsDaemon.Backends.Housekeeping : GLib.Object {
117
117
try {
118
118
yield config_file. delete_async ();
119
119
} catch (Error e) {
120
- if (! (e is GLib . IOError . NOT_FOUND )) {
120
+ if (! (e is IOError . NOT_FOUND )) {
121
121
warning (" Unable to delete systemd-tmpfiles config: %s " , e. message);
122
122
}
123
123
}
@@ -140,7 +140,7 @@ public class SettingsDaemon.Backends.Housekeeping : GLib.Object {
140
140
141
141
FileOutputStream os = config_stream. output_stream as FileOutputStream ;
142
142
try {
143
- yield os. write_all_async (config. data, GLib . Priority . DEFAULT , null , null );
143
+ yield os. write_all_async (config. data, Priority . DEFAULT , null , null );
144
144
} catch (Error e) {
145
145
warning (" Unable to write systemd-tmpfiles config: %s " , e. message);
146
146
}
0 commit comments