[patch] Re: [Utopia] GVM autobrowse patch



On Fri, Aug 13, 2004 at 09:17:27AM -0400, Nathaniel McCallum wrote:
> There is a patch here:
> http://www.no-name-yet.com/patches/gnome-volume-manager_autobrowse.patch
> 
> It adds a checkbox in gvm to Autobrowse filesystems on insert.  When a
> removable filesystem device is inserted gvm will load a nautilus window
> to browse that filesystem (if it is enabled).  There is a string change
> that would need to be translated.

This wasn't being done when the inserted media is either a camara or a video
dvd, but their respective actions are not enabled.

Attached patch fixes this

  Sjoerd
-- 
If all the world's economists were laid end to end, we wouldn't reach a
conclusion.
		-- William Baumol
Index: src/manager.c
===================================================================
RCS file: /cvs/gnome/gnome-volume-manager/src/manager.c,v
retrieving revision 1.28
diff -u -r1.28 manager.c
--- src/manager.c	13 Aug 2004 20:58:23 -0000	1.28
+++ src/manager.c	15 Aug 2004 15:58:43 -0000
@@ -217,31 +217,33 @@
 /*
  * gvm_check_dvd - is this a Video DVD?  If so, do something about it.
  *
- * Returns TRUE if this was a Video DVD and FALSE otherwise.
+ * Returns TRUE if the Video DVD action was taken and FALSE otherwise.
  */
 static gboolean
 gvm_check_dvd (const char *device, const char *mount_point)
 {
 	char *path;
-	gboolean retval;
+	gboolean isdvd;
 
 	path = g_build_path (G_DIR_SEPARATOR_S, mount_point, "video_ts", NULL);
-	retval = g_file_test (path, G_FILE_TEST_IS_DIR);
+	isdvd = g_file_test (path, G_FILE_TEST_IS_DIR);
 	g_free (path);
 
 	/* try the other name, if needed */
-	if (retval == FALSE) {
+	if (isdvd == FALSE) {
 		path = g_build_path (G_DIR_SEPARATOR_S, mount_point,
 				     "VIDEO_TS", NULL);
-		retval = g_file_test (path, G_FILE_TEST_IS_DIR);
+		isdvd = g_file_test (path, G_FILE_TEST_IS_DIR);
 		g_free (path);
 	}
 
-	if (retval && config.autoplay_dvd)
+	if (isdvd && config.autoplay_dvd) {
 		gvm_run_command (device, config.autoplay_dvd_command,
 				 mount_point);
-
-	return retval;
+    return TRUE;
+  }
+  
+	return FALSE;
 }
 
 #define ASK_PHOTOS_MSG	"There are photographs on this device.\n\n" \
@@ -253,7 +255,8 @@
  * unit from a digital camera (e.g., a compact flash card).  If it is, then
  * ask the user if he wants to import the photos.
  *
- * Returns TRUE if there were photos on this device, FALSE otherwise
+ * Returns TRUE if there were photos on this device were imported, 
+ * FALSE otherwise
  *
  * FIXME: Should probably not prompt the user and just do it automatically.
  *        This now makes sense, as gphoto added an import mode.
@@ -271,7 +274,6 @@
 	if (!g_file_test (dcim_path, G_FILE_TEST_IS_DIR))
 		goto out;
 
-	retval = TRUE;
 	dbg ("Photos detected: %s\n", dcim_path);
 
 	/* add the "content.photos" capability to this device */
@@ -279,6 +281,7 @@
 		warn ("failed to set content.photos on %s\n", device);
 
 	if (config.autophoto) {
+	  retval = TRUE;
 		askme = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_QUESTION,
 						GTK_BUTTONS_NONE,
 						_(ASK_PHOTOS_MSG));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]