[Gnucash-changes] r12942 - gnucash/trunk/src - Initialize Gnome libraries before booting guile.

Chris Shoemaker chris at cvs.gnucash.org
Sun Jan 22 18:12:16 EST 2006


Author: chris
Date: 2006-01-22 18:12:15 -0500 (Sun, 22 Jan 2006)
New Revision: 12942
Trac: http://svn.gnucash.org/trac/changeset/12942

Modified:
   gnucash/trunk/src/bin/gnucash-bin.c
   gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c
   gnucash/trunk/src/gnome-utils/gnc-gnome-utils.h
   gnucash/trunk/src/gnome-utils/gw-gnome-utils-spec.scm
   gnucash/trunk/src/gnome/top-level.c
Log:
 Initialize Gnome libraries before booting guile.


Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c	2006-01-22 18:57:46 UTC (rev 12941)
+++ gnucash/trunk/src/bin/gnucash-bin.c	2006-01-22 23:12:15 UTC (rev 12942)
@@ -42,6 +42,7 @@
 #include "gfec.h"
 #include "gnc-main.h"
 #include "gnc-splash.h"
+#include "gnc-gnome-utils.h"
 
 static int gnucash_show_version;
 /* GNUCASH_SVN is defined whenever we're building from an SVN tree */
@@ -331,6 +332,7 @@
 #endif
 
     gtk_init (&argc, &argv);
+    gnc_gnome_init (argc, argv, VERSION);
     gnc_module_system_init();
     envt_override();
     gnucash_command_line(argc, argv);

Modified: gnucash/trunk/src/gnome/top-level.c
===================================================================
--- gnucash/trunk/src/gnome/top-level.c	2006-01-22 18:57:46 UTC (rev 12941)
+++ gnucash/trunk/src/gnome/top-level.c	2006-01-22 23:12:15 UTC (rev 12942)
@@ -249,8 +249,6 @@
   {
     splash_is_initialized = TRUE;
 
-    ret = gnc_gnome_init ("gnucash", "GnuCash", VERSION, command_line);
-
     /* put up splash screen */
     gnc_show_splash_screen ();
   }

Modified: gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c	2006-01-22 18:57:46 UTC (rev 12941)
+++ gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c	2006-01-22 23:12:15 UTC (rev 12942)
@@ -42,21 +42,6 @@
 static QofLogModule log_module = GNC_MOD_GUI;
 static GnomeProgram *gnucash_program = NULL;
 
-static char**
-gnc_scm2argv (SCM scm, int prelen, const char **prependargv)
-{
-  /* FIXME: when we drop support older guiles, drop the (char *) coercion. */
-  return gnc_scheme_list_to_nulltermcharpp (prelen, prependargv, scm);
-}
-
-static SCM
-gnc_argv2scm (int len, const char **rest)
-{
-  return gnc_argvarr_to_scheme_list (len, rest);
-}
-
-static const char *default_argv[] = {"", 0};
-
 static const struct poptOption nullPoptTable[] = {
   { NULL, 0, 0, NULL, 0 }
 };
@@ -127,51 +112,18 @@
   }
 }
 
-SCM
-gnc_gnome_init (const char * arg0,
-                const char * progname,
-                const char * version,
-                SCM command_line)
+void
+gnc_gnome_init (int argc, char **argv, const char * version)
 {
-  poptContext returnedPoptContext; /* owned by the library */
-  int restargc;
   char *fullname;
-  char **restargv;
-  char **restargv2;
-  SCM ret = command_line;
   GError *error = NULL;
-  GValue value = { 0, };
 
-  if (arg0)
-    default_argv[0] = arg0;
-
-  restargv = gnc_scm2argv (command_line, 1, default_argv);
-  if (!restargv)
-  {
-    restargv = g_new (char*, 2);
-    restargv[0] = g_strdup (default_argv[0]);
-    restargv[1] = NULL;
-  }
-
-  restargc = argv_length (restargv);
-
   gnc_gtk_add_rc_file();
-  gnucash_program =
-    gnome_program_init("gnucash", version, LIBGNOMEUI_MODULE,
-		       restargc, restargv,
-		       GNOME_PARAM_POPT_TABLE, nullPoptTable,
-		       GNOME_PROGRAM_STANDARD_PROPERTIES,
-		       GNOME_PARAM_NONE);
+  gnucash_program = gnome_program_init(
+      "gnucash", version, LIBGNOMEUI_MODULE,
+      argc, argv, GNOME_PARAM_POPT_TABLE, nullPoptTable,
+      GNOME_PROGRAM_STANDARD_PROPERTIES, GNOME_PARAM_NONE);
 
-  g_value_init(&value, G_TYPE_POINTER);
-  g_object_get_property (G_OBJECT (gnucash_program),
-			 GNOME_PARAM_POPT_CONTEXT, &value);
-  returnedPoptContext = g_value_get_pointer (&value);
-  restargv2 = (char**) poptGetArgs (returnedPoptContext);
-  ret = gnc_argv2scm (argv_length (restargv2), (const char**)restargv2);
-
-  gnc_free_argv (restargv);
-
   /* initialization required for gtkhtml */
   gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
 
@@ -188,7 +140,7 @@
 
   druid_gconf_install_check_schemas();
 
-  return ret;
+  return;
 }
 
 void

Modified: gnucash/trunk/src/gnome-utils/gnc-gnome-utils.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-gnome-utils.h	2006-01-22 18:57:46 UTC (rev 12941)
+++ gnucash/trunk/src/gnome-utils/gnc-gnome-utils.h	2006-01-22 23:12:15 UTC (rev 12942)
@@ -35,26 +35,8 @@
 #ifndef GNC_GNOME_UTILS_H
 #define GNC_GNOME_UTILS_H
 
-#ifdef LIBGUILEH
-/** Initialize the Gnome libraries.
- *
- *  @param arg0 The running application as it appears to a user.
- *
- *  @param program The compiled name of the application. "gnucash"
- *
- *  @param version The program version. (e.g. 1.8.7)
- *
- *  @param command_line A scheme list containing all of the command
- *  line arguments (or all of the arguments notyet pasrsed in scheme).
- *
- *  @return The initial command_line argument minus any arguments
- *  parsed by this function.
- */
-SCM gnc_gnome_init (const char * arg0,
-                    const char * progname,
-                    const char * version,
-                    SCM command_line);
-#endif
+/** Initialize the Gnome libraries. */
+void gnc_gnome_init (int argc, char **argv, const char * version);
 
 /** Shutdown/cleanup any gnome related libraries. */
 void gnc_gnome_shutdown (void);

Modified: gnucash/trunk/src/gnome-utils/gw-gnome-utils-spec.scm
===================================================================
--- gnucash/trunk/src/gnome-utils/gw-gnome-utils-spec.scm	2006-01-22 18:57:46 UTC (rev 12941)
+++ gnucash/trunk/src/gnome-utils/gw-gnome-utils-spec.scm	2006-01-22 23:12:15 UTC (rev 12942)
@@ -51,17 +51,6 @@
 
   (gw:wrap-function
    ws
-   'gnc:gnome-init
-   '<gw:scm>
-   "gnc_gnome_init"
-   '(((<gw:mchars> caller-owned const) arg0)
-     ((<gw:mchars> caller-owned const) progname)
-     ((<gw:mchars> caller-owned const) version)
-     (<gw:scm> command-line))
-   "Initialize the GnuCash gnome system.")
-
-  (gw:wrap-function
-   ws
    'gnc:gnome-shutdown
    '<gw:void>
    "gnc_gnome_shutdown"



More information about the gnucash-changes mailing list