[gnome-builder] new GSetting to disable mining projects at startup
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] new GSetting to disable mining projects at startup
- Date: Tue, 1 Mar 2016 07:12:35 +0000 (UTC)
commit 2ce496b2ae90bfc5b64f1ad05bc6efe22a9f736b
Author: Akshaya Kakkilaya <akshaya kakkilaya gmail com>
Date: Sat Feb 27 10:25:58 2016 +0530
new GSetting to disable mining projects at startup
Some users may prefer not to have their directories searched.
https://bugzilla.gnome.org/show_bug.cgi?id=762501
data/gsettings/org.gnome.builder.gschema.xml | 5 +++++
libide/ide-application.c | 7 ++++++-
libide/preferences/ide-preferences-builtin.c | 10 ++++++++++
3 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/data/gsettings/org.gnome.builder.gschema.xml b/data/gsettings/org.gnome.builder.gschema.xml
index acb2421..1f6bdcc 100644
--- a/data/gsettings/org.gnome.builder.gschema.xml
+++ b/data/gsettings/org.gnome.builder.gschema.xml
@@ -20,5 +20,10 @@
<summary>Night Mode</summary>
<description>Prefer dark application chrome.</description>
</key>
+ <key name="enable-project-miners" type="b">
+ <default>true</default>
+ <summary>Mine projects</summary>
+ <description>Search directories for projects.</description>
+ </key>
</schema>
</schemalist>
diff --git a/libide/ide-application.c b/libide/ide-application.c
index a62ae9d..36f2e6d 100644
--- a/libide/ide-application.c
+++ b/libide/ide-application.c
@@ -537,8 +537,13 @@ ide_application_get_recent_projects (IdeApplication *self)
if (self->recent_projects == NULL)
{
+ g_autoptr(GSettings) settings = NULL;
+
self->recent_projects = ide_recent_projects_new ();
- ide_recent_projects_discover_async (self->recent_projects, NULL, NULL, NULL);
+ settings = g_settings_new ("org.gnome.builder");
+
+ if (g_settings_get_boolean (settings, "enable-project-miners"))
+ ide_recent_projects_discover_async (self->recent_projects, NULL, NULL, NULL);
}
return self->recent_projects;
diff --git a/libide/preferences/ide-preferences-builtin.c b/libide/preferences/ide-preferences-builtin.c
index a9784f4..ac7b95c 100644
--- a/libide/preferences/ide-preferences-builtin.c
+++ b/libide/preferences/ide-preferences-builtin.c
@@ -246,6 +246,15 @@ ide_preferences_builtin_register_build (IdePreferences *preferences)
ide_preferences_add_spin_button (preferences, "build", "basic", "org.gnome.builder.build", "parallel",
"/org/gnome/builder/build/", _("Build Workers"), _("Number of parallel build workers"), NULL, 0);
}
+static void
+ide_preferences_builtin_register_projects (IdePreferences *preferences)
+{
+ ide_preferences_add_page (preferences, "projects", _("Projects"), 800);
+
+ ide_preferences_add_list_group (preferences, "projects", "discovery", _("Project Discovery"), 0);
+ ide_preferences_add_switch (preferences, "projects", "discovery", "org.gnome.builder",
"enable-project-miners", NULL, NULL, _("Discover projects on my computer"), _("Scan your computer for
existing projects"), NULL, 0);
+}
+
void
_ide_preferences_builtin_register (IdePreferences *preferences)
{
@@ -257,4 +266,5 @@ _ide_preferences_builtin_register (IdePreferences *preferences)
ide_preferences_builtin_register_keyboard (preferences);
ide_preferences_builtin_register_plugins (preferences);
ide_preferences_builtin_register_build (preferences);
+ ide_preferences_builtin_register_projects (preferences);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]