[ekiga] Remove unused gmconf api (again)



commit e37f6c1ce71ea55893435f7d31bea0d3f2c787cf
Author: Julien Puydt <jpuydt gnome org>
Date:   Tue Jun 8 15:56:46 2010 +0200

    Remove unused gmconf api (again)

 lib/gmconf/gmconf-gconf.c |   19 ---------
 lib/gmconf/gmconf-glib.c  |   94 ---------------------------------------------
 lib/gmconf/gmconf.h       |    7 +--
 3 files changed, 2 insertions(+), 118 deletions(-)
---
diff --git a/lib/gmconf/gmconf-gconf.c b/lib/gmconf/gmconf-gconf.c
index a613af1..bc2d0a3 100644
--- a/lib/gmconf/gmconf-gconf.c
+++ b/lib/gmconf/gmconf-gconf.c
@@ -180,25 +180,6 @@ gm_conf_get_int (const gchar *key)
 
 
 void
-gm_conf_set_float (const gchar *key,
-		   const float v)
-{
-  g_return_if_fail (key != NULL);
-
-  gconf_client_set_float (client, key, v, NULL);
-}
-
-
-gfloat
-gm_conf_get_float (const gchar *key)
-{
-  g_return_val_if_fail (key != NULL, (float)0);
-
-  return gconf_client_get_float (client, key, NULL);
-}
-
-
-void
 gm_conf_set_string_list (const gchar *key,
 			 GSList *l)
 {
diff --git a/lib/gmconf/gmconf-glib.c b/lib/gmconf/gmconf-glib.c
index 5a15631..f306712 100644
--- a/lib/gmconf/gmconf-glib.c
+++ b/lib/gmconf/gmconf-glib.c
@@ -121,7 +121,6 @@ struct _GmConfEntry
   union {
     gboolean boolean;
     gint integer;
-    gfloat floa;
     gchar *string;
     GSList *list;
     GmConfEntry *redirect; /* for GM_CONF_OTHER entries */
@@ -173,12 +172,10 @@ static void string_list_deep_destroy (GSList *);
 
 static gchar *string_from_bool (const gboolean);
 static gchar *string_from_int (const gint);
-static gchar *string_from_float (const gfloat);
 static gchar *string_from_list (const GSList *);
 
 static gboolean bool_from_string (const gchar *);
 static gint int_from_string (const gchar *);
-static gfloat float_from_string (const gchar *);
 static GSList *list_from_string (const gchar *);
 
 /* notifier functions */
@@ -203,9 +200,6 @@ static void entry_set_bool (GmConfEntry *, const gboolean);
 static gint entry_get_int (const GmConfEntry *);
 static void entry_set_int (GmConfEntry *, const gint);
 
-static gfloat entry_get_float (const GmConfEntry *);
-static void entry_set_float (GmConfEntry *, const gfloat);
-
 static const gchar *entry_get_string (const GmConfEntry *);
 static void entry_set_string (GmConfEntry *, const gchar *);
 
@@ -319,19 +313,6 @@ string_from_int (const gint val)
 }
 
 static gchar *
-string_from_float (const gfloat val)
-{
-  gchar *result = NULL;
-  GString *buffer = NULL;
-
-  buffer = g_string_new (NULL);
-  g_string_printf (buffer, "%f", val);
-
-  result = g_string_free (buffer, FALSE);
-  return result;
-}
-
-static gchar *
 string_from_list (const GSList *val)
 {
   gchar *result = NULL;
@@ -389,18 +370,6 @@ int_from_string (const gchar *str)
   return result;
 }
 
-static gfloat
-float_from_string (const gchar *str)
-{
-  gfloat result;
-  int err;
-
-  g_return_val_if_fail (str != NULL, 0);
-
-  err = sscanf (str, "%f", &result);
-  return result;
-}
-
 static GSList *
 list_from_string (const gchar *str)
 {
@@ -538,8 +507,6 @@ entry_destroy (gpointer ent)
     break;
   case GM_CONF_INT:
     break;
-  case GM_CONF_FLOAT:
-    break;
   case GM_CONF_STRING:
     g_free (entry->value.string);
     break;
@@ -628,24 +595,6 @@ entry_set_int (GmConfEntry *entry,
   entry->value.boolean = val;
 }
 
-static gfloat
-entry_get_float (const GmConfEntry *entry)
-{
-  check_entry_type_return (entry, GM_CONF_FLOAT, 0);
-
-  return entry->value.floa;
-}
-
-static void
-entry_set_float (GmConfEntry *entry,
-		 const gfloat val)
-{
-  g_return_if_fail (entry != NULL);
-
-  entry->type = GM_CONF_FLOAT;
-  entry->value.floa = val;
-}
-
 static const gchar *
 entry_get_string (const GmConfEntry *entry)
 {
@@ -856,8 +805,6 @@ sch_parser_characters (G_GNUC_UNUSED GMarkupParseContext *context,
       entry_set_type (parser->entry, GM_CONF_BOOL);
     else if (strcmp (text, "int") == 0)
       entry_set_type (parser->entry, GM_CONF_INT);
-    else if (strcmp (text, "float") == 0)
-      entry_set_type (parser->entry, GM_CONF_FLOAT);
     else if (strcmp (text, "string") == 0)
       entry_set_type (parser->entry, GM_CONF_STRING);
     else if (strcmp (text, "list") == 0)
@@ -873,9 +820,6 @@ sch_parser_characters (G_GNUC_UNUSED GMarkupParseContext *context,
     case GM_CONF_INT:
       entry_set_int (parser->entry, int_from_string (text));
       break;
-    case GM_CONF_FLOAT:
-      entry_set_float (parser->entry, float_from_string (text));
-      break;
     case GM_CONF_STRING:
       entry_set_string (parser->entry, text);
       break;
@@ -977,9 +921,6 @@ database_save_entry (G_GNUC_UNUSED GQuark quark,
   case GM_CONF_INT:
     g_io_channel_write_chars (io, "int", -1, NULL, NULL);
     break;
-  case GM_CONF_FLOAT:
-    g_io_channel_write_chars (io, "float", -1, NULL, NULL);
-    break;
   case GM_CONF_STRING:
     g_io_channel_write_chars (io, "string", -1, NULL, NULL);
     break;
@@ -1003,9 +944,6 @@ database_save_entry (G_GNUC_UNUSED GQuark quark,
   case GM_CONF_INT:
     value = string_from_int (entry_get_int (entry));
     break;
-  case GM_CONF_FLOAT:
-    value = string_from_float (entry_get_float (entry));
-    break;
   case GM_CONF_STRING:
     txt = entry_get_string (entry);
     if (txt != NULL)
@@ -1395,38 +1333,6 @@ gm_conf_get_int (const gchar *key)
 }
 
 void
-gm_conf_set_float (const gchar *key,
-		   const float val)
-{
-  DataBase *db = database_get_default ();
-  GmConfEntry *entry = NULL;
-
-  g_return_if_fail (key != NULL);
-
-  entry = database_get_entry_for_key_create (db, key);
-
-  g_return_if_fail (entry != NULL);
-
-  entry_set_float (entry, val);
-  database_notify_on_namespace (db, entry_get_key (entry));
-}
-
-gfloat
-gm_conf_get_float (const gchar *key)
-{
-  DataBase *db = database_get_default ();
-  GmConfEntry *entry = NULL;
-
-  g_return_val_if_fail (key != NULL, 0);
-
-  entry = database_get_entry_for_key (db, key);
-
-  check_entry_for_key_return (entry, key, 0);
-
-  return entry_get_float (entry);
-}
-
-void
 gm_conf_set_string (const gchar *key,
 		    const gchar *val)
 {
diff --git a/lib/gmconf/gmconf.h b/lib/gmconf/gmconf.h
index 917ff80..2eb195c 100644
--- a/lib/gmconf/gmconf.h
+++ b/lib/gmconf/gmconf.h
@@ -52,9 +52,8 @@ typedef enum {
   GM_CONF_OTHER, /* this basically means only 
 		  * the specific implementation will know 
 		  * what to do with that */
-  GM_CONF_BOOL,   
-  GM_CONF_INT,  
-  GM_CONF_FLOAT,
+  GM_CONF_BOOL, 
+  GM_CONF_INT,
   GM_CONF_STRING,
   GM_CONF_LIST,  /* list of strings! */
 } GmConfEntryType;
@@ -108,8 +107,6 @@ void gm_conf_set_bool (const gchar *, const gboolean);
 gboolean gm_conf_get_bool (const gchar *);
 void gm_conf_set_int (const gchar *, const int);
 int gm_conf_get_int (const gchar *);
-void gm_conf_set_float (const gchar *, const float);
-gfloat gm_conf_get_float (const gchar *);
 void gm_conf_set_string (const gchar *, const gchar *);
 /* Should be freed! */
 gchar *gm_conf_get_string (const gchar *);



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