[gnome-builder/wip/chergert/perspective] some cleanups



commit a7d5a86ca1a7260f16d2ebbc8f44d0be1cd451ea
Author: Christian Hergert <christian hergert me>
Date:   Wed Nov 4 19:33:50 2015 -0800

    some cleanups
    
    i guess we'll just squash all these commits at the end, rather than
    forced pushes each time.

 libide/editor/ide-editor-perspective.c   |    4 ++--
 libide/greeter/ide-greeter-perspective.c |    2 +-
 libide/ide-application.c                 |    2 +-
 libide/ide-perspective.c                 |   19 ++++++++++---------
 libide/ide-perspective.h                 |   12 ++++++------
 libide/ide-workbench.c                   |    1 +
 6 files changed, 21 insertions(+), 19 deletions(-)
---
diff --git a/libide/editor/ide-editor-perspective.c b/libide/editor/ide-editor-perspective.c
index adc7299..282a2f1 100644
--- a/libide/editor/ide-editor-perspective.c
+++ b/libide/editor/ide-editor-perspective.c
@@ -94,10 +94,10 @@ ide_editor_perspective_init (IdeEditorPerspective *self)
   gtk_widget_init_template (GTK_WIDGET (self));
 }
 
-static const gchar *
+static gchar *
 ide_editor_perspective_get_title (IdePerspective *perspective)
 {
-  return _("Editor");
+  return g_strdup (_("Editor"));
 }
 
 static GtkWidget *
diff --git a/libide/greeter/ide-greeter-perspective.c b/libide/greeter/ide-greeter-perspective.c
index f37a4ea..226289f 100644
--- a/libide/greeter/ide-greeter-perspective.c
+++ b/libide/greeter/ide-greeter-perspective.c
@@ -79,7 +79,7 @@ ide_greeter_perspective_get_titlebar (IdePerspective *perspective)
 static GActionGroup *
 ide_greeter_perspective_get_actions (IdePerspective *perspective)
 {
-  return G_ACTION_GROUP (IDE_GREETER_PERSPECTIVE (perspective)->actions);
+  return g_object_ref (IDE_GREETER_PERSPECTIVE (perspective)->actions);
 }
 
 static void
diff --git a/libide/ide-application.c b/libide/ide-application.c
index faab43a..289cdb0 100644
--- a/libide/ide-application.c
+++ b/libide/ide-application.c
@@ -77,7 +77,7 @@ ide_application_load_plugins (IdeApplication *self)
 
   peas_engine_enable_loader (engine, "python3");
 
-  if (g_getenv ("BUiLDER_IN_TREE_PLUGINS") != NULL)
+  if (g_getenv ("GB_IN_TREE_PLUGINS") != NULL)
     {
       GDir *dir;
 
diff --git a/libide/ide-perspective.c b/libide/ide-perspective.c
index 3a322b7..43698fa 100644
--- a/libide/ide-perspective.c
+++ b/libide/ide-perspective.c
@@ -32,16 +32,16 @@ ide_perspective_real_get_actions (IdePerspective *self)
   return NULL;
 }
 
-static const gchar *
+static gchar *
 ide_perspective_real_get_icon_name (IdePerspective *self)
 {
   return NULL;
 }
 
-static const gchar *
+static gchar *
 ide_perspective_real_get_id (IdePerspective *self)
 {
-  return G_OBJECT_TYPE_NAME (self);
+  return g_strdup (G_OBJECT_TYPE_NAME (self));
 }
 
 static gboolean
@@ -50,7 +50,7 @@ ide_perspective_real_get_needs_attention (IdePerspective *self)
   return FALSE;
 }
 
-static const gchar *
+static gchar *
 ide_perspective_real_get_title (IdePerspective *self)
 {
   return NULL;
@@ -117,9 +117,10 @@ ide_perspective_agree_to_shutdown (IdePerspective *self)
  *
  * If you implement an "icon-name" property, the icon may change at runtime.
  *
- * Returns: A named icon as a string which will not be modified or freed.
+ * Returns: (nullable): A newly allcoated string that contains the icon-name
+ *   to use for the perspective.
  */
-const gchar *
+gchar *
 ide_perspective_get_icon_name (IdePerspective *self)
 {
   g_return_val_if_fail (IDE_IS_PERSPECTIVE (self), NULL);
@@ -137,9 +138,9 @@ ide_perspective_get_icon_name (IdePerspective *self)
  *
  * This value should be unique per workspace.
  *
- * Returns: A string identifier for the perspective.
+ * Returns: (nullable): A string identifier for the perspective.
  */
-const gchar *
+gchar *
 ide_perspective_get_id (IdePerspective *self)
 {
   g_return_val_if_fail (IDE_IS_PERSPECTIVE (self), NULL);
@@ -177,7 +178,7 @@ ide_perspective_get_needs_attention (IdePerspective *self)
  *
  * Returns: A string which will not be modified or freed.
  */
-const gchar *
+gchar *
 ide_perspective_get_title (IdePerspective *self)
 {
   g_return_val_if_fail (IDE_IS_PERSPECTIVE (self), NULL);
diff --git a/libide/ide-perspective.h b/libide/ide-perspective.h
index 9563d84..a5aa17f 100644
--- a/libide/ide-perspective.h
+++ b/libide/ide-perspective.h
@@ -33,10 +33,10 @@ struct _IdePerspectiveInterface
 
   gboolean      (*agree_to_shutdown)   (IdePerspective *self);
   GActionGroup *(*get_actions)         (IdePerspective *self);
-  const gchar  *(*get_icon_name)       (IdePerspective *self);
-  const gchar  *(*get_id)              (IdePerspective *self);
+  gchar        *(*get_icon_name)       (IdePerspective *self);
+  gchar        *(*get_id)              (IdePerspective *self);
   gboolean      (*get_needs_attention) (IdePerspective *self);
-  const gchar  *(*get_title)           (IdePerspective *self);
+  gchar        *(*get_title)           (IdePerspective *self);
   GtkWidget    *(*get_titlebar)        (IdePerspective *self);
   void          (*set_fullscreen)      (IdePerspective *self,
                                         gboolean        fullscreen);
@@ -47,9 +47,9 @@ struct _IdePerspectiveInterface
 
 gboolean      ide_perspective_agree_to_shutdown   (IdePerspective *self);
 GActionGroup *ide_perspective_get_actions         (IdePerspective *self);
-const gchar  *ide_perspective_get_icon_name       (IdePerspective *self);
-const gchar  *ide_perspective_get_id              (IdePerspective *self);
-const gchar  *ide_perspective_get_title           (IdePerspective *self);
+gchar        *ide_perspective_get_icon_name       (IdePerspective *self);
+gchar        *ide_perspective_get_id              (IdePerspective *self);
+gchar        *ide_perspective_get_title           (IdePerspective *self);
 GtkWidget    *ide_perspective_get_titlebar        (IdePerspective *self);
 gboolean      ide_perspective_get_needs_attention (IdePerspective *self);
 void          ide_perspective_set_fullscreen      (IdePerspective *self,
diff --git a/libide/ide-workbench.c b/libide/ide-workbench.c
index 231c711..9332d96 100644
--- a/libide/ide-workbench.c
+++ b/libide/ide-workbench.c
@@ -393,4 +393,5 @@ ide_workbench_set_perspective (IdeWorkbench   *self,
 
   actions = ide_perspective_get_actions (perspective);
   gtk_widget_insert_action_group (GTK_WIDGET (self), "perspective", actions);
+  g_clear_object (&actions);
 }


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