captive_vfs_new(): Discard "Captive" debug messages if not wised.
authorshort <>
Wed, 18 Jun 2003 09:28:43 +0000 (09:28 +0000)
committershort <>
Wed, 18 Jun 2003 09:28:43 +0000 (09:28 +0000)
 - Here is the first initializaton point of parent in sandboxed mode.

src/libcaptive/client/vfs.c

index 9d6f7bd..c458394 100644 (file)
@@ -55,6 +55,8 @@ GObjectClass *gobject_class=G_OBJECT_CLASS(class);
 static void captive_vfs_object_init(CaptiveVfsObject *captive_vfs_object)
 {
        CAPTIVE_MEMZERO(&captive_vfs_object->options);
+
+       captive_vfs_object->corba_parent_giochanel_blind=NULL;
 }
 
 
@@ -83,6 +85,11 @@ static const GTypeInfo captive_vfs_object_info={
 }
 
 
+static void    log_discard_func(const gchar *log_domain,GLogLevelFlags log_level,const gchar *message,gpointer user_data)
+{
+       /* NOP */
+}
+
 GnomeVFSResult captive_vfs_new
                (CaptiveVfsObject **captive_vfs_object_return,const struct captive_options *options)
 {
@@ -92,6 +99,25 @@ gboolean errbool;
        g_return_val_if_fail(captive_vfs_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
        g_return_val_if_fail(options!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
 
+       /* Here is the first initializaton point of parent in sandboxed mode. */
+       if (!options->debug_messages) {
+               g_log_set_handler(
+                               G_LOG_DOMAIN,   /* log_domain; "Captive" */
+                               0       /* log_levels */
+                                               | G_LOG_FLAG_RECURSION
+                                               | G_LOG_FLAG_FATAL
+                                               /* The same mask is in:
+                                                * libcaptive/sandbox/server-GLogFunc.c
+                                                * libcaptive/client/init.c
+                                                * libcaptive/client/vfs.c
+                                                */
+                                               | G_LOG_LEVEL_MESSAGE
+                                               | G_LOG_LEVEL_INFO
+                                               | G_LOG_LEVEL_DEBUG,
+                               log_discard_func,       /* log_func */
+                               NULL);  /* user_data */
+               }
+
        *captive_vfs_object_return=NULL;
 
        captive_vfs_object=g_object_new(