int
main (int argc, char **argv)
{
	GConfClient *client;
	GConfEngine *conf;
	GError      *error = NULL;
	const char  *config_source;

	if (g_getenv ("GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL")) {
		fprintf (stderr, _("GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL is set, not installing schemas\n"));
		return 0;
	}

	g_type_init ();

	config_source = g_getenv ("GCONF_CONFIG_SOURCE");
	if (!config_source) {
		fprintf (stderr, _("Must set the GCONF_CONFIG_SOURCE environment variable\n"));
		return -1;
	}

	if (*config_source == '\0')
		config_source = NULL;

	/* shut down daemon, this is a race condition, but will usually work. */
	gconf_shutdown_daemon (NULL);

	if (!config_source)
		conf = gconf_engine_get_default ();
	else
		conf = gconf_engine_get_local (config_source, &error);

	if (!conf) {
		g_assert (error != NULL);
		fprintf (stderr, _("Failed to access configuration source(s): %s\n"), error->message);
		g_error_free (error);
		return -1;
	}

	client = gconf_client_get_for_engine (conf);

	install_default_macros_list (client, MC_PATTERNS_SHEMA_KEY, G_STRUCT_OFFSET (MCDefaultMacro, pattern));
	install_default_macros_list (client, MC_COMMANDS_SHEMA_KEY, G_STRUCT_OFFSET (MCDefaultMacro, command));

	install_default_macros_list (client, MC_DEPRECATED_PATTERNS_SHEMA_KEY, G_STRUCT_OFFSET (MCDefaultMacro, pattern));
	install_default_macros_list (client, MC_DEPRECATED_COMMANDS_SHEMA_KEY, G_STRUCT_OFFSET (MCDefaultMacro, command));

	gconf_client_suggest_sync (client, &error);
	if (error) {
		fprintf (stderr, _("Error syncing config data: %s"),
			 error->message);
		g_error_free (error);
		return 1;
	}

	gconf_engine_unref (conf);
	g_object_unref (client);

	return 0;
}
Ejemplo n.º 2
0
int 
main (int argc, char** argv)
{
  GConfEngine* conf;
  GError* err = NULL;

  setlocale (LC_ALL, "");
  
  if (!gconf_init(argc, argv, &err))
    {
      g_assert(err != NULL);
      fprintf(stderr, "Failed to init GConf: %s\n", err->message);
      fflush(stderr);
      g_error_free(err);
      err = NULL;
      return 1;
    }
  
  conf = gconf_engine_get_default();

  check(conf != NULL, "create the default conf engine");

  printf("\nChecking list storage:");
  
  check_list_storage(conf);
  
  printf("\nChecking integer storage:");
  
  check_int_storage(conf);

  printf("\nChecking float storage:");
  
  check_float_storage(conf);

  printf("\nChecking string storage:");
  
  check_string_storage(conf);

  printf("\nChecking bool storage:");
  
  check_bool_storage(conf);
  
  gconf_engine_unref(conf);

  printf("\n\n");
  
  return 0;
}
Ejemplo n.º 3
0
int main(int argc, char** argv)
{
   GConfEngine* conf = gconf_engine_get_default();
         
   gchar* config_system_path = gconf_engine_get_string(conf, "/apps/intel_services_manager/11111111-1111-1111-111111111111/System/config_system_path", NULL);
   gchar* host = gconf_engine_get_string(conf, "/system/http_proxy/host", NULL);
   gint port   = gconf_engine_get_int(conf,    "/system/http_proxy/port", NULL);
   gboolean enabled  = gconf_engine_get_bool(conf,   "/system/http_proxy/use_http_proxy", NULL);

   printf("PROXY SETTINGS\n");
   printf("config_system_path: %s\n", config_system_path ? config_system_path : "");
   printf("host   : %s\n", host ? host : "");
   printf("port   : %i\n", port);
   printf("enabled: %i\n", enabled);

   gconf_engine_unref(conf);

   return 0;
}
Ejemplo n.º 4
0
void preferences_init (int argc, char **argv)
{
        gconf_init (argc, argv, NULL);
        preferences_engine = gconf_engine_get_default ();
}