[gnome-usage] settings: Unify GLib.Settings and Usage.Settings
- From: Gitlab Administrative User <gitlab src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage] settings: Unify GLib.Settings and Usage.Settings
- Date: Mon, 6 Nov 2017 10:31:32 +0000 (UTC)
commit 2e9f7bf430c117cdea21ec681d4cb0ec55af7b27
Author: Felipe Borges <felipeborges gnome org>
Date: Mon Nov 6 11:29:46 2017 +0100
settings: Unify GLib.Settings and Usage.Settings
We can encapsulate both in the same class for clarity.
src/process-row.vala | 2 +-
src/settings.vala | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/process-row.vala b/src/process-row.vala
index a7e9f31..f8e34ce 100644
--- a/src/process-row.vala
+++ b/src/process-row.vala
@@ -218,7 +218,7 @@ namespace Usage
}
else
{
- var settings = new GLib.Settings ("org.gnome.Usage");
+ var settings = Settings.get_default();
if (process.cmdline in settings.get_strv ("unkillable-processes"))
return;
diff --git a/src/settings.vala b/src/settings.vala
index b2783b6..83bb531 100644
--- a/src/settings.vala
+++ b/src/settings.vala
@@ -22,7 +22,7 @@ using Gtk;
namespace Usage {
- public class Settings : Object
+ public class Settings : GLib.Settings
{
public uint graph_timespan { get; set; default = 15000;}
public uint graph_max_samples { get; set; default = 20; }
@@ -40,5 +40,10 @@ namespace Usage {
return settings;
}
+
+ public Settings()
+ {
+ Object(schema_id: "org.gnome.Usage");
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]