file-roller r2338 - in trunk: . nautilus
- From: paobac svn gnome org
- To: svn-commits-list gnome org
- Subject: file-roller r2338 - in trunk: . nautilus
- Date: Tue, 24 Jun 2008 09:56:00 +0000 (UTC)
Author: paobac
Date: Tue Jun 24 09:56:00 2008
New Revision: 2338
URL: http://svn.gnome.org/viewvc/file-roller?rev=2338&view=rev
Log:
2008-06-24 Paolo Bacchilega <paobac svn gnome org>
* nautilus/nautilus-fileroller.c: do not add any menu entry when the
files are in an unsupported location, such as 'trash' or 'computer'.
Fixes bug #539629 â Create archive for Trash/Computer
Modified:
trunk/ChangeLog
trunk/nautilus/nautilus-fileroller.c
Modified: trunk/nautilus/nautilus-fileroller.c
==============================================================================
--- trunk/nautilus/nautilus-fileroller.c (original)
+++ trunk/nautilus/nautilus-fileroller.c Tue Jun 24 09:56:00 2008
@@ -201,6 +201,32 @@
}
+static gboolean
+unsupported_scheme (NautilusFileInfo *file)
+{
+ gboolean result = FALSE;
+ GFile *location;
+ char *scheme;
+
+ location = nautilus_file_info_get_location (file);
+ scheme = g_file_get_uri_scheme (location);
+
+ if (scheme != NULL) {
+ const char *unsupported[] = { "trash", "computer", NULL };
+ int i;
+
+ for (i = 0; unsupported[i] != NULL; i++)
+ if (strcmp (scheme, unsupported[i]) == 0)
+ result = TRUE;
+ }
+
+ g_free (scheme);
+ g_object_unref (location);
+
+ return result;
+}
+
+
static GList *
nautilus_fr_get_file_items (NautilusMenuProvider *provider,
GtkWidget *window,
@@ -216,16 +242,19 @@
if (files == NULL)
return NULL;
+ if (unsupported_scheme ((NautilusFileInfo *) files->data))
+ return NULL;
+
for (scan = files; scan; scan = scan->next) {
NautilusFileInfo *file = scan->data;
-
+
if (all_archives && ! is_archive (file))
all_archives = FALSE;
if (can_write) {
NautilusFileInfo *parent;
- parent = nautilus_file_info_get_parent_info (file);
+ parent = nautilus_file_info_get_parent_info (file);
can_write = nautilus_file_info_can_write (parent);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]