[monkey-bubble: 393/753] It's now possible to read a whole section as a single key (so that we can read this whole section as



commit cfbc51ffd242a31f3490d78bb574d1939f5964ed
Author: Martin Baulig <martin src gnome org>
Date:   Wed Jun 6 17:08:42 2001 +0000

    It's now possible to read a whole section as a single key (so that we
    can read this whole section as a CORBA struct).

 monikers/test-ditem.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/monikers/test-ditem.c b/monikers/test-ditem.c
index e438684..4c0f516 100644
--- a/monikers/test-ditem.c
+++ b/monikers/test-ditem.c
@@ -1,6 +1,7 @@
 /* -*- Mode: C; c-set-style: gnu indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 #include <libbonobo.h>
 #include <libgnome/Gnome.h>
+#include <libgnome/gnome-ditem.h>
 
 #include "bonobo-config-ditem.h"
 
@@ -9,14 +10,22 @@ boot_ditem (Bonobo_ConfigDatabase db)
 {
 	BonoboArg *arg;
 
-	arg = bonobo_arg_new (TC_GNOME_LocalizedStringList);
-	bonobo_pbclient_set_value (db, "/Desktop Entry/Name", arg, NULL);
-	bonobo_pbclient_set_value (db, "/Desktop Entry/Comment", arg, NULL);
+	arg = bonobo_arg_new (TC_GNOME_DesktopEntry);
+	bonobo_pbclient_set_value (db, "/Desktop Entry", arg, NULL);
 	bonobo_arg_release (arg);
 
 	Bonobo_ConfigDatabase_sync (db, NULL);
 }
 
+static void G_GNUC_UNUSED
+test_ditem (Bonobo_ConfigDatabase db)
+{
+	GnomeDesktopItem *ditem;
+
+	ditem = gnome_desktop_item_new_from_file ("/home/martin/work/test.desktop",
+						  GNOME_DESKTOP_ITEM_LOAD_ONLY_IF_EXISTS);
+}
+
 int
 main (int argc, char **argv)
 {
@@ -45,6 +54,8 @@ main (int argc, char **argv)
 
 	boot_ditem (default_db);
 
+	test_ditem (db);
+
         CORBA_exception_init (&ev);
 	Bonobo_ConfigDatabase_addDatabase (db, default_db, "", "/gnome-ditem/", &ev);
 	g_assert (!BONOBO_EX (&ev));
@@ -91,7 +102,14 @@ main (int argc, char **argv)
         CORBA_exception_free (&ev);
 
         CORBA_exception_init (&ev);
-	value = bonobo_pbclient_get_value (db, "/Desktop Entry/Comment",
+	value = bonobo_pbclient_get_value (db, "/Desktop Entry", TC_GNOME_DesktopEntry, &ev);
+	g_message (G_STRLOC ": %p", value);
+	if (value)
+		printf ("got value as string (%s)\n", BONOBO_ARG_GET_STRING (value));
+        CORBA_exception_free (&ev);
+
+        CORBA_exception_init (&ev);
+	value = bonobo_pbclient_get_value (db, "/Desktop Entry",
 					   TC_GNOME_LocalizedStringList, &ev);
 	g_message (G_STRLOC ": %p", value);
 	if (value)



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