[gnome-builder] libide/tweaks: remove sort-key property



commit 8f8bd061333c44417de45ec6fff6bca80d7bdd7a
Author: Christian Hergert <chergert redhat com>
Date:   Fri Aug 19 17:31:46 2022 -0700

    libide/tweaks: remove sort-key property
    
    We didn't use this, so just drop it.

 src/libide/tweaks/ide-tweaks-item.c        | 38 ------------------------------
 src/libide/tweaks/ide-tweaks-item.h        |  5 ----
 src/libide/tweaks/tests/test1/expected.xml | 14 +++++------
 src/libide/tweaks/tests/test2/1.ui         |  1 -
 src/libide/tweaks/tests/test2/expected.xml | 12 +++++-----
 5 files changed, 13 insertions(+), 57 deletions(-)
---
diff --git a/src/libide/tweaks/ide-tweaks-item.c b/src/libide/tweaks/ide-tweaks-item.c
index a4987e27b..7399063e7 100644
--- a/src/libide/tweaks/ide-tweaks-item.c
+++ b/src/libide/tweaks/ide-tweaks-item.c
@@ -35,7 +35,6 @@ typedef struct
   GQueue          children;
   char           *id;
   char          **keywords;
-  char           *sort_key;
   guint           id_sequence;
 } IdeTweaksItemPrivate;
 
@@ -43,7 +42,6 @@ enum {
   PROP_0,
   PROP_ID,
   PROP_KEYWORDS,
-  PROP_SORT_KEY,
   N_PROPS
 };
 
@@ -164,7 +162,6 @@ ide_tweaks_item_dispose (GObject *object)
   ide_tweaks_item_unparent (self);
 
   g_clear_pointer (&priv->keywords, g_strfreev);
-  g_clear_pointer (&priv->sort_key, g_free);
   g_clear_pointer (&priv->id, g_free);
 
   G_OBJECT_CLASS (ide_tweaks_item_parent_class)->dispose (object);
@@ -188,10 +185,6 @@ ide_tweaks_item_get_property (GObject    *object,
       g_value_set_boxed (value, ide_tweaks_item_get_keywords (self));
       break;
 
-    case PROP_SORT_KEY:
-      g_value_set_string (value, ide_tweaks_item_get_sort_key (self));
-      break;
-
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -211,10 +204,6 @@ ide_tweaks_item_set_property (GObject      *object,
       ide_tweaks_item_set_keywords (self, g_value_get_boxed (value));
       break;
 
-    case PROP_SORT_KEY:
-      ide_tweaks_item_set_sort_key (self, g_value_get_string (value));
-      break;
-
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -241,11 +230,6 @@ ide_tweaks_item_class_init (IdeTweaksItemClass *klass)
                         G_TYPE_STRV,
                         (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
 
-  properties [PROP_SORT_KEY] =
-    g_param_spec_string ("sort-key", NULL, NULL,
-                         NULL,
-                         (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
-
   g_object_class_install_properties (object_class, N_PROPS, properties);
 }
 
@@ -303,28 +287,6 @@ ide_tweaks_item_set_keywords (IdeTweaksItem      *self,
   g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_KEYWORDS]);
 }
 
-const char *
-ide_tweaks_item_get_sort_key (IdeTweaksItem *self)
-{
-  IdeTweaksItemPrivate *priv = ide_tweaks_item_get_instance_private (self);
-
-  g_return_val_if_fail (IDE_IS_TWEAKS_ITEM (self), NULL);
-
-  return priv->sort_key;
-}
-
-void
-ide_tweaks_item_set_sort_key (IdeTweaksItem *self,
-                              const char    *sort_key)
-{
-  IdeTweaksItemPrivate *priv = ide_tweaks_item_get_instance_private (self);
-
-  g_return_if_fail (IDE_IS_TWEAKS_ITEM (self));
-
-  if (ide_set_string (&priv->sort_key, sort_key))
-    g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SORT_KEY]);
-}
-
 /**
  * ide_tweaks_item_get_first_child:
  * @self: a #IdeTweaksItem
diff --git a/src/libide/tweaks/ide-tweaks-item.h b/src/libide/tweaks/ide-tweaks-item.h
index 2a068e8a8..ccdd028e1 100644
--- a/src/libide/tweaks/ide-tweaks-item.h
+++ b/src/libide/tweaks/ide-tweaks-item.h
@@ -72,11 +72,6 @@ IDE_AVAILABLE_IN_ALL
 void                ide_tweaks_item_set_keywords         (IdeTweaksItem        *self,
                                                           const char * const   *keywords);
 IDE_AVAILABLE_IN_ALL
-const char         *ide_tweaks_item_get_sort_key         (IdeTweaksItem        *self);
-IDE_AVAILABLE_IN_ALL
-void                ide_tweaks_item_set_sort_key         (IdeTweaksItem        *self,
-                                                          const char           *sort_key);
-IDE_AVAILABLE_IN_ALL
 gboolean            ide_tweaks_item_is_ancestor          (IdeTweaksItem        *self,
                                                           IdeTweaksItem        *ancestor);
 IDE_AVAILABLE_IN_ALL
diff --git a/src/libide/tweaks/tests/test1/expected.xml b/src/libide/tweaks/tests/test1/expected.xml
index 675505ed3..32cd3bf84 100644
--- a/src/libide/tweaks/tests/test1/expected.xml
+++ b/src/libide/tweaks/tests/test1/expected.xml
@@ -1,11 +1,11 @@
-<IdeTweaks id="IdeTweaks" project-id="" sort-key="">
-  <IdeTweaksSection id="visual_section" show-header="FALSE" sort-key="" title="">
-    <IdeTweaksPage id="appearance_page" has-subpage="FALSE" icon-name="" section="#visual_section" 
show-icon="TRUE" sort-key="" title="Appearance">
-      <IdeTweaksGroup id="appearance_group" sort-key="" title="Appearance"/>
+<IdeTweaks id="IdeTweaks" project-id="">
+  <IdeTweaksSection id="visual_section" show-header="FALSE" title="">
+    <IdeTweaksPage id="appearance_page" has-subpage="FALSE" icon-name="" section="#visual_section" 
show-icon="TRUE" title="Appearance">
+      <IdeTweaksGroup id="appearance_group" title="Appearance"/>
     </IdeTweaksPage>
   </IdeTweaksSection>
-  <IdeTweaksSection id="foundry_section" show-header="FALSE" sort-key="" title="">
-    <IdeTweaksPage id="build_page" has-subpage="FALSE" icon-name="" section="#foundry_section" 
show-icon="TRUE" sort-key="" title="Build"/>
-    <IdeTweaksPage id="debugger_page" has-subpage="FALSE" icon-name="builder-debugger-symbolic" 
section="#foundry_section" show-icon="TRUE" sort-key="" title="Debugger"/>
+  <IdeTweaksSection id="foundry_section" show-header="FALSE" title="">
+    <IdeTweaksPage id="build_page" has-subpage="FALSE" icon-name="" section="#foundry_section" 
show-icon="TRUE" title="Build"/>
+    <IdeTweaksPage id="debugger_page" has-subpage="FALSE" icon-name="builder-debugger-symbolic" 
section="#foundry_section" show-icon="TRUE" title="Debugger"/>
   </IdeTweaksSection>
 </IdeTweaks>
diff --git a/src/libide/tweaks/tests/test2/1.ui b/src/libide/tweaks/tests/test2/1.ui
index 6f5ea66b6..e0227564b 100644
--- a/src/libide/tweaks/tests/test2/1.ui
+++ b/src/libide/tweaks/tests/test2/1.ui
@@ -17,7 +17,6 @@
                     </binding>
                     <child internal-child="language_general_group">
                       <object class="IdeTweaksGroup">
-                        <property name="sort-key">test-key</property>
                       </object>
                     </child>
                   </object>
diff --git a/src/libide/tweaks/tests/test2/expected.xml b/src/libide/tweaks/tests/test2/expected.xml
index 2676e60ab..3e7cdaf72 100644
--- a/src/libide/tweaks/tests/test2/expected.xml
+++ b/src/libide/tweaks/tests/test2/expected.xml
@@ -1,9 +1,9 @@
-<IdeTweaks id="IdeTweaks" project-id="" sort-key="">
-  <IdeTweaksSection id="programming_section" show-header="FALSE" sort-key="" title="">
-    <IdeTweaksPage id="languages_page" has-subpage="TRUE" 
icon-name="preferences-desktop-appearance-symbolic" section="#programming_section" show-icon="TRUE" 
sort-key="" title="Appearance">
-      <IdeTweaksFactory id="language_subpage_factory" model="GListStore<GtkSourceLanguage>" sort-key="">
-        <IdeTweaksPage id="language_subpage" has-subpage="FALSE" icon-name="" show-icon="TRUE" sort-key="" 
title="">
-          <IdeTweaksGroup id="language_general_group" sort-key="test-key" title="General"/>
+<IdeTweaks id="IdeTweaks" project-id="">
+  <IdeTweaksSection id="programming_section" show-header="FALSE" title="">
+    <IdeTweaksPage id="languages_page" has-subpage="TRUE" 
icon-name="preferences-desktop-appearance-symbolic" section="#programming_section" show-icon="TRUE" 
title="Appearance">
+      <IdeTweaksFactory id="language_subpage_factory" model="GListStore<GtkSourceLanguage>">
+        <IdeTweaksPage id="language_subpage" has-subpage="FALSE" icon-name="" show-icon="TRUE" title="">
+          <IdeTweaksGroup id="language_general_group" title="General"/>
         </IdeTweaksPage>
       </IdeTweaksFactory>
     </IdeTweaksPage>


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