[gconf/port-to-dbus: 14/23] gconf-database: Surround CORBA code with ifdefs



commit 4352f9fb16d9d94d68c9c0ba507dbda5bec0f7c0
Author: Rob Bradford <rob linux intel com>
Date:   Mon Jun 20 12:19:33 2011 +0100

    gconf-database: Surround CORBA code with ifdefs

 gconf/gconf-database.c |   43 +++++++++++++++++++++++++++++++++++++++++--
 gconf/gconf-database.h |   11 +++++++++++
 2 files changed, 52 insertions(+), 2 deletions(-)
---
diff --git a/gconf/gconf-database.c b/gconf/gconf-database.c
index 9f37bad..82d90e8 100644
--- a/gconf/gconf-database.c
+++ b/gconf/gconf-database.c
@@ -32,6 +32,7 @@
  * Forward decls
  */
 
+#ifdef HAVE_CORBA
 typedef struct _Listener Listener;
 
 struct _Listener {
@@ -777,6 +778,8 @@ static POA_ConfigDatabase3__epv server3_epv = {
 
 static POA_ConfigDatabase3__vepv poa_server_vepv = { &base_epv, &server_epv, &server2_epv, &server3_epv };
 
+#endif /* HAVE_CORBA */
+
 static void gconf_database_really_sync (GConfDatabase *db);
 static void source_notify_cb           (GConfSource   *source,
 					const gchar   *location,
@@ -786,10 +789,13 @@ GConfDatabase*
 gconf_database_new (GConfSources  *sources)
 {
   GConfDatabase* db;
+#ifdef HAVE_CORBA
   CORBA_Environment ev;
+#endif
   
   db = g_new0 (GConfDatabase, 1);
 
+#ifdef HAVE_CORBA
   db->servant._private = NULL;
   db->servant.vepv = &poa_server_vepv;
 
@@ -807,6 +813,8 @@ gconf_database_new (GConfSources  *sources)
 
       exit (1);
     }
+#endif
+
 
   db->listeners = gconf_listeners_new();
 
@@ -829,6 +837,7 @@ gconf_database_new (GConfSources  *sources)
 void
 gconf_database_free (GConfDatabase *db)
 {
+#ifdef HAVE_CORBA
   PortableServer_ObjectId *oid;
   CORBA_Environment ev;
 
@@ -851,7 +860,8 @@ gconf_database_free (GConfDatabase *db)
   CORBA_free (oid);
 
   CORBA_exception_free (&ev);
-  
+#endif
+
   if (db->listeners != NULL)
     {
       gboolean need_sync = FALSE;
@@ -884,6 +894,7 @@ gconf_database_free (GConfDatabase *db)
   g_free (db);
 }
   
+#ifdef HAVE_CORBA
 static gboolean
 client_alive_predicate (const gchar* location,
                         guint        cnxn_id,
@@ -913,16 +924,19 @@ client_alive_predicate (const gchar* location,
   
   return result;
 }
+#endif
 
 void
 gconf_database_drop_dead_listeners (GConfDatabase *db)
 {
+#ifdef HAVE_CORBA
   if (db->listeners)
     {
       gconf_listeners_remove_if (db->listeners,
                                  client_alive_predicate,
                                  NULL);
     }
+#endif
 }
 
 static gint
@@ -1023,7 +1037,9 @@ source_notify_cb (GConfSource   *source,
   if (gconf_sources_is_affected (db->sources, source, location))
     {
       GConfValue  *value;
+#ifdef HAVE_CORBA
       ConfigValue *cvalue;
+#endif
       GError      *error;
       gboolean     is_default;
       gboolean     is_writable;
@@ -1050,6 +1066,7 @@ source_notify_cb (GConfSource   *source,
 	  return;
 	}
 
+#ifdef HAVE_CORBA
       cvalue = gconf_corba_value_from_gconf_value (value);
       gconf_database_notify_listeners (db,
 				       NULL,
@@ -1059,10 +1076,13 @@ source_notify_cb (GConfSource   *source,
 				       is_writable,
 				       FALSE);
       CORBA_free (cvalue);
+#endif
+
       gconf_value_free (value);
     }
 }
 
+#ifdef HAVE_CORBA
 CORBA_unsigned_long
 gconf_database_readd_listener   (GConfDatabase       *db,
                                  ConfigListener       who,
@@ -1269,6 +1289,7 @@ gconf_database_notify_listeners (GConfDatabase       *db,
       g_free (modified_sources);
     }
 }
+#endif
 
 GConfValue*
 gconf_database_query_value (GConfDatabase  *db,
@@ -1324,7 +1345,9 @@ void
 gconf_database_set   (GConfDatabase      *db,
                       const gchar        *key,
                       GConfValue         *value,
+#ifdef HAVE_CORBA
                       const ConfigValue  *cvalue,
+#endif
                       GError        **err)
 {
   GError *error = NULL;
@@ -1360,6 +1383,7 @@ gconf_database_set   (GConfDatabase      *db,
       /* Can't possibly be the default, since we just set it,
        * and must be writable since setting it succeeded.
        */
+#ifdef HAVE_CORBA
       gconf_database_notify_listeners (db,
 				       modified_sources,
 				       key,
@@ -1367,6 +1391,7 @@ gconf_database_set   (GConfDatabase      *db,
                                        FALSE,
 				       TRUE,
 				       TRUE);
+#endif
     }
 }
 
@@ -1376,7 +1401,9 @@ gconf_database_unset (GConfDatabase      *db,
                       const gchar        *locale,
                       GError        **err)
 {
+#ifdef HAVE_CORBA
   ConfigValue* val;
+#endif
   GError* error = NULL;
   GConfSources *modified_sources = NULL;
   
@@ -1426,6 +1453,7 @@ gconf_database_unset (GConfDatabase      *db,
         gconf_log(GCL_ERR, _("Error getting default value for `%s': %s"),
                   key, (*err)->message);
 
+#ifdef HAVE_CORBA
       if (def_value != NULL)
         {
           val = gconf_corba_value_from_gconf_value(def_value);
@@ -1446,6 +1474,8 @@ gconf_database_unset (GConfDatabase      *db,
 				      is_writable,
 				      TRUE);
       CORBA_free(val);
+#endif
+
     }
 }
 
@@ -1456,7 +1486,9 @@ gconf_database_recursive_unset (GConfDatabase      *db,
                                 GConfUnsetFlags     flags,
                                 GError            **err)
 {
+#ifdef HAVE_CORBA
   ConfigValue* val;
+#endif
   GError* error = NULL;
   GSList *notifies;
   GSList *tmp;
@@ -1517,7 +1549,8 @@ gconf_database_recursive_unset (GConfDatabase      *db,
 	  g_propagate_error (err, error);
 	  error = NULL;
 	}
-      
+
+#ifdef HAVE_CORBA
       if (new_value != NULL)
         {
           val = gconf_corba_value_from_gconf_value (new_value);
@@ -1539,6 +1572,8 @@ gconf_database_recursive_unset (GConfDatabase      *db,
 				       TRUE);
       
       CORBA_free (val);
+#endif
+
       g_free (notify->key);
       g_free (notify);
       
@@ -1773,6 +1808,7 @@ gconf_database_get_persistent_name (GConfDatabase *db)
   return db->persistent_name;
 }
 
+#ifdef HAVE_CORBA
 struct ForeachData
 {
   GString *str;
@@ -1846,6 +1882,7 @@ gconf_database_log_listeners_to_string (GConfDatabase *db,
 
   g_free (fd.db_name);
 }
+#endif
 
 /*
  * Locale hash
@@ -1886,6 +1923,7 @@ gconfd_locale_cache_drop(void)
     }
 }
 
+#ifdef HAVE_CORBA
 /*
  * The listener object
  */
@@ -1917,6 +1955,7 @@ listener_destroy (Listener* l)
   g_free (l->name);
   g_free (l);
 }
+#endif
 
 
 
diff --git a/gconf/gconf-database.h b/gconf/gconf-database.h
index 60346ea..a48bbb3 100644
--- a/gconf/gconf-database.h
+++ b/gconf/gconf-database.h
@@ -25,7 +25,9 @@
 G_BEGIN_DECLS
 
 #include "gconf-error.h"
+#ifdef HAVE_CORBA
 #include "GConfX.h"
+#endif
 #include "gconf-listeners.h"
 #include "gconf-sources.h"
 #include "gconf-internals.h"
@@ -37,11 +39,14 @@ typedef struct _GConfDatabase GConfDatabase;
 
 struct _GConfDatabase
 {
+#ifdef HAVE_CORBA
   /* "inherit" from the servant,
      must be first in struct */
   POA_ConfigDatabase3 servant;
 
   ConfigDatabase objref;
+#endif
+
   
   GConfListeners* listeners;
   GConfSources* sources;
@@ -58,6 +63,7 @@ void           gconf_database_free (GConfDatabase *db);
 
 void                gconf_database_drop_dead_listeners (GConfDatabase *db);
 
+#ifdef HAVE_CORBA
 CORBA_unsigned_long gconf_database_add_listener     (GConfDatabase       *db,
                                                      ConfigListener       who,
                                                      const char          *name,
@@ -77,6 +83,7 @@ void                gconf_database_notify_listeners (GConfDatabase       *db,
                                                      gboolean             is_default,
                                                      gboolean             is_writable,
                                                      gboolean             notify_others);
+#endif
 
 GConfValue* gconf_database_query_value         (GConfDatabase  *db,
                                                 const gchar    *key,
@@ -97,7 +104,9 @@ GConfValue* gconf_database_query_default_value (GConfDatabase  *db,
 void gconf_database_set   (GConfDatabase      *db,
                            const gchar        *key,
                            GConfValue         *value,
+#ifdef HAVE_CORBA
                            const ConfigValue  *cvalue,
+#endif
                            GError        **err);
 void gconf_database_unset (GConfDatabase      *db,
                            const gchar        *key,
@@ -147,9 +156,11 @@ void gconfd_locale_cache_drop  (void);
 
 const gchar* gconf_database_get_persistent_name (GConfDatabase *db);
 
+#ifdef HAVE_CORBA
 void gconf_database_log_listeners_to_string (GConfDatabase *db,
                                              gboolean is_default,
                                              GString *str);
+#endif
 
 G_END_DECLS
 



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