[Xfce4-commits] <gigolo:master> Completely remove the preference to select the Volume Manager implementation

Enrico Tröger noreply at xfce.org
Thu Apr 29 18:04:01 CEST 2010


Updating branch refs/heads/master
         to 8a1d9f5f0259f15391c912e029bc8df446045a0d (commit)
       from 40d41f20328d44c73a91d670d3e173d4e22572f6 (commit)

commit 8a1d9f5f0259f15391c912e029bc8df446045a0d
Author: Enrico Tröger <enrico at xfce.org>
Date:   Thu Apr 29 17:56:37 2010 +0200

    Completely remove the preference to select the Volume Manager implementation
    
    Since GVfs doesn't provide HAL anymore but uses GDU now, we remove the preference to not provide hard-coded defaults.

 src/main.c              |    6 ------
 src/preferencesdialog.c |   36 ++----------------------------------
 src/settings.c          |   35 -----------------------------------
 3 files changed, 2 insertions(+), 75 deletions(-)

diff --git a/src/main.c b/src/main.c
index 91c9431..6f4114b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -68,7 +68,6 @@ gint main(gint argc, gchar** argv)
 {
 	GigoloSettings *settings;
 	GigoloSingleInstance *gis = NULL;
-	const gchar *vm_impl;
 	gchar *accel_filename;
 	GOptionContext *context;
 	GtkWidget *window;
@@ -124,11 +123,6 @@ gint main(gint argc, gchar** argv)
 	accel_filename = g_build_filename(g_get_user_config_dir(), PACKAGE, "accels", NULL);
 	gtk_accel_map_load(accel_filename);
 
-	/* GVfs currently depends on gnome-mount for HAL-based GVolumeMonitor implementation,
-	 * when gnome-mount is not installed, we can use "unix" as GVolumeMonitor implementation. */
-	if ((vm_impl = gigolo_settings_get_vm_impl(settings)) != NULL)
-		g_setenv("GIO_USE_VOLUME_MONITOR", vm_impl, 0);
-
 	window = gigolo_window_new(settings);
 
 	if (gis != NULL)
diff --git a/src/preferencesdialog.c b/src/preferencesdialog.c
index f831b72..d080b8a 100644
--- a/src/preferencesdialog.c
+++ b/src/preferencesdialog.c
@@ -85,12 +85,6 @@ static GtkWidget *xfce_header_new(const gchar *icon, const gchar *title)
 }
 
 
-static void vm_imple_toggle_cb(GtkToggleButton *button, GigoloSettings *settings)
-{
-	gigolo_settings_set_vm_impl(settings, g_object_get_data(G_OBJECT(button), "impl"));
-}
-
-
 static void check_button_toggle_cb(GtkToggleButton *button, GigoloSettings *settings)
 {
     gboolean toggled = gtk_toggle_button_get_active(button);
@@ -311,10 +305,9 @@ static GtkWidget *add_spinbutton(GigoloSettings *settings, const gchar *property
 static void set_settings(GigoloPreferencesDialog *dialog, GigoloSettings *settings)
 {
 	GtkWidget *frame_vbox, *notebook_vbox, *vbox, *hbox, *notebook;
-	GtkWidget *radio1, *radio2, *checkbox, *combo, *entry, *combo_toolbar_style, *tmp_box;
+	GtkWidget *checkbox, *combo, *entry, *combo_toolbar_style, *tmp_box;
 	GtkWidget *combo_toolbar_orient, *spinbutton;
-	GtkWidget *label1, *label2, *label3, *label4, *label_volman, *image;
-	GSList *rlist;
+	GtkWidget *label1, *label2, *label3, *label4, *image;
 	GtkSizeGroup *sg;
 
     vbox = gigolo_dialog_get_content_area(GTK_DIALOG(dialog));
@@ -371,31 +364,6 @@ static void set_settings(GigoloPreferencesDialog *dialog, GigoloSettings *settin
 
 	gtk_box_pack_start(GTK_BOX(frame_vbox), gtk_label_new(""), FALSE, FALSE, 0);
 
-	label_volman = gtk_label_new(_("The HAL based volume manager implementation requires the tool 'gnome-mount' to mount local resources like disks. The Unix based volume manager implementation can mount such resources directly and also lists other local devices.\nIf you are unsure, use the HAL based monitor."));
-	gtk_label_set_line_wrap(GTK_LABEL(label_volman), TRUE);
-	gtk_label_set_line_wrap_mode(GTK_LABEL(label_volman), PANGO_WRAP_WORD);
-	gtk_misc_set_alignment(GTK_MISC(label_volman), 0.0f, 0.5f);
-	gtk_box_pack_start(GTK_BOX(frame_vbox), label_volman, FALSE, FALSE, 0);
-
-	radio1 = gtk_radio_button_new_with_mnemonic(NULL, _("Use _HAL based volume manager"));
-	gtk_widget_set_tooltip_markup(radio1, _("<i>Changing this option requires a restart of Gigolo.</i>"));
-	rlist = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio1));
-	if (strcmp(gigolo_settings_get_vm_impl(settings), "hal") == 0)
-		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio1), TRUE);
-	gtk_box_pack_start(GTK_BOX(frame_vbox), radio1, FALSE, FALSE, 0);
-	g_object_set_data(G_OBJECT(radio1), "impl", (gpointer) "hal");
-
-	radio2 = gtk_radio_button_new_with_mnemonic(rlist, _("Use _Unix based volume manager"));
-	gtk_widget_set_tooltip_markup(radio2, _("<i>Changing this option requires a restart of Gigolo.</i>"));
-	rlist = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio2));
-	if (strcmp(gigolo_settings_get_vm_impl(settings), "unix") == 0)
-		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio2), TRUE);
-	gtk_box_pack_start(GTK_BOX(frame_vbox), radio2, FALSE, FALSE, 0);
-	g_object_set_data(G_OBJECT(radio2), "impl", (gpointer) "unix");
-
-	g_signal_connect(radio1, "toggled", G_CALLBACK(vm_imple_toggle_cb), settings);
-	g_signal_connect(radio2, "toggled", G_CALLBACK(vm_imple_toggle_cb), settings);
-
 #define PAGE_INTERFACE
 	notebook_vbox = gtk_vbox_new(FALSE, 2);
 	frame_vbox = gtk_vbox_new(FALSE, 5);
diff --git a/src/settings.c b/src/settings.c
index a7800dc..dece5d3 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -56,7 +56,6 @@ struct _GigoloSettingsPrivate
 
 	gchar		*file_manager;
 	gint		 autoconnect_interval;
-	gchar		*vm_impl; /* GVolumeMonitor implementation to use */
 	gint		*geometry; /* window size and position, field 4 is a flag for maximized state */
 
 	GigoloBookmarkList *bookmarks; /* array of known bookmarks */
@@ -71,7 +70,6 @@ static void gigolo_settings_finalize			(GObject* object);
 
 /* default values */
 #define DEFAULT_AUTOCONNECT_INTERVAL	60
-#define DEFAULT_VM_IMPL					"hal"
 
 enum
 {
@@ -411,8 +409,6 @@ static void write_settings_config(GigoloSettings *settings)
 
 	k = g_key_file_new();
 
-	if (priv->vm_impl != NULL)
-		g_key_file_set_string(k, SECTION_GENERAL, "vm_impl", priv->vm_impl);
 	if (priv->file_manager != NULL)
 		g_key_file_set_string(k, SECTION_GENERAL, "file_manager", priv->file_manager);
 	g_key_file_set_integer(k, SECTION_GENERAL, "autoconnect_interval", priv->autoconnect_interval);
@@ -493,7 +489,6 @@ static void gigolo_settings_finalize(GObject* object)
 	gigolo_settings_write(GIGOLO_SETTINGS(object),
 		GIGOLO_SETTINGS_PREFERENCES | GIGOLO_SETTINGS_BOOKMARKS);
 
-	g_free(priv->vm_impl);
 	g_free(priv->geometry);
 
 	g_ptr_array_foreach(priv->bookmarks, (GFunc) g_object_unref, NULL);
@@ -512,7 +507,6 @@ static void load_settings_read_config(GigoloSettingsPrivate *priv)
 	GKeyFile *k;
 	GError *error = NULL;
 	gsize i;
-	const gchar *default_vm_impl;
 
 	k = g_key_file_new();
 	if (! g_key_file_load_from_file(k, priv->config_filename, G_KEY_FILE_NONE, &error))
@@ -522,11 +516,6 @@ static void load_settings_read_config(GigoloSettingsPrivate *priv)
 		error = NULL;
 	}
 
-	default_vm_impl = g_getenv("GIO_USE_VOLUME_MONITOR");
-	if (! NZV(default_vm_impl))
-		default_vm_impl = DEFAULT_VM_IMPL;
-
-	priv->vm_impl = get_setting_string(k, SECTION_GENERAL, "vm_impl", default_vm_impl);
 	priv->file_manager = get_setting_string(k, SECTION_GENERAL, "file_manager", "gvfs-open");
 	priv->autoconnect_interval = get_setting_int(k, SECTION_GENERAL, "autoconnect_interval",
 		DEFAULT_AUTOCONNECT_INTERVAL);
@@ -681,30 +670,6 @@ GigoloSettings *gigolo_settings_new(void)
 }
 
 
-const gchar *gigolo_settings_get_vm_impl(GigoloSettings *settings)
-{
-	g_return_val_if_fail(settings != NULL, NULL);
-
-	return GIGOLO_SETTINGS_GET_PRIVATE(settings)->vm_impl;
-}
-
-
-void gigolo_settings_set_vm_impl(GigoloSettings *settings, const gchar *impl)
-{
-	GigoloSettingsPrivate *priv;
-
-	g_return_if_fail(settings != NULL);
-
-	priv = GIGOLO_SETTINGS_GET_PRIVATE(settings);
-
-	if (impl == NULL)
-		impl = "hal";
-
-	g_free(priv->vm_impl);
-	priv->vm_impl = g_strdup(impl);
-}
-
-
 const gint *gigolo_settings_get_geometry(GigoloSettings *settings)
 {
 	g_return_val_if_fail(settings != NULL, NULL);



More information about the Xfce4-commits mailing list