Commit 183388d2 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Add nautilus_file_has_activation_uri. Don't show can't write emblems if

2008-01-11  Alexander Larsson  <alexl@redhat.com>

        * libnautilus-private/nautilus-file.[ch]:
	Add nautilus_file_has_activation_uri.
	Don't show can't write emblems if you can't
	write in the parent either.
	
        * libnautilus-private/nautilus-mime-actions.c:
	Don't launch mountables that have no activation uri.



svn path=/trunk/; revision=13591
parent 3b80053c
2008-01-11 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file.[ch]:
Add nautilus_file_has_activation_uri.
Don't show can't write emblems if you can't
write in the parent either.
* libnautilus-private/nautilus-mime-actions.c:
Don't launch mountables that have no activation uri.
2008-01-10 Sven Herzberg <herzi@gnome-de.org>
Don't check for unportable functions, fixes #396923
......
......@@ -2176,6 +2176,9 @@ prepend_automatic_keywords (NautilusFile *file,
GList *names)
{
/* Prepend in reverse order. */
NautilusFile *parent;
parent = nautilus_file_get_parent (file);
#ifdef TRASH_IS_FAST_ENOUGH
if (nautilus_file_is_in_trash (file)) {
......@@ -2191,7 +2194,8 @@ prepend_automatic_keywords (NautilusFile *file,
names = g_list_prepend
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_NOTE));
}
if (!nautilus_file_can_write (file)) {
if (!nautilus_file_can_write (file) &&
(parent == NULL || nautilus_file_can_write (parent))) {
names = g_list_prepend
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_CANT_WRITE));
}
......@@ -2204,6 +2208,11 @@ prepend_automatic_keywords (NautilusFile *file,
(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_SYMBOLIC_LINK));
}
if (parent) {
nautilus_file_unref (parent);
}
return names;
}
......@@ -2954,6 +2963,12 @@ nautilus_file_monitor_remove (NautilusFile *file,
monitor_remove, (file, client));
}
gboolean
nautilus_file_has_activation_uri (NautilusFile *file)
{
return file->details->activation_location != NULL;
}
/* Return the uri associated with the passed-in file, which may not be
* the actual uri if the file is an desktop file or a nautilus
......
......@@ -366,6 +366,7 @@ GList *nautilus_file_list_filter_hidden_and_backup (GList
/* Get the URI that's used when activating the file.
* Getting this can require reading the contents of the file.
*/
gboolean nautilus_file_has_activation_uri (NautilusFile *file);
char * nautilus_file_get_activation_uri (NautilusFile *file);
char * nautilus_file_get_drop_target_uri (NautilusFile *file);
......
......@@ -1346,6 +1346,16 @@ activate_activation_uris_ready_callback (GList *files_ignore,
report_broken_symbolic_link (parameters->parent_window, file);
continue;
}
if (nautilus_file_get_file_type (file) == G_FILE_TYPE_MOUNTABLE &&
!nautilus_file_has_activation_uri (file)) {
/* Don't launch these... There is nothing we
can do */
nautilus_file_unref (file);
parameters->files = g_list_delete_link (parameters->files, l);
continue;
}
}
if (parameters->files == NULL) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment