[nautilus] Don't show autorun hints for Win32 software media



commit cffb9cf70254086a3737b37e8fad786a6e6de414
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Apr 23 19:57:09 2009 +0200

    Don't show autorun hints for Win32 software media
    
    Now that shared-mime-info supports "x-content/win32-software" vs
    "x-content/unix-software", use this distinction to inhibit autorun
    prompts/hints for media containing Win32 software (#524270).
---
 libnautilus-private/nautilus-autorun.c |    9 ++++++++-
 src/nautilus-window-manage-views.c     |    5 +++++
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/libnautilus-private/nautilus-autorun.c b/libnautilus-private/nautilus-autorun.c
index 478085b..8bf6743 100644
--- a/libnautilus-private/nautilus-autorun.c
+++ b/libnautilus-private/nautilus-autorun.c
@@ -869,6 +869,13 @@ do_autorun_for_content_type (GMount *mount, const char *x_content_type, Nautilus
 	ret = FALSE;
 	mount_name = NULL;
 
+	if (g_content_type_is_a (x_content_type, "x-content/win32-software")) {
+		/* don't pop up the dialog anyway if the content type says
+ 		 * windows software.
+ 		 */
+		goto out;
+	}
+
 	user_forced_dialog = is_shift_pressed ();
 
 	nautilus_autorun_get_preferences (x_content_type, &pref_start_app, &pref_ignore, &pref_open_folder);
@@ -955,7 +962,7 @@ show_dialog:
 		media_greeting = _("You have just inserted a medium with digital photos.");
 	} else if (strcmp (x_content_type, "x-content/audio-player") == 0) {
 		media_greeting = _("You have just inserted a digital audio player.");
-	} else if (strcmp (x_content_type, "x-content/software") == 0) {
+	} else if (g_content_type_is_a (x_content_type, "x-content/software")) {
 		media_greeting = _("You have just inserted a medium with software intended to be automatically started.");
 	} else {
 		/* fallback to generic greeting */
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index 280e525..7572fcf 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -1446,6 +1446,11 @@ nautilus_window_slot_show_x_content_bar (NautilusWindowSlot *slot, GMount *mount
 			continue;
 		}
 
+		/* don't show the cluebar for windows software */
+		if (g_content_type_is_a (x_content_types[n], "x-content/win32-software")) {
+			continue;
+		}
+
 		/* only show the cluebar if a default app is available */
 		default_app = g_app_info_get_default_for_type (x_content_types[n], FALSE);
 		if (default_app != NULL)  {



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