[gnome-builder] recent-projects: allow restricting discovery to the recent-projects.xbel
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] recent-projects: allow restricting discovery to the recent-projects.xbel
- Date: Tue, 1 Mar 2016 07:12:40 +0000 (UTC)
commit 4d8c9ff005138ed9eb51fd10292bb94f26c0633d
Author: Christian Hergert <christian hergert me>
Date: Mon Feb 29 23:12:19 2016 -0800
recent-projects: allow restricting discovery to the recent-projects.xbel
If mining the system for projects is disabled, just load the bookmarks
file containing our recent projects.
libide/ide-application.c | 7 ++++---
libide/ide-recent-projects.c | 7 +++++++
libide/ide-recent-projects.h | 1 +
3 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/libide/ide-application.c b/libide/ide-application.c
index 36f2e6d..dfb5414 100644
--- a/libide/ide-application.c
+++ b/libide/ide-application.c
@@ -538,12 +538,13 @@ ide_application_get_recent_projects (IdeApplication *self)
if (self->recent_projects == NULL)
{
g_autoptr(GSettings) settings = NULL;
+ gboolean recent_only;
- self->recent_projects = ide_recent_projects_new ();
settings = g_settings_new ("org.gnome.builder");
+ recent_only = !g_settings_get_boolean (settings, "enable-project-miners");
- if (g_settings_get_boolean (settings, "enable-project-miners"))
- ide_recent_projects_discover_async (self->recent_projects, NULL, NULL, NULL);
+ self->recent_projects = ide_recent_projects_new ();
+ ide_recent_projects_discover_async (self->recent_projects, recent_only, NULL, NULL, NULL);
}
return self->recent_projects;
diff --git a/libide/ide-recent-projects.c b/libide/ide-recent-projects.c
index c2aad4b..5240836 100644
--- a/libide/ide-recent-projects.c
+++ b/libide/ide-recent-projects.c
@@ -362,6 +362,7 @@ ide_recent_projects_get_projects (IdeRecentProjects *self)
void
ide_recent_projects_discover_async (IdeRecentProjects *self,
+ gboolean recent_only,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -388,6 +389,12 @@ ide_recent_projects_discover_async (IdeRecentProjects *self,
ide_recent_projects_load_recent (self);
+ if (recent_only)
+ {
+ g_task_return_boolean (task, TRUE);
+ return;
+ }
+
self->active = self->miners->len;
if (self->active == 0)
diff --git a/libide/ide-recent-projects.h b/libide/ide-recent-projects.h
index b1df203..e5a2def 100644
--- a/libide/ide-recent-projects.h
+++ b/libide/ide-recent-projects.h
@@ -37,6 +37,7 @@ gboolean ide_recent_projects_get_busy (IdeRecentProjects *s
void ide_recent_projects_remove (IdeRecentProjects *self,
GList *project_infos);
void ide_recent_projects_discover_async (IdeRecentProjects *self,
+ gboolean recent_only,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]