gnome-applets r11395 - trunk/drivemount
- From: callum svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-applets r11395 - trunk/drivemount
- Date: Fri, 20 Mar 2009 05:53:15 +0000 (UTC)
Author: callum
Date: Fri Mar 20 05:53:14 2009
New Revision: 11395
URL: http://svn.gnome.org/viewvc/gnome-applets?rev=11395&view=rev
Log:
Add defaults to autoplay in case gconf is down. Make sure gvm_run_command doesn't hang when given an unrecognised % escape sequence.
Modified:
trunk/drivemount/ChangeLog
trunk/drivemount/drive-button.c
Modified: trunk/drivemount/drive-button.c
==============================================================================
--- trunk/drivemount/drive-button.c (original)
+++ trunk/drivemount/drive-button.c Fri Mar 20 05:53:14 2009
@@ -593,6 +593,9 @@
g_string_append (exec, path);
q = p + 2;
p = p + 2;
+ } else {
+ /* Ignore anything else. */
+ p++;
}
}
g_string_append (exec, q);
@@ -798,29 +801,34 @@
}
}
static void
-play_autoplay_media (DriveButton *self, const char *autoplay_key)
+play_autoplay_media (DriveButton *self, const char *autoplay_key,
+ const char *dflt)
{
GConfClient *gconf_client = gconf_client_get_default ();
char *command = gconf_client_get_string (gconf_client,
autoplay_key, NULL);
- if (command) {
- run_command (self, command);
- g_free (command);
- }
+ if (!command)
+ command = g_strdup (dflt);
+
+ run_command (self, command);
+
+ g_free (command);
g_object_unref (gconf_client);
}
static void
play_dvd (DriveButton *self, GtkWidget *item)
{
- play_autoplay_media (self, GCONF_ROOT_AUTOPLAY "autoplay_dvd_command");
+ play_autoplay_media (self, GCONF_ROOT_AUTOPLAY "autoplay_dvd_command",
+ "totem %d");
}
static void
play_cda (DriveButton *self, GtkWidget *item)
{
- play_autoplay_media (self, GCONF_ROOT_AUTOPLAY "autoplay_cda_command");
+ play_autoplay_media (self, GCONF_ROOT_AUTOPLAY "autoplay_cda_command",
+ "sound-juicer -d %d");
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]