[gnome-builder/wip/project-selector] project-selector: remove org.gnome.builder gsettings



commit 37666f22b2846cc53f82bdac2b9cf647b85a53f8
Author: Christian Hergert <christian hergert me>
Date:   Tue Apr 7 21:26:14 2015 -0700

    project-selector: remove org.gnome.builder gsettings
    
    We don't need this anymore since we are using GtkRecentManager.

 configure.ac                                    |    1 -
 data/gsettings.mk                               |    1 -
 data/gsettings/org.gnome.builder.gschema.xml.in |    9 -----
 src/app/gb-application.c                        |   39 -----------------------
 src/dialogs/gb-projects-dialog.c                |   38 ----------------------
 5 files changed, 0 insertions(+), 88 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index fb14a2e..725dc19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,7 +71,6 @@ AC_CONFIG_FILES([
        src/util/gb-version.h
        data/icons/Makefile
        data/libide-1.0.pc
-       data/gsettings/org.gnome.builder.gschema.xml
        data/gsettings/org.gnome.builder.editor.gschema.xml
        data/gsettings/org.gnome.builder.editor.language.gschema.xml
        data/gsettings/org.gnome.builder.experimental.gschema.xml
diff --git a/data/gsettings.mk b/data/gsettings.mk
index 3526f5f..cb77de0 100644
--- a/data/gsettings.mk
+++ b/data/gsettings.mk
@@ -1,5 +1,4 @@
 gsettingsschema_in_files = \
-       data/gsettings/org.gnome.builder.gschema.xml.in \
        data/gsettings/org.gnome.builder.editor.gschema.xml.in \
        data/gsettings/org.gnome.builder.editor.language.gschema.xml.in \
        data/gsettings/org.gnome.builder.experimental.gschema.xml.in \
diff --git a/src/app/gb-application.c b/src/app/gb-application.c
index 970f39e..59c459e 100644
--- a/src/app/gb-application.c
+++ b/src/app/gb-application.c
@@ -290,43 +290,6 @@ on_create_buffer (IdeBufferManager *buffer_manager,
 }
 
 static void
-gb_application_add_recent_project (GbApplication *self,
-                                   IdeContext    *context)
-{
-  GPtrArray *ar;
-  GSettings *settings;
-  gchar **project_history;
-  GFile *project_file;
-  gchar *uri;
-  gsize i;
-
-  g_assert (GB_IS_APPLICATION (self));
-  g_assert (IDE_IS_CONTEXT (context));
-
-  project_file = ide_context_get_project_file (context);
-  uri = g_file_get_uri (project_file);
-
-  settings = g_settings_new ("org.gnome.builder");
-  project_history = g_settings_get_strv (settings, "project-history");
-
-  ar = g_ptr_array_new ();
-  g_ptr_array_add (ar, uri);
-  for (i = 0; project_history [i]; i++)
-    {
-      if (!g_str_equal (uri, project_history [i]))
-        g_ptr_array_add (ar, project_history [i]);
-    }
-  g_ptr_array_add (ar, NULL);
-
-  g_settings_set_strv (settings, "project-history", (const gchar * const *)ar->pdata);
-
-  g_ptr_array_free (ar, TRUE);
-  g_strfreev (project_history);
-  g_free (uri);
-  g_object_unref (settings);
-}
-
-static void
 gb_application__context_new_cb (GObject      *object,
                                 GAsyncResult *result,
                                 gpointer      user_data)
@@ -358,8 +321,6 @@ gb_application__context_new_cb (GObject      *object,
       goto cleanup;
     }
 
-  gb_application_add_recent_project (self, context);
-
   {
     IdeVcs *vcs;
     GFile *workdir;
diff --git a/src/dialogs/gb-projects-dialog.c b/src/dialogs/gb-projects-dialog.c
index 0cc61bf..79617db 100644
--- a/src/dialogs/gb-projects-dialog.c
+++ b/src/dialogs/gb-projects-dialog.c
@@ -39,8 +39,6 @@ struct _GbProjectsDialog
 {
   GtkApplicationWindow parent_instance;
 
-  GSettings         *settings;
-
   IdeRecentProjects *recent_projects;
   IdePatternSpec    *search_pattern;
   GList             *selected;
@@ -137,39 +135,6 @@ gb_projects_dialog__listbox_row_activated_cb (GbProjectsDialog *self,
   gtk_widget_destroy (GTK_WIDGET (self));
 }
 
-static gboolean
-is_recent_project (GbProjectsDialog *self,
-                   IdeProjectInfo  *info)
-{
-  gchar *uri;
-  gboolean ret = FALSE;
-  gchar **strv;
-  GFile *file;
-  gsize i;
-
-  g_assert (GB_IS_PROJECTS_DIALOG (self));
-  g_assert (G_IS_SETTINGS (self->settings));
-  g_assert (IDE_IS_PROJECT_INFO (info));
-
-  file = ide_project_info_get_file (info);
-  uri = g_file_get_uri (file);
-  strv = g_settings_get_strv (self->settings, "project-history");
-
-  for (i = 0; strv [i]; i++)
-    {
-      if (g_str_equal (strv [i], uri))
-        {
-          ret = TRUE;
-          break;
-        }
-    }
-
-  g_strfreev (strv);
-  g_free (uri);
-
-  return ret;
-}
-
 static GtkWidget *
 create_row (GbProjectsDialog *self,
             IdeProjectInfo  *project_info)
@@ -694,7 +659,6 @@ gb_projects_dialog_finalize (GObject *object)
   GbProjectsDialog *self = (GbProjectsDialog *)object;
 
   g_clear_object (&self->recent_projects);
-  g_clear_object (&self->settings);
   g_clear_pointer (&self->selected, (GDestroyNotify)g_list_free);
   g_clear_pointer (&self->search_pattern, (GDestroyNotify)ide_pattern_spec_unref);
 
@@ -739,7 +703,5 @@ gb_projects_dialog_init (GbProjectsDialog *self)
                            self,
                            G_CONNECT_SWAPPED);
 
-  self->settings = g_settings_new ("org.gnome.builder");
-
   self->recent_projects = ide_recent_projects_new ();
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]