/* Load options */ static void load_options (void) { /* Find various dirs */ last_save_dir = g_settings_get_string (settings, LAST_SAVE_DIRECTORY_KEY); if (!last_save_dir || !last_save_dir[0]) { last_save_dir = get_desktop_dir (); } else if (last_save_dir[0] == '~') { char *tmp = expand_initial_tilde (last_save_dir); g_free (last_save_dir); last_save_dir = tmp; } include_border = g_settings_get_boolean (settings, INCLUDE_BORDER_KEY); include_pointer = g_settings_get_boolean (settings, INCLUDE_POINTER_KEY); border_effect = g_settings_get_string (settings, BORDER_EFFECT_KEY); if (!border_effect) border_effect = g_strdup ("none"); delay = g_settings_get_int (settings, DELAY_KEY); }
static gchar * sanitize_save_directory (const gchar *save_dir) { gchar *retval = g_strdup (save_dir); if (save_dir == NULL) return NULL; if (save_dir[0] == '~') { char *tmp = expand_initial_tilde (save_dir); g_free (retval); retval = tmp; } else if (strstr (save_dir, "://") != NULL) { GFile *file; g_free (retval); file = g_file_new_for_uri (save_dir); retval = g_file_get_path (file); g_object_unref (file); } return retval; }
/* Load options */ static void load_options (void) { GConfClient *gconf_client; gconf_client = gconf_client_get_default (); /* Find various dirs */ last_save_dir = gconf_client_get_string (gconf_client, LAST_SAVE_DIRECTORY_KEY, NULL); if (!last_save_dir || !last_save_dir[0]) { last_save_dir = get_desktop_dir (); } else if (last_save_dir[0] == '~') { char *tmp = expand_initial_tilde (last_save_dir); g_free (last_save_dir); last_save_dir = tmp; } include_border = gconf_client_get_bool (gconf_client, INCLUDE_BORDER_KEY, NULL); include_pointer = gconf_client_get_bool (gconf_client, INCLUDE_POINTER_KEY, NULL); border_effect = gconf_client_get_string (gconf_client, BORDER_EFFECT_KEY, NULL); if (!border_effect) border_effect = g_strdup ("none"); delay = gconf_client_get_int (gconf_client, DELAY_KEY, NULL); g_object_unref (gconf_client); }
/** * ovirt_set_proxy_options: * @proxy: a #OvirtProxy to set options upon * * Set various properties on @proxy, according to the commandline * arguments given to ovirt_get_option_group() option group. **/ void ovirt_set_proxy_options(OvirtProxy *proxy) { g_return_if_fail(OVIRT_IS_PROXY(proxy)); if (ca_file) { gchar *ca_file_absolute_path = NULL; #ifndef G_OS_WIN32 /* We have to treat files with non-absolute paths starting * with tilde (eg, ~foo/bar/ca.crt or ~/bar/ca.cert). * Other non-absolute paths will be treated down in the * stack, by libsoup, simply prepending the user's current * dir to the file path */ if (ca_file[0] == '~') ca_file_absolute_path = expand_initial_tilde(ca_file); #endif g_object_set(G_OBJECT(proxy), "ssl-ca-file", ca_file_absolute_path != NULL ? ca_file_absolute_path : ca_file, NULL); g_free (ca_file_absolute_path); } }