Beispiel #1
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;
}
Beispiel #2
0
gboolean preferences_get_gnome_keyring_export ()
{
        return gconf_engine_get_bool (preferences_engine, "/apps/gnomint/gnome_keyring_export", NULL);
}
void
check_bool_storage(GConfEngine* conf)
{
  GError* err = NULL;
  const gchar** keyp = NULL;
  guint i; 
  
  /* Loop over keys, storing all bools at each then retrieving them */
  
  keyp = keys;

  while (*keyp)
    {
      i = 0;
      while (i < n_bools)
        {
          gboolean gotten;
          
          if (!gconf_engine_set_bool(conf, *keyp, bools[i], &err))
            {
              fprintf(stderr, "Failed to set key `%s' to `%d': %s\n",
                      *keyp, bools[i], err->message);
              g_error_free(err);
              err = NULL;
            }
          else
            {
              sync_and_clear(conf);
              
              gotten = gconf_engine_get_bool(conf, *keyp, &err);

              if (err != NULL)
                {
                  check(gotten == FALSE, "TRUE was returned though there was an error");

                  fprintf(stderr, "Failed to get key `%s': %s\n",
                          *keyp, err->message);
                  g_error_free(err);
                  err = NULL;
                }
              else
                {
                  check (bools[i] == gotten, "bool set/get pair: `%d' set, `%d' got",
                         bools[i], gotten);

                }
            }
          
          ++i;
        }
      
      ++keyp;
    }

  /* Now invert the loop and see if that causes problems */

  i = 0;
      
  while (i < n_bools)
    {
      keyp = keys;
      
      while (*keyp)
        {
          gboolean gotten;
          
          if (!gconf_engine_set_bool(conf, *keyp, bools[i], &err))
            {
              fprintf(stderr, "Failed to set key `%s' to `%d': %s\n",
                      *keyp, bools[i], err->message);
              g_error_free(err);
              err = NULL;
            }
          else
            {
              sync_and_clear(conf);
              
              gotten = gconf_engine_get_bool(conf, *keyp, &err);
              
              if (err != NULL)
                {
                  check(gotten == FALSE, "TRUE was returned though there was an error");

                  fprintf(stderr, "Failed to get key `%s': %s\n",
                          *keyp, err->message);
                  g_error_free(err);
                  err = NULL;
                }
              else
                {
                  check (bools[i] == gotten, "bool set/get pair: `%d' set, `%d' got",
                         bools[i], gotten);

                }
            }

          ++keyp;
        }

      ++i;
    }
  
  check_unset(conf);
}