diff --git a/.gitignore b/.gitignore index 7108a0e..20649db 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/nautilus-3.8.2.tar.xz +SOURCES/nautilus-3.14.3.tar.xz diff --git a/.nautilus.metadata b/.nautilus.metadata index ba54c58..6aab8fb 100644 --- a/.nautilus.metadata +++ b/.nautilus.metadata @@ -1 +1 @@ -79bdc3f40225fc0aca8774480289c65ebd8b861a SOURCES/nautilus-3.8.2.tar.xz +00f0a63e352c46a728292ae24e7108b0fd8e8cd6 SOURCES/nautilus-3.14.3.tar.xz diff --git a/SOURCES/0001-search-provider-Return-TRUE-from-GDBus-method-handle.patch b/SOURCES/0001-search-provider-Return-TRUE-from-GDBus-method-handle.patch deleted file mode 100644 index 7cee615..0000000 --- a/SOURCES/0001-search-provider-Return-TRUE-from-GDBus-method-handle.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 341423a53d60f11410ef835568b468e79109596d Mon Sep 17 00:00:00 2001 -From: David King -Date: Fri, 20 Sep 2013 15:28:47 +0100 -Subject: [PATCH] search-provider: Return TRUE from GDBus method handlers - -As Matthias Clasen noticed, the signal handlers for the gdbus-codegen -skeleton for the shell search provider have the wrong signature, and -should return TRUE to indicate that the signal has been handled. -Otherwise, it is down to chance if the method is handled or if a -method-not-implemented error is emitted. It seems that the GCC option --fstack-protector-strong causes the default return value to be -interpreted as FALSE, so this might explain why the problem was only -noticed by a wide variety of users recently. - -The bug manifests as Nautilus not returning any search results when -using the gnome-shell activities overview search. - -https://bugzilla.gnome.org/show_bug.cgi?id=692041 ---- - src/nautilus-shell-search-provider.c | 17 +++++++++++------ - 1 file changed, 11 insertions(+), 6 deletions(-) - -diff --git a/src/nautilus-shell-search-provider.c b/src/nautilus-shell-search-provider.c -index 5eaff72..648a07b 100644 ---- a/src/nautilus-shell-search-provider.c -+++ b/src/nautilus-shell-search-provider.c -@@ -460,7 +460,7 @@ execute_search (NautilusShellSearchProvider *self, - g_free (terms_joined); - } - --static void -+static gboolean - handle_get_initial_result_set (NautilusShellSearchProvider2 *skeleton, - GDBusMethodInvocation *invocation, - gchar **terms, -@@ -470,9 +470,10 @@ handle_get_initial_result_set (NautilusShellSearchProvider2 *skeleton, - - g_debug ("****** GetInitialResultSet"); - execute_search (self, invocation, terms); -+ return TRUE; - } - --static void -+static gboolean - handle_get_subsearch_result_set (NautilusShellSearchProvider2 *skeleton, - GDBusMethodInvocation *invocation, - gchar **previous_results, -@@ -483,6 +484,7 @@ handle_get_subsearch_result_set (NautilusShellSearchProvider2 *skeleton, - - g_debug ("****** GetSubSearchResultSet"); - execute_search (self, invocation, terms); -+ return TRUE; - } - - typedef struct { -@@ -596,7 +598,7 @@ result_list_attributes_ready_cb (GList *file_list, - result_metas_data_free (data); - } - --static void -+static gboolean - handle_get_result_metas (NautilusShellSearchProvider2 *skeleton, - GDBusMethodInvocation *invocation, - gchar **results, -@@ -627,7 +629,7 @@ handle_get_result_metas (NautilusShellSearchProvider2 *skeleton, - if (missing_files == NULL) { - result_metas_return_from_cache (data); - result_metas_data_free (data); -- return; -+ return TRUE; - } - - nautilus_file_list_call_when_ready (missing_files, -@@ -636,9 +638,10 @@ handle_get_result_metas (NautilusShellSearchProvider2 *skeleton, - result_list_attributes_ready_cb, - data); - nautilus_file_list_free (missing_files); -+ return TRUE; - } - --static void -+static gboolean - handle_activate_result (NautilusShellSearchProvider2 *skeleton, - GDBusMethodInvocation *invocation, - gchar *result, -@@ -658,9 +661,10 @@ handle_activate_result (NautilusShellSearchProvider2 *skeleton, - } - - nautilus_shell_search_provider2_complete_activate_result (skeleton, invocation); -+ return TRUE; - } - --static void -+static gboolean - handle_launch_search (NautilusShellSearchProvider2 *skeleton, - GDBusMethodInvocation *invocation, - gchar **terms, -@@ -678,6 +682,7 @@ handle_launch_search (NautilusShellSearchProvider2 *skeleton, - g_free (uri); - - nautilus_shell_search_provider2_complete_launch_search (skeleton, invocation); -+ return TRUE; - } - - static void --- -1.8.5.3 - diff --git a/SOURCES/application-actions-use-valid-window-list.patch b/SOURCES/application-actions-use-valid-window-list.patch new file mode 100644 index 0000000..6eee38a --- /dev/null +++ b/SOURCES/application-actions-use-valid-window-list.patch @@ -0,0 +1,46 @@ +From 45413c18167cddaefefc092b63ec75d8fadc6f50 Mon Sep 17 00:00:00 2001 +From: Carlos Soriano +Date: Tue, 6 Oct 2015 16:56:59 +0200 +Subject: [PATCH] application-actions: use valid window list + +We were using the internal list of the application to +iterate through the windows and closing them. +Problem is that when closing one window, the list is modified, +so next time accessing the list we are accessing the "old" +list, which is invalid and makes nautilus crash. + +To fix it make a copy of the list to preserve the consistency. + +https://bugzilla.gnome.org/show_bug.cgi?id=755803 +--- + src/nautilus-application-actions.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/nautilus-application-actions.c b/src/nautilus-application-actions.c +index e346d61..4246786 100644 +--- a/src/nautilus-application-actions.c ++++ b/src/nautilus-application-actions.c +@@ -180,12 +180,19 @@ action_quit (GSimpleAction *action, + { + GtkApplication *application = user_data; + GList *l; ++ GList *windows; + + /* nautilus_window_close() doesn't do anything for desktop windows */ +- for (l = gtk_application_get_windows (GTK_APPLICATION (application)); l; l = l->next) { ++ windows = gtk_application_get_windows (GTK_APPLICATION (application)); ++ /* make a copy, since the original list will be modified when destroying ++ * a window, making this list invalid */ ++ windows = g_list_copy (windows); ++ for (l = windows; l != NULL; l = l->next) { + if (NAUTILUS_IS_WINDOW (l->data)) + nautilus_window_close (NAUTILUS_WINDOW (l->data)); + } ++ ++ g_list_free (windows); + } + + static void +-- +2.5.0 + diff --git a/SOURCES/nautilus-3.14-delete-shortcut-improvements.patch b/SOURCES/nautilus-3.14-delete-shortcut-improvements.patch new file mode 100644 index 0000000..e5e7012 --- /dev/null +++ b/SOURCES/nautilus-3.14-delete-shortcut-improvements.patch @@ -0,0 +1,624 @@ +From 1fc9e88816691e4ceeb0108d1a30017eef1e7210 Mon Sep 17 00:00:00 2001 +From: Carlos Soriano +Date: Thu, 9 Jul 2015 17:15:25 +0200 +Subject: [PATCH 1/3] general: add nautilus delete notification + +So in the next patch we will able to change the delete +shortcut to just del. +--- + .../nautilus-file-undo-operations.c | 8 +- + .../nautilus-file-undo-operations.h | 4 + + src/nautilus-notification.ui | 82 +++++++++++ + src/nautilus-window-private.h | 7 + + src/nautilus-window.c | 164 +++++++++++++++++++-- + src/nautilus.gresource.xml | 1 + + 6 files changed, 251 insertions(+), 15 deletions(-) + create mode 100644 src/nautilus-notification.ui + +diff --git a/libnautilus-private/nautilus-file-undo-operations.c b/libnautilus-private/nautilus-file-undo-operations.c +index 717f6f8..c1e9dab 100644 +--- a/libnautilus-private/nautilus-file-undo-operations.c ++++ b/libnautilus-private/nautilus-file-undo-operations.c +@@ -186,7 +186,7 @@ nautilus_file_undo_info_class_init (NautilusFileUndoInfoClass *klass) + g_object_class_install_properties (oclass, N_PROPERTIES, properties); + } + +-static NautilusFileUndoOp ++NautilusFileUndoOp + nautilus_file_undo_info_get_op_type (NautilusFileUndoInfo *self) + { + return self->priv->op_type; +@@ -965,6 +965,12 @@ struct _NautilusFileUndoInfoTrashDetails { + GHashTable *trashed; + }; + ++GList * ++nautilus_file_undo_info_trash_get_files (NautilusFileUndoInfoTrash *self) ++{ ++ return g_hash_table_get_keys (self->priv->trashed); ++} ++ + static void + trash_strings_func (NautilusFileUndoInfo *info, + gchar **undo_label, +diff --git a/libnautilus-private/nautilus-file-undo-operations.h b/libnautilus-private/nautilus-file-undo-operations.h +index 5a3953f..06db117 100644 +--- a/libnautilus-private/nautilus-file-undo-operations.h ++++ b/libnautilus-private/nautilus-file-undo-operations.h +@@ -95,6 +95,8 @@ void nautilus_file_undo_info_get_strings (NautilusFileUndoInfo *self, + gchar **undo_description, + gchar **redo_label, + gchar **redo_description); ++NautilusFileUndoOp nautilus_file_undo_info_get_op_type (NautilusFileUndoInfo *self); ++ + + /* copy/move/duplicate/link/restore from trash */ + #define NAUTILUS_TYPE_FILE_UNDO_INFO_EXT (nautilus_file_undo_info_ext_get_type ()) +@@ -206,6 +208,8 @@ GType nautilus_file_undo_info_trash_get_type (void) G_GNUC_CONST; + NautilusFileUndoInfo *nautilus_file_undo_info_trash_new (gint item_count); + void nautilus_file_undo_info_trash_add_file (NautilusFileUndoInfoTrash *self, + GFile *file); ++GList *nautilus_file_undo_info_trash_get_files (NautilusFileUndoInfoTrash *self); ++ + + /* recursive permissions */ + #define NAUTILUS_TYPE_FILE_UNDO_INFO_REC_PERMISSIONS (nautilus_file_undo_info_rec_permissions_get_type ()) +diff --git a/src/nautilus-notification.ui b/src/nautilus-notification.ui +new file mode 100644 +index 0000000..bef7a0b +--- /dev/null ++++ b/src/nautilus-notification.ui +@@ -0,0 +1,82 @@ ++ ++ ++ ++ True ++ ++ ++ True ++ False ++ False ++ ++ ++ ++ ++ True ++ False ++ center ++ start ++ 100 ++ ++ ++ True ++ False ++ ++ ++ True ++ False ++ 12 ++ 4 ++ ++ ++ True ++ False ++ 50 ++ middle ++ 30 ++ ++ ++ ++ ++ Undo ++ True ++ True ++ True ++ True ++ 6 ++ ++ ++ ++ ++ ++ True ++ True ++ True ++ none ++ False ++ ++ ++ True ++ False ++ window-close-symbolic ++ 2 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h +index 5531d8e..050c021 100644 +--- a/src/nautilus-window-private.h ++++ b/src/nautilus-window-private.h +@@ -72,6 +72,13 @@ struct NautilusWindowDetails + + guint sidebar_width_handler_id; + guint bookmarks_id; ++ ++ /* Notifications */ ++ GtkWidget *notification_delete; ++ GtkWidget *notification_delete_label; ++ GtkWidget *notification_delete_close; ++ GtkWidget *notification_delete_undo; ++ guint notification_delete_timeout_id; + }; + + /* window geometry */ +diff --git a/src/nautilus-window.c b/src/nautilus-window.c +index 38dea35..7b4d864 100644 +--- a/src/nautilus-window.c ++++ b/src/nautilus-window.c +@@ -59,6 +59,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -90,6 +92,8 @@ static void use_extra_mouse_buttons_changed (gpointer + */ + #define UPPER_MOUSE_LIMIT 14 + ++#define NOTIFICATION_TIMEOUT 6 //s ++ + enum { + PROP_DISABLE_CHROME = 1, + NUM_PROPERTIES, +@@ -1392,12 +1396,12 @@ notebook_create_window_cb (GtkNotebook *notebook, + return GTK_NOTEBOOK (new_window->details->notebook); + } + +-static GtkWidget * +-create_notebook (NautilusWindow *window) ++static void ++connect_notebook (NautilusWindow *window) + { + GtkWidget *notebook; + +- notebook = g_object_new (NAUTILUS_TYPE_NOTEBOOK, NULL); ++ notebook = window->details->notebook; + g_signal_connect (notebook, "tab-close-request", + G_CALLBACK (notebook_tab_close_requested), + window); +@@ -1419,17 +1423,124 @@ create_notebook (NautilusWindow *window) + g_signal_connect_after (notebook, "button-press-event", + G_CALLBACK (notebook_button_press_cb), + window); ++} ++ ++static void ++nautilus_window_on_notification_delete_undo_clicked (GtkWidget *notification, ++ gpointer user_data) ++{ ++ NautilusWindow *window; ++ ++ window = NAUTILUS_WINDOW (user_data); ++ ++ if (window->details->notification_delete_timeout_id != 0) { ++ g_source_remove (window->details->notification_delete_timeout_id); ++ window->details->notification_delete_timeout_id = 0; ++ } ++ ++ gtk_revealer_set_reveal_child (GTK_REVEALER (window->details->notification_delete), FALSE); ++ nautilus_file_undo_manager_undo (GTK_WINDOW (window)); ++} ++ ++static void ++nautilus_window_on_notification_delete_close_clicked (GtkWidget *notification, ++ gpointer user_data) ++{ ++ NautilusWindow *window; ++ ++ window = NAUTILUS_WINDOW (user_data); ++ ++ if (window->details->notification_delete_timeout_id != 0) { ++ g_source_remove (window->details->notification_delete_timeout_id); ++ window->details->notification_delete_timeout_id = 0; ++ } ++ ++ gtk_revealer_set_reveal_child (GTK_REVEALER (window->details->notification_delete), FALSE); ++} ++ ++static gboolean ++nautilus_window_on_notification_delete_timeout (gpointer user_data) ++{ ++ NautilusWindow *window; ++ ++ window = NAUTILUS_WINDOW (user_data); ++ ++ if (window->details->notification_delete_timeout_id != 0) { ++ g_source_remove (window->details->notification_delete_timeout_id); ++ window->details->notification_delete_timeout_id = 0; ++ } ++ ++ gtk_revealer_set_reveal_child (GTK_REVEALER (window->details->notification_delete), FALSE); + +- gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); +- gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); +- gtk_widget_show (notebook); +- gtk_container_set_border_width (GTK_CONTAINER (notebook), 0); ++ return FALSE; ++} ++ ++static char * ++nautilus_window_notification_delete_get_label (NautilusFileUndoInfo *undo_info, ++ GList *files) ++{ ++ gchar *file_label; ++ gchar *label; ++ gint length; ++ ++ length = g_list_length (files); ++ if (length == 1) { ++ file_label = g_file_get_basename (files->data); ++ /* Translators: only one item has been deleted and %s is its name. */ ++ label = g_strdup_printf (_("“%s” deleted"), file_label); ++ g_free (file_label); ++ } else { ++ /* Translators: one or more items might have been deleted, and %d ++ * is the count. */ ++ label = g_strdup_printf (ngettext ("%d file deleted", "%d files deleted", length), length); ++ } + +- gtk_box_pack_start (GTK_BOX (window->details->main_view), +- notebook, +- TRUE, TRUE, 0); ++ return label; ++} + +- return notebook; ++static void ++nautilus_window_on_undo_changed (NautilusFileUndoManager *manager, ++ NautilusWindow *window) ++{ ++ NautilusFileUndoInfo *undo_info; ++ NautilusFileUndoManagerState state; ++ int transition_durantion; ++ gchar *label; ++ GList *files; ++ ++ /* Hide it inmediatily so we can animate the new notification. */ ++ transition_durantion = gtk_revealer_get_transition_duration (GTK_REVEALER (window->details->notification_delete)); ++ gtk_revealer_set_transition_duration (GTK_REVEALER (window->details->notification_delete), 0); ++ gtk_revealer_set_reveal_child (GTK_REVEALER (window->details->notification_delete), FALSE); ++ gtk_revealer_set_transition_duration (GTK_REVEALER (window->details->notification_delete), transition_durantion); ++ if (window->details->notification_delete_timeout_id != 0) { ++ g_source_remove (window->details->notification_delete_timeout_id); ++ window->details->notification_delete_timeout_id = 0; ++ } ++ ++ undo_info = nautilus_file_undo_manager_get_action (); ++ state = nautilus_file_undo_manager_get_state (); ++ ++ if (undo_info != NULL && ++ state == NAUTILUS_FILE_UNDO_MANAGER_STATE_UNDO && ++ nautilus_file_undo_info_get_op_type (undo_info) == NAUTILUS_FILE_UNDO_OP_MOVE_TO_TRASH && ++ !NAUTILUS_IS_DESKTOP_WINDOW (window)) { ++ files = nautilus_file_undo_info_trash_get_files (NAUTILUS_FILE_UNDO_INFO_TRASH (undo_info)); ++ ++ /* Don't pop up a notification if user canceled the operation or the focus ++ * is not in the this window. This is an easy way to know from which window ++ * was the delete operation made */ ++ if (g_list_length (files) > 0 && gtk_window_has_toplevel_focus (GTK_WINDOW (window))) { ++ label = nautilus_window_notification_delete_get_label (undo_info, files); ++ gtk_label_set_markup (GTK_LABEL (window->details->notification_delete_label), label); ++ gtk_revealer_set_reveal_child (GTK_REVEALER (window->details->notification_delete), TRUE); ++ window->details->notification_delete_timeout_id = g_timeout_add_seconds (NOTIFICATION_TIMEOUT, ++ nautilus_window_on_notification_delete_timeout, ++ window); ++ g_free (label); ++ } ++ g_list_free (files); ++ } + } + + static void +@@ -1439,6 +1550,7 @@ nautilus_window_constructed (GObject *self) + GtkWidget *grid; + NautilusWindowSlot *slot; + NautilusApplication *application; ++ GtkBuilder *builder; + + window = NAUTILUS_WINDOW (self); + +@@ -1476,13 +1588,30 @@ nautilus_window_constructed (GObject *self) + gtk_container_add (GTK_CONTAINER (grid), window->details->content_paned); + gtk_widget_show (window->details->content_paned); + +- window->details->main_view = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); ++ g_type_ensure (NAUTILUS_TYPE_NOTEBOOK); ++ builder = gtk_builder_new_from_resource ("/org/gnome/nautilus/nautilus-notification.ui"); ++ ++ window->details->main_view = GTK_WIDGET (gtk_builder_get_object (builder, "main_view")); + gtk_paned_pack2 (GTK_PANED (window->details->content_paned), window->details->main_view, + TRUE, FALSE); + gtk_widget_show (window->details->main_view); + +- window->details->notebook = create_notebook (window); +- nautilus_window_set_initial_window_geometry (window); ++ window->details->notebook = GTK_WIDGET (gtk_builder_get_object (builder, "notebook")); ++ connect_notebook (window); ++ window->details->notification_delete = GTK_WIDGET (gtk_builder_get_object (builder, "notification_delete")); ++ window->details->notification_delete_label = GTK_WIDGET (gtk_builder_get_object (builder, "notification_delete_label")); ++ window->details->notification_delete_undo = GTK_WIDGET (gtk_builder_get_object (builder, "notification_delete_undo")); ++ window->details->notification_delete_close = GTK_WIDGET (gtk_builder_get_object (builder, "notification_delete_close")); ++ ++ g_object_unref (builder); ++ ++ g_signal_connect_object (window->details->notification_delete_close, "clicked", ++ G_CALLBACK (nautilus_window_on_notification_delete_close_clicked), window, 0); ++ g_signal_connect_object (window->details->notification_delete_undo, "clicked", ++ G_CALLBACK (nautilus_window_on_notification_delete_undo_clicked), window, 0);nautilus_window_set_initial_window_geometry (window); ++ ++ g_signal_connect_after (nautilus_file_undo_manager_get (), "undo-changed", ++ G_CALLBACK (nautilus_window_on_undo_changed), self); + + slot = nautilus_window_open_slot (window, 0); + nautilus_window_set_active_slot (window, slot); +@@ -1604,6 +1733,13 @@ nautilus_window_finalize (GObject *object) + window->details->sidebar_width_handler_id = 0; + } + ++ if (window->details->notification_delete_timeout_id != 0) { ++ g_source_remove (window->details->notification_delete_timeout_id); ++ window->details->notification_delete_timeout_id = 0; ++ } ++ ++ g_signal_handlers_disconnect_by_data (nautilus_file_undo_manager_get (), window); ++ + g_clear_object (&window->details->ui_manager); + + /* nautilus_window_close() should have run */ +diff --git a/src/nautilus.gresource.xml b/src/nautilus.gresource.xml +index 37a5bbf..0abdeb0 100644 +--- a/src/nautilus.gresource.xml ++++ b/src/nautilus.gresource.xml +@@ -8,6 +8,7 @@ + nautilus-directory-view-ui.xml + nautilus-list-view-ui.xml + nautilus-shell-ui.xml ++ nautilus-notification.ui + nautilus-app-menu.ui + ../icons/thumbnail_frame.png + ../icons/filmholes.png +-- +2.5.0 + +From 32608e0ea470cdbe05bd3d2e3b3588cbe9ba39bc Mon Sep 17 00:00:00 2001 +From: Carlos Soriano +Date: Thu, 9 Jul 2015 17:18:28 +0200 +Subject: [PATCH 2/3] view: change delete shortcut + +To just the del key. +--- + src/nautilus-view.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nautilus-view.c b/src/nautilus-view.c +index 20590c4..b729339 100644 +--- a/src/nautilus-view.c ++++ b/src/nautilus-view.c +@@ -7208,7 +7208,7 @@ static const GtkActionEntry directory_view_entries[] = { + /* tooltip */ NULL, + G_CALLBACK (action_rename_select_all_callback) }, + /* name, stock id */ { NAUTILUS_ACTION_TRASH, NULL, +- /* label, accelerator */ N_("Mo_ve to Trash"), "Delete", ++ /* label, accelerator */ N_("Mo_ve to Trash"), "Delete", + /* tooltip */ N_("Move each selected item to the Trash"), + G_CALLBACK (action_trash_callback) }, + /* name, stock id */ { NAUTILUS_ACTION_DELETE, NULL, +-- +2.5.0 + +From 10bc4b82d158ba93ee179bbb0f7231fa44299876 Mon Sep 17 00:00:00 2001 +From: Carlos Soriano +Date: Fri, 10 Jul 2015 17:14:27 +0200 +Subject: [PATCH 3/3] application: add a warning for the move to trash shortcut + +Since we changed it, better so warn the user in case he use +the old shortcut. +--- + libnautilus-private/nautilus-global-preferences.h | 3 ++ + .../org.gnome.nautilus.gschema.xml.in | 5 +++ + src/nautilus-application-actions.c | 46 ++++++++++++++++++++++ + src/nautilus-move-to-trash-shortcut-changed.ui | 24 +++++++++++ + src/nautilus-view.c | 4 -- + src/nautilus.gresource.xml | 1 + + 6 files changed, 79 insertions(+), 4 deletions(-) + create mode 100644 src/nautilus-move-to-trash-shortcut-changed.ui + +diff --git a/libnautilus-private/nautilus-global-preferences.h b/libnautilus-private/nautilus-global-preferences.h +index 5ec3e08..3cef2a3 100644 +--- a/libnautilus-private/nautilus-global-preferences.h ++++ b/libnautilus-private/nautilus-global-preferences.h +@@ -159,6 +159,9 @@ typedef enum + /* Recent files */ + #define NAUTILUS_PREFERENCES_RECENT_FILES_ENABLED "remember-recent-files" + ++/* Move to trash shorcut changed dialog */ ++#define NAUTILUS_PREFERENCES_SHOW_MOVE_TO_TRASH_SHORTCUT_CHANGED_DIALOG "show-move-to-trash-shortcut-changed-dialog" ++ + + void nautilus_global_preferences_init (void); + char *nautilus_global_preferences_get_default_folder_viewer_preference_as_iid (void); +diff --git a/libnautilus-private/org.gnome.nautilus.gschema.xml.in b/libnautilus-private/org.gnome.nautilus.gschema.xml.in +index ba344a2..71d94b8 100644 +--- a/libnautilus-private/org.gnome.nautilus.gschema.xml.in ++++ b/libnautilus-private/org.gnome.nautilus.gschema.xml.in +@@ -104,6 +104,11 @@ + <_summary>Use extra mouse button events in Nautilus' browser window + <_description>For users with mice that have "Forward" and "Back" buttons, this key will determine if any action is taken inside of Nautilus when either is pressed. + ++ ++ true ++ <_summary>Show a warning dialog for the change of the shorcut for move to trash ++ <_description>Show a warning dialog for the change of the shorcut for move to trash from control + delete to just delete. ++ + + 9 + <_summary>Mouse button to activate the "Forward" command in browser window +diff --git a/src/nautilus-application-actions.c b/src/nautilus-application-actions.c +index e346d61..b759b7a 100644 +--- a/src/nautilus-application-actions.c ++++ b/src/nautilus-application-actions.c +@@ -21,6 +21,7 @@ + + #include "nautilus-application-actions.h" + ++#include "nautilus-global-preferences.h" + #include "nautilus-desktop-window.h" + #include "nautilus-file-management-properties.h" + +@@ -233,6 +234,49 @@ action_search (GSimpleAction *action, + g_object_unref (location); + } + ++static void ++got_it_clicked (GtkDialog *dialog, ++ gint response_id, ++ gpointer user_data) ++{ ++ g_settings_set_boolean (nautilus_preferences, ++ NAUTILUS_PREFERENCES_SHOW_MOVE_TO_TRASH_SHORTCUT_CHANGED_DIALOG, ++ FALSE); ++} ++ ++static void ++action_show_move_to_trash_shortcut_changed_dialog (GSimpleAction *action, ++ GVariant *parameter, ++ gpointer user_data) ++{ ++ GtkApplication *app; ++ GtkWindow *window; ++ GtkWindow *dialog; ++ GtkBuilder *builder; ++ gboolean show_dialog_preference; ++ ++ app = GTK_APPLICATION (user_data); ++ show_dialog_preference = g_settings_get_boolean (nautilus_preferences, ++ NAUTILUS_PREFERENCES_SHOW_MOVE_TO_TRASH_SHORTCUT_CHANGED_DIALOG); ++ if (show_dialog_preference) { ++ builder = gtk_builder_new_from_resource ("/org/gnome/nautilus/nautilus-move-to-trash-shortcut-changed.ui"); ++ dialog = GTK_WINDOW (gtk_builder_get_object (builder, "move_to_trash_shortcut_changed_dialog")); ++ ++ window = gtk_application_get_active_window (app); ++ gtk_window_set_transient_for (dialog, window); ++ g_signal_connect (dialog, "response", ++ G_CALLBACK (got_it_clicked), ++ window); ++ ++ gtk_widget_show (GTK_WIDGET (dialog)); ++ gtk_dialog_run(GTK_DIALOG (dialog)); ++ gtk_widget_destroy (GTK_WIDGET (dialog)); ++ ++ g_object_unref (builder); ++ } ++} ++ ++ + static GActionEntry app_entries[] = { + { "new-window", action_new_window, NULL, NULL, NULL }, + { "connect-to-server", action_connect_to_server, NULL, NULL, NULL }, +@@ -246,6 +290,7 @@ static GActionEntry app_entries[] = { + { "kill", action_kill, NULL, NULL, NULL }, + { "open-desktop", action_open_desktop, NULL, NULL, NULL }, + { "close-desktop", action_close_desktop, NULL, NULL, NULL }, ++ { "show-move-to-trash-shortcut-changed-dialog", action_show_move_to_trash_shortcut_changed_dialog, NULL, NULL, NULL }, + }; + + void +@@ -259,6 +304,7 @@ nautilus_init_application_actions (NautilusApplication *app) + app_entries, G_N_ELEMENTS (app_entries), + app); + gtk_application_add_accelerator (GTK_APPLICATION (app), "F10", "win.gear-menu", NULL); ++ gtk_application_add_accelerator (GTK_APPLICATION (app), "Delete", "app.show-move-to-trash-shortcut-changed-dialog", NULL); + + builder = gtk_builder_new (); + gtk_builder_add_from_resource (builder, "/org/gnome/nautilus/nautilus-app-menu.ui", &error); +diff --git a/src/nautilus-move-to-trash-shortcut-changed.ui b/src/nautilus-move-to-trash-shortcut-changed.ui +new file mode 100644 +index 0000000..7074b41 +--- /dev/null ++++ b/src/nautilus-move-to-trash-shortcut-changed.ui +@@ -0,0 +1,24 @@ ++ ++ ++ ++ ++ ++ False ++ True ++ center-on-parent ++ True ++ dialog ++ Delete Shortcuts Have Changed ++ With the latest version of Files, you no longer need to hold Ctrl to delete—the Delete key will work when pressed on its own. ++ ++ ++ Got it ++ True ++ ++ ++ ++ button_got_it ++ ++ ++ ++ +diff --git a/src/nautilus-view.c b/src/nautilus-view.c +index b729339..60eb29e 100644 +--- a/src/nautilus-view.c ++++ b/src/nautilus-view.c +@@ -9851,10 +9851,6 @@ nautilus_view_class_init (NautilusViewClass *klass) + g_object_class_install_properties (oclass, NUM_PROPERTIES, properties); + + binding_set = gtk_binding_set_by_class (klass); +- gtk_binding_entry_add_signal (binding_set, GDK_KEY_Delete, GDK_CONTROL_MASK, +- "trash", 0); +- gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, GDK_CONTROL_MASK, +- "trash", 0); + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Delete, GDK_SHIFT_MASK, + "delete", 0); + } +diff --git a/src/nautilus.gresource.xml b/src/nautilus.gresource.xml +index 0abdeb0..c6f42dc 100644 +--- a/src/nautilus.gresource.xml ++++ b/src/nautilus.gresource.xml +@@ -10,6 +10,7 @@ + nautilus-shell-ui.xml + nautilus-notification.ui + nautilus-app-menu.ui ++ nautilus-move-to-trash-shortcut-changed.ui + ../icons/thumbnail_frame.png + ../icons/filmholes.png + ../icons/knob.png +-- +2.5.0 + diff --git a/SOURCES/nautilus-3.8-fix-chown.patch b/SOURCES/nautilus-3.8-fix-chown.patch deleted file mode 100644 index 64bbf33..0000000 --- a/SOURCES/nautilus-3.8-fix-chown.patch +++ /dev/null @@ -1,608 +0,0 @@ -From a56e545824e0cdce4bbfbdf9fc54aa7405194cd9 Mon Sep 17 00:00:00 2001 -From: Alexander Larsson -Date: Thu, 21 Aug 2014 12:17:31 +0200 -Subject: [PATCH] Fix crash when changing owner of file - -Cherry picked commits from git master: -ab6aa9aca1c25c34e3f1aece63efbe05a2984397 -bfa2d63249a1f5de986f7f1ad21d79920fa4947f -f7d1394a03e6d02cd5c67f9c85a142e33f14566f - -https://bugzilla.redhat.com/show_bug.cgi?id=1090999 ---- - libnautilus-private/nautilus-file.c | 3 +- - src/nautilus-properties-window.c | 354 +++++++++++++++++------------------- - 2 files changed, 164 insertions(+), 193 deletions(-) - -diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c -index 5e837f6..efef296 100644 ---- a/libnautilus-private/nautilus-file.c -+++ b/libnautilus-private/nautilus-file.c -@@ -5670,7 +5670,8 @@ nautilus_file_get_owner_as_string (NautilusFile *file, gboolean include_real_nam - return NULL; - } - -- if (file->details->uid == getuid ()) { -+ if (include_real_name && -+ file->details->uid == getuid ()) { - /* Translators: "Me" is used to indicate the file is owned by me (the current user) */ - user_name = g_strdup (_("Me")); - } else if (file->details->owner_real == NULL) { -diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c -index 6793b7a..7a81ddd 100644 ---- a/src/nautilus-properties-window.c -+++ b/src/nautilus-properties-window.c -@@ -89,6 +89,22 @@ - static GHashTable *windows; - static GHashTable *pending_lists; - -+typedef struct { -+ NautilusFile *file; -+ char *owner; -+ GtkWindow *window; -+ unsigned int timeout; -+ gboolean cancelled; -+} OwnerChange; -+ -+typedef struct { -+ NautilusFile *file; -+ char *group; -+ GtkWindow *window; -+ unsigned int timeout; -+ gboolean cancelled; -+} GroupChange; -+ - struct NautilusPropertiesWindowDetails { - GList *original_files; - GList *target_files; -@@ -112,12 +128,8 @@ struct NautilusPropertiesWindowDetails { - guint update_directory_contents_timeout_id; - guint update_files_timeout_id; - -- NautilusFile *group_change_file; -- char *group_change_group; -- unsigned int group_change_timeout; -- NautilusFile *owner_change_file; -- char *owner_change_owner; -- unsigned int owner_change_timeout; -+ GroupChange *group_change; -+ OwnerChange *owner_change; - - GList *permission_buttons; - GList *permission_combos; -@@ -208,8 +220,8 @@ static void properties_window_update (NautilusPropertiesWindow *win - GList *files); - static void is_directory_ready_callback (NautilusFile *file, - gpointer data); --static void cancel_group_change_callback (NautilusPropertiesWindow *window); --static void cancel_owner_change_callback (NautilusPropertiesWindow *window); -+static void cancel_group_change_callback (GroupChange *change); -+static void cancel_owner_change_callback (OwnerChange *change); - static void parent_widget_destroyed_callback (GtkWidget *widget, - gpointer callback_data); - static void select_image_button_callback (GtkWidget *widget, -@@ -1363,78 +1375,70 @@ attach_ellipsizing_value_field (NautilusPropertiesWindow *window, - } - - static void -+group_change_free (GroupChange *change) -+{ -+ nautilus_file_unref (change->file); -+ g_free (change->group); -+ g_object_unref (change->window); -+ -+ g_free (change); -+} -+ -+static void - group_change_callback (NautilusFile *file, - GFile *res_loc, - GError *error, -- NautilusPropertiesWindow *window) -+ GroupChange *change) - { -- char *group; -- -- g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (window)); -- g_assert (window->details->group_change_file == file); -+ NautilusPropertiesWindow *window; - -- group = window->details->group_change_group; -- g_assert (group != NULL); -+ g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (change->window)); -+ g_assert (NAUTILUS_IS_FILE (change->file)); -+ g_assert (change->group != NULL); - -- /* Report the error if it's an error. */ -- eel_timed_wait_stop ((EelCancelCallback) cancel_group_change_callback, window); -- nautilus_report_error_setting_group (file, error, GTK_WINDOW (window)); -+ if (!change->cancelled) { -+ /* Report the error if it's an error. */ -+ eel_timed_wait_stop ((EelCancelCallback) cancel_group_change_callback, change); -+ nautilus_report_error_setting_group (change->file, error, change->window); -+ } - -- nautilus_file_unref (file); -- g_free (group); -+ window = NAUTILUS_PROPERTIES_WINDOW(change->window); -+ if (window->details->group_change == change) { -+ window->details->group_change = NULL; -+ } - -- window->details->group_change_file = NULL; -- window->details->group_change_group = NULL; -- g_object_unref (G_OBJECT (window)); -+ group_change_free (change); - } - - static void --cancel_group_change_callback (NautilusPropertiesWindow *window) -+cancel_group_change_callback (GroupChange *change) - { -- NautilusFile *file; -- char *group; -+ g_assert (NAUTILUS_IS_FILE (change->file)); -+ g_assert (change->group != NULL); - -- file = window->details->group_change_file; -- g_assert (NAUTILUS_IS_FILE (file)); -- -- group = window->details->group_change_group; -- g_assert (group != NULL); -- -- nautilus_file_cancel (file, (NautilusFileOperationCallback) group_change_callback, window); -- -- g_free (group); -- nautilus_file_unref (file); -- -- window->details->group_change_file = NULL; -- window->details->group_change_group = NULL; -- g_object_unref (window); -+ change->cancelled = TRUE; -+ nautilus_file_cancel (change->file, (NautilusFileOperationCallback) group_change_callback, change); - } - - static gboolean --schedule_group_change_timeout (NautilusPropertiesWindow *window) -+schedule_group_change_timeout (GroupChange *change) - { -- NautilusFile *file; -- char *group; -+ g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (change->window)); -+ g_assert (NAUTILUS_IS_FILE (change->file)); -+ g_assert (change->group != NULL); - -- g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (window)); -- -- file = window->details->group_change_file; -- g_assert (NAUTILUS_IS_FILE (file)); -- -- group = window->details->group_change_group; -- g_assert (group != NULL); -+ change->timeout = 0; - - eel_timed_wait_start - ((EelCancelCallback) cancel_group_change_callback, -- window, -+ change, - _("Cancel Group Change?"), -- GTK_WINDOW (window)); -+ change->window); - - nautilus_file_set_group -- (file, group, -- (NautilusFileOperationCallback) group_change_callback, window); -+ (change->file, change->group, -+ (NautilusFileOperationCallback) group_change_callback, change); - -- window->details->group_change_timeout = 0; - return FALSE; - } - -@@ -1443,55 +1447,45 @@ schedule_group_change (NautilusPropertiesWindow *window, - NautilusFile *file, - const char *group) - { -+ GroupChange *change; -+ - g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (window)); -- g_assert (window->details->group_change_group == NULL); -- g_assert (window->details->group_change_file == NULL); -+ g_assert (window->details->group_change == NULL); - g_assert (NAUTILUS_IS_FILE (file)); - -- window->details->group_change_file = nautilus_file_ref (file); -- window->details->group_change_group = g_strdup (group); -- g_object_ref (G_OBJECT (window)); -- window->details->group_change_timeout = -+ change = g_new0 (GroupChange, 1); -+ -+ change->file = nautilus_file_ref (file); -+ change->group = g_strdup (group); -+ change->window = g_object_ref (G_OBJECT (window)); -+ change->timeout = - g_timeout_add (CHOWN_CHGRP_TIMEOUT, - (GSourceFunc) schedule_group_change_timeout, -- window); -+ change); -+ -+ window->details->group_change = change; - } - - static void - unschedule_or_cancel_group_change (NautilusPropertiesWindow *window) - { -- NautilusFile *file; -- char *group; -+ GroupChange *change; - - g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (window)); - -- file = window->details->group_change_file; -- group = window->details->group_change_group; -- -- g_assert ((file == NULL && group == NULL) || -- (file != NULL && group != NULL)); -+ change = window->details->group_change; - -- if (file != NULL) { -- g_assert (NAUTILUS_IS_FILE (file)); -- -- if (window->details->group_change_timeout == 0) { -- nautilus_file_cancel (file, -- (NautilusFileOperationCallback) group_change_callback, window); -- eel_timed_wait_stop ((EelCancelCallback) cancel_group_change_callback, window); -+ if (change != NULL) { -+ if (change->timeout == 0) { -+ /* The operation was started, cancel it and let the operation callback free the change */ -+ cancel_group_change_callback (change); -+ eel_timed_wait_stop ((EelCancelCallback) cancel_group_change_callback, change); -+ } else { -+ g_source_remove (change->timeout); -+ group_change_free (change); - } - -- nautilus_file_unref (file); -- g_free (group); -- -- window->details->group_change_file = NULL; -- window->details->group_change_group = NULL; -- g_object_unref (G_OBJECT (window)); -- } -- -- if (window->details->group_change_timeout > 0) { -- g_assert (file != NULL); -- g_source_remove (window->details->group_change_timeout); -- window->details->group_change_timeout = 0; -+ window->details->group_change = NULL; - } - } - -@@ -1713,18 +1707,18 @@ combo_box_row_separator_func (GtkTreeModel *model, - static GtkComboBox * - attach_combo_box (GtkGrid *grid, - GtkWidget *sibling, -- gboolean two_columns) -+ gboolean three_columns) - { - GtkWidget *combo_box; - GtkWidget *aligner; - -- if (!two_columns) { -+ if (!three_columns) { - combo_box = gtk_combo_box_text_new (); - } else { - GtkTreeModel *model; - GtkCellRenderer *renderer; - -- model = GTK_TREE_MODEL (gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING)); -+ model = GTK_TREE_MODEL (gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING)); - combo_box = gtk_combo_box_new_with_model (model); - g_object_unref (G_OBJECT (model)); - -@@ -1778,78 +1772,70 @@ attach_group_combo_box (GtkGrid *grid, - } - - static void -+owner_change_free (OwnerChange *change) -+{ -+ nautilus_file_unref (change->file); -+ g_free (change->owner); -+ g_object_unref (change->window); -+ -+ g_free (change); -+} -+ -+static void - owner_change_callback (NautilusFile *file, - GFile *result_location, - GError *error, -- NautilusPropertiesWindow *window) -+ OwnerChange *change) - { -- char *owner; -- -- g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (window)); -- g_assert (window->details->owner_change_file == file); -+ NautilusPropertiesWindow *window; - -- owner = window->details->owner_change_owner; -- g_assert (owner != NULL); -+ g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (change->window)); -+ g_assert (NAUTILUS_IS_FILE (change->file)); -+ g_assert (change->owner != NULL); - -- /* Report the error if it's an error. */ -- eel_timed_wait_stop ((EelCancelCallback) cancel_owner_change_callback, window); -- nautilus_report_error_setting_owner (file, error, GTK_WINDOW (window)); -+ if (!change->cancelled) { -+ /* Report the error if it's an error. */ -+ eel_timed_wait_stop ((EelCancelCallback) cancel_owner_change_callback, change); -+ nautilus_report_error_setting_owner (file, error, change->window); -+ } - -- nautilus_file_unref (file); -- g_free (owner); -+ window = NAUTILUS_PROPERTIES_WINDOW(change->window); -+ if (window->details->owner_change == change) { -+ window->details->owner_change = NULL; -+ } - -- window->details->owner_change_file = NULL; -- window->details->owner_change_owner = NULL; -- g_object_unref (G_OBJECT (window)); -+ owner_change_free (change); - } - - static void --cancel_owner_change_callback (NautilusPropertiesWindow *window) -+cancel_owner_change_callback (OwnerChange *change) - { -- NautilusFile *file; -- char *owner; -- -- file = window->details->owner_change_file; -- g_assert (NAUTILUS_IS_FILE (file)); -- -- owner = window->details->owner_change_owner; -- g_assert (owner != NULL); -- -- nautilus_file_cancel (file, (NautilusFileOperationCallback) owner_change_callback, window); -- -- nautilus_file_unref (file); -- g_free (owner); -+ g_assert (NAUTILUS_IS_FILE (change->file)); -+ g_assert (change->owner != NULL); - -- window->details->owner_change_file = NULL; -- window->details->owner_change_owner = NULL; -- g_object_unref (window); -+ change->cancelled = TRUE; -+ nautilus_file_cancel (change->file, (NautilusFileOperationCallback) owner_change_callback, change); - } - - static gboolean --schedule_owner_change_timeout (NautilusPropertiesWindow *window) -+schedule_owner_change_timeout (OwnerChange *change) - { -- NautilusFile *file; -- char *owner; -- -- g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (window)); -- -- file = window->details->owner_change_file; -- g_assert (NAUTILUS_IS_FILE (file)); -+ g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (change->window)); -+ g_assert (NAUTILUS_IS_FILE (change->file)); -+ g_assert (change->owner != NULL); - -- owner = window->details->owner_change_owner; -- g_assert (owner != NULL); -+ change->timeout = 0; - - eel_timed_wait_start - ((EelCancelCallback) cancel_owner_change_callback, -- window, -+ change, - _("Cancel Owner Change?"), -- GTK_WINDOW (window)); -+ change->window); - - nautilus_file_set_owner -- (file, owner, -- (NautilusFileOperationCallback) owner_change_callback, window); -+ (change->file, change->owner, -+ (NautilusFileOperationCallback) owner_change_callback, change); - -- window->details->owner_change_timeout = 0; - return FALSE; - } - -@@ -1858,55 +1844,47 @@ schedule_owner_change (NautilusPropertiesWindow *window, - NautilusFile *file, - const char *owner) - { -+ OwnerChange *change; -+ - g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (window)); -- g_assert (window->details->owner_change_owner == NULL); -- g_assert (window->details->owner_change_file == NULL); -+ g_assert (window->details->owner_change == NULL); - g_assert (NAUTILUS_IS_FILE (file)); - -- window->details->owner_change_file = nautilus_file_ref (file); -- window->details->owner_change_owner = g_strdup (owner); -- g_object_ref (G_OBJECT (window)); -- window->details->owner_change_timeout = -+ change = g_new0 (OwnerChange, 1); -+ -+ change->file = nautilus_file_ref (file); -+ change->owner = g_strdup (owner); -+ change->window = g_object_ref (G_OBJECT (window)); -+ change->timeout = - g_timeout_add (CHOWN_CHGRP_TIMEOUT, - (GSourceFunc) schedule_owner_change_timeout, -- window); -+ change); -+ -+ window->details->owner_change = change; - } - - static void - unschedule_or_cancel_owner_change (NautilusPropertiesWindow *window) - { -- NautilusFile *file; -- char *owner; -+ OwnerChange *change; - - g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (window)); - -- file = window->details->owner_change_file; -- owner = window->details->owner_change_owner; -+ change = window->details->owner_change; - -- g_assert ((file == NULL && owner == NULL) || -- (file != NULL && owner != NULL)); -+ if (change != NULL) { -+ g_assert (NAUTILUS_IS_FILE (change->file)); - -- if (file != NULL) { -- g_assert (NAUTILUS_IS_FILE (file)); -- -- if (window->details->owner_change_timeout == 0) { -- nautilus_file_cancel (file, -- (NautilusFileOperationCallback) owner_change_callback, window); -- eel_timed_wait_stop ((EelCancelCallback) cancel_owner_change_callback, window); -+ if (change->timeout == 0) { -+ /* The operation was started, cancel it and let the operation callback free the change */ -+ cancel_owner_change_callback (change); -+ eel_timed_wait_stop ((EelCancelCallback) cancel_owner_change_callback, change); -+ } else { -+ g_source_remove (change->timeout); -+ owner_change_free (change); - } - -- nautilus_file_unref (file); -- g_free (owner); -- -- window->details->owner_change_file = NULL; -- window->details->owner_change_owner = NULL; -- g_object_unref (G_OBJECT (window)); -- } -- -- if (window->details->owner_change_timeout > 0) { -- g_assert (file != NULL); -- g_source_remove (window->details->owner_change_timeout); -- window->details->owner_change_timeout = 0; -+ window->details->owner_change = NULL; - } - } - -@@ -1914,20 +1892,15 @@ static void - changed_owner_callback (GtkComboBox *combo_box, NautilusFile* file) - { - NautilusPropertiesWindow *window; -- char *owner_text; -- char **name_array; - char *new_owner; - char *cur_owner; - - g_assert (GTK_IS_COMBO_BOX (combo_box)); - g_assert (NAUTILUS_IS_FILE (file)); - -- owner_text = combo_box_get_active_entry (combo_box, 0); -- if (! owner_text) -+ new_owner = combo_box_get_active_entry (combo_box, 2); -+ if (! new_owner) - return; -- name_array = g_strsplit (owner_text, " - ", 2); -- new_owner = name_array[0]; -- g_free (owner_text); - cur_owner = nautilus_file_get_owner_name (file); - - if (strcmp (new_owner, cur_owner) != 0) { -@@ -1937,7 +1910,7 @@ changed_owner_callback (GtkComboBox *combo_box, NautilusFile* file) - unschedule_or_cancel_owner_change (window); - schedule_owner_change (window, file, new_owner); - } -- g_strfreev (name_array); -+ g_free (new_owner); - g_free (cur_owner); - } - -@@ -1951,6 +1924,7 @@ synch_user_menu (GtkComboBox *combo_box, NautilusFile *file) - GtkTreeIter iter; - char *user_name; - char *owner_name; -+ char *nice_owner_name; - int user_index; - int owner_index; - char **name_array; -@@ -1980,7 +1954,7 @@ synch_user_menu (GtkComboBox *combo_box, NautilusFile *file) - user_name = (char *)node->data; - - name_array = g_strsplit (user_name, "\n", 2); -- if (name_array[1] != NULL) { -+ if (name_array[1] != NULL && *name_array[1] != 0) { - combo_text = g_strdup_printf ("%s - %s", name_array[0], name_array[1]); - } else { - combo_text = g_strdup (name_array[0]); -@@ -1990,6 +1964,7 @@ synch_user_menu (GtkComboBox *combo_box, NautilusFile *file) - gtk_list_store_set (store, &iter, - 0, combo_text, - 1, user_name, -+ 2, name_array[0], - -1); - - g_strfreev (name_array); -@@ -1997,8 +1972,9 @@ synch_user_menu (GtkComboBox *combo_box, NautilusFile *file) - } - } - -- owner_name = nautilus_file_get_string_attribute (file, "owner"); -- owner_index = tree_model_get_entry_index (model, 0, owner_name); -+ owner_name = nautilus_file_get_owner_name (file); -+ owner_index = tree_model_get_entry_index (model, 2, owner_name); -+ nice_owner_name = nautilus_file_get_string_attribute (file, "owner"); - - /* If owner wasn't in list, we prepend it (with a separator). - * This can happen if the owner is an id with no matching -@@ -2011,30 +1987,24 @@ synch_user_menu (GtkComboBox *combo_box, NautilusFile *file) - gtk_list_store_set (store, &iter, - 0, "-", - 1, NULL, -+ 2, NULL, - -1); - } - -- name_array = g_strsplit (owner_name, " - ", 2); -- if (name_array[1] != NULL) { -- user_name = g_strdup_printf ("%s\n%s", name_array[0], name_array[1]); -- } else { -- user_name = g_strdup (name_array[0]); -- } - owner_index = 0; - - gtk_list_store_prepend (store, &iter); - gtk_list_store_set (store, &iter, -- 0, owner_name, -- 1, user_name, -+ 0, nice_owner_name, -+ 1, owner_name, -+ 2, owner_name, - -1); -- -- g_free (user_name); -- g_strfreev (name_array); - } - - gtk_combo_box_set_active (combo_box, owner_index); - - g_free (owner_name); -+ g_free (nice_owner_name); - g_list_free_full (users, g_free); - } - --- -2.0.4 - diff --git a/SOURCES/nautilus-3.8.2-Add-force-desktop-action.patch b/SOURCES/nautilus-3.8.2-Add-force-desktop-action.patch deleted file mode 100644 index fc114c6..0000000 --- a/SOURCES/nautilus-3.8.2-Add-force-desktop-action.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff -up nautilus-3.8.2/src/nautilus-application.c.test nautilus-3.8.2/src/nautilus-application.c ---- nautilus-3.8.2/src/nautilus-application.c.test 2014-03-11 10:16:02.235912817 -0400 -+++ nautilus-3.8.2/src/nautilus-application.c 2014-03-11 10:49:00.904246660 -0400 -@@ -94,6 +94,7 @@ static GList *nautilus_application_deskt - static gboolean save_of_accel_map_requested = FALSE; - - static void desktop_changed_callback (gpointer user_data); -+static void nautilus_application_open_desktop (NautilusApplication *application); - - G_DEFINE_TYPE (NautilusApplication, nautilus_application, GTK_TYPE_APPLICATION); - -@@ -931,6 +932,16 @@ action_help (GSimpleAction *action, - } - - static void -+action_force_desktop (GSimpleAction *action, -+ GVariant *parameter, -+ gpointer user_data) -+{ -+ NautilusApplication *self = user_data; -+ -+ nautilus_application_open_desktop (self); -+} -+ -+static void - action_kill (GSimpleAction *action, - GVariant *parameter, - gpointer user_data) -@@ -1015,6 +1026,7 @@ static GActionEntry app_entries[] = { - { "help", action_help, NULL, NULL, NULL }, - { "quit", action_quit, NULL, NULL, NULL }, - { "kill", action_kill, NULL, NULL, NULL }, -+ { "force-desktop", action_force_desktop, NULL, NULL, NULL }, - }; - - static void -@@ -1306,6 +1318,13 @@ nautilus_application_local_command_line - goto out; - } - -+ if (self->priv->force_desktop) { -+ DEBUG ("Forcing desktop, as requested"); -+ g_action_group_activate_action (G_ACTION_GROUP (application), -+ "force-desktop", NULL); -+ /* fall through */ -+ } -+ - GFile **files; - gint idx, len; - diff --git a/SOURCES/nautilus-3.8.2-EelEditableLabel-Render-background.patch b/SOURCES/nautilus-3.8.2-EelEditableLabel-Render-background.patch deleted file mode 100644 index f65f127..0000000 --- a/SOURCES/nautilus-3.8.2-EelEditableLabel-Render-background.patch +++ /dev/null @@ -1,31 +0,0 @@ -From c3b2b0a0223aa18cae06259304842e4af5ac1529 Mon Sep 17 00:00:00 2001 -From: Alexander Larsson -Date: Wed, 6 Nov 2013 10:23:58 +0100 -Subject: [PATCH] EelEditableLabel: Render background - -Without this the rename widget background is always transparent, which -makes it very hard to read on e.g. the desktop with a background -image. ---- - eel/eel-editable-label.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c -index 0da68fd..f348a90 100644 ---- a/eel/eel-editable-label.c -+++ b/eel/eel-editable-label.c -@@ -1504,6 +1504,11 @@ eel_editable_label_draw (GtkWidget *widget, - label = EEL_EDITABLE_LABEL (widget); - style = gtk_widget_get_style_context (widget); - -+ gtk_render_background (style, cr, -+ 0, 0, -+ gtk_widget_get_allocated_width (widget), -+ gtk_widget_get_allocated_height (widget)); -+ - eel_editable_label_ensure_layout (label, TRUE); - - if (gtk_widget_get_visible (widget) && gtk_widget_get_mapped (widget) && --- -1.8.4.2 - diff --git a/SOURCES/window-menus-unref-extension-created-action.patch b/SOURCES/window-menus-unref-extension-created-action.patch new file mode 100644 index 0000000..d7574d8 --- /dev/null +++ b/SOURCES/window-menus-unref-extension-created-action.patch @@ -0,0 +1,37 @@ +From a0cbf72827b87a28fba47988957001a8b4fbddf5 Mon Sep 17 00:00:00 2001 +From: Carlos Soriano +Date: Tue, 6 Oct 2015 02:27:42 +0200 +Subject: [PATCH] window-menus: unref extension created action + +This looks not very harmful. But definitely is. +Thing is, when using nautilus_action_from_menu_item it keeps +a reference to the NautilusMenuItem from the extension. +So that menu item will never be freed. +Now, let's imagine nautilus-open-terminal have a ref to the file +that the item points to, and only unref it when the item is destroyed. +Now, sum that when a file is not unrefed completely from nautilus +when unmounting the file, so it's mark as gone and cannot be used again. +Now try to use it in this state. Nautilus crashes. + +This fix few crashes reported downstream on distros that uses +this extension. +--- + src/nautilus-window-menus.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c +index 999d163..32aba4a 100644 +--- a/src/nautilus-window-menus.c ++++ b/src/nautilus-window-menus.c +@@ -685,6 +685,8 @@ add_extension_menu_items (NautilusWindow *window, + nautilus_menu_item_list_free (children); + g_free (subdir); + } ++ ++ g_object_unref (action); + } + } + +-- +2.5.0 + diff --git a/SPECS/nautilus.spec b/SPECS/nautilus.spec index 3d12c20..70e5aa0 100644 --- a/SPECS/nautilus.spec +++ b/SPECS/nautilus.spec @@ -1,26 +1,22 @@ %define glib2_version 2.35.3 %define gnome_desktop3_version 3.0.0 %define pango_version 1.28.3 -%define gtk3_version 3.5.12 +%define gtk3_version 3.13.2 %define libxml2_version 2.7.8 %define libexif_version 0.6.20 %define exempi_version 2.1.0 %define gobject_introspection_version 0.9.5 +%define gsettings_desktop_schemas_version 3.8.0 Name: nautilus Summary: File manager for GNOME -Version: 3.8.2 -Release: 10%{?dist} +Version: 3.14.3 +Release: 7%{?dist} License: GPLv2+ Group: User Interface/Desktops -Source: http://download.gnome.org/sources/%{name}/3.8/%{name}-%{version}.tar.xz +Source: http://download.gnome.org/sources/%{name}/3.14/%{name}-%{version}.tar.xz -URL: http://projects.gnome.org/nautilus/ -Requires: redhat-menus -Requires: gvfs -Requires: libexif >= %{libexif_version} -Requires: gsettings-desktop-schemas -Requires: gnome-icon-theme-legacy +URL: https://wiki.gnome.org/Apps/Nautilus BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: pango-devel >= %{pango_version} @@ -37,10 +33,15 @@ BuildRequires: exempi-devel >= %{exempi_version} BuildRequires: gettext BuildRequires: libselinux-devel BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version} -BuildRequires: gsettings-desktop-schemas-devel +BuildRequires: gsettings-desktop-schemas-devel >= %{gsettings_desktop_schemas_version} BuildRequires: libnotify-devel BuildRequires: tracker-devel +Requires: glib2%{_isa} >= %{glib2_version} +Requires: gsettings-desktop-schemas%{_isa} >= %{gsettings_desktop_schemas_version} +Requires: gtk3%{_isa} >= %{gtk3_version} +Requires: gvfs%{_isa} +Requires: libexif%{_isa} >= %{libexif_version} # the main binary links against libnautilus-extension.so # don't depend on soname, rather on exact version Requires: nautilus-extensions = %{version}-%{release} @@ -55,30 +56,26 @@ Provides: gnome-volume-manager = 2.24.0-2 Obsoletes: eel2 < 2.26.0-3 Provides: eel2 = 2.26.0-3 -# https://bugzilla.redhat.com/show_bug.cgi?id=1019879 -# Unable to rename icon when desktop background is dark -Patch0: nautilus-3.8.2-EelEditableLabel-Render-background.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1075054 -# race between gnome-shell activating nautilus and gnome-session starting it -Patch1: nautilus-3.8.2-Add-force-desktop-action.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=853987 -# Search provider does not show any results -Patch2: 0001-search-provider-Return-TRUE-from-GDBus-method-handle.patch - # The selinux patch is here to not lose it, should go upstream and needs # cleaning up to work with current nautilus git. #Patch4: nautilus-2.91.8-selinux.patch -#https://bugzilla.redhat.com/show_bug.cgi?id=1090999 -#Backport from git master -#Crashes when chowning file -Patch5: nautilus-3.8-fix-chown.patch - # https://bugzilla.redhat.com/show_bug.cgi?id=1080484 # Handle drag and drop of desktop link files -Patch6: nautilus-handle-desktop-link-dnd.patch +Patch5: nautilus-handle-desktop-link-dnd.patch + +# Backport some delete keyboard shortcut improvements +# https://bugzilla.redhat.com/show_bug.cgi?id=1102849 +Patch6: nautilus-3.14-delete-shortcut-improvements.patch + +# Backport avoid to crash connecting repeteadly to a remote server when using +# open terminal extension. +# https://bugzilla.redhat.com/show_bug.cgi?id=1254161 +Patch7: window-menus-unref-extension-created-action.patch + +# Backport avoiding to crash on automated tests, when quiting the application +# using the quit action +Patch8: application-actions-use-valid-window-list.patch %description Nautilus is the file manager and graphical shell for the GNOME desktop @@ -88,20 +85,20 @@ files and launch applications associated with them. It is also responsible for handling the icons on the GNOME desktop. %package extensions -Summary: Nautilus extensions library -License: LGPLv2+ -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} +Summary: Nautilus extensions library +License: LGPLv2+ +Group: Development/Libraries +Requires: %{name}%{_isa} = %{version}-%{release} %description extensions This package provides the libraries used by nautilus extensions. %package devel -Summary: Support for developing nautilus extensions -License: LGPLv2+ -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} -Requires: nautilus-extensions = %{version}-%{release} +Summary: Support for developing nautilus extensions +License: LGPLv2+ +Group: Development/Libraries +Requires: %{name}%{_isa} = %{version}-%{release} +Requires: %{name}-extensions%{_isa} = %{version}-%{release} Obsoletes: eel2-devel < 2.26.0-3 Provides: eel2-devel = 2.26.0-3 @@ -112,14 +109,12 @@ for developing nautilus extensions. %prep %setup -q -n %{name}-%{version} -%patch0 -p1 -b .render-bg -%patch1 -p1 -b .add-force-desktop-action -%patch2 -p1 -b .search-provider-no-results +#%%patch4 -p1 -b .selinux -#%patch4 -p1 -b .selinux - -%patch5 -p1 -b .chown -%patch6 -p1 -b .desktop-link +%patch5 -p1 -b .desktop-link +%patch6 -p1 -b .delete-shortcut +%patch7 -p1 -b .extension-created-action +%patch8 -p1 -b .valid-window-list %build CFLAGS="$RPM_OPT_FLAGS -g -DNAUTILUS_OMIT_SELF_CHECK" %configure --disable-more-warnings --disable-update-mimedb @@ -141,36 +136,44 @@ desktop-file-install --delete-original \ --add-only-show-in GNOME \ $RPM_BUILD_ROOT%{_datadir}/applications/* +# for backward compatibility with user defined file associations +cp $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Nautilus.desktop $RPM_BUILD_ROOT%{_datadir}/applications/nautilus.desktop +echo NoDisplay=true >> $RPM_BUILD_ROOT%{_datadir}/applications/nautilus.desktop +echo X-GNOME-UsesNotifications=false >> $RPM_BUILD_ROOT%{_datadir}/applications/nautilus.desktop +echo X-RHEL-AliasOf=org.gnome.Nautilus >> $RPM_BUILD_ROOT%{_datadir}/applications/nautilus.desktop + rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/nautilus/extensions-3.0/*.la %find_lang %name %post -%{_bindir}/update-mime-database %{_datadir}/mime &> /dev/null +touch --no-create %{_datadir}/mime/packages &> /dev/null || : %postun if [ $1 -eq 0 ]; then glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null || : + touch --no-create %{_datadir}/mime/packages &> /dev/null || : + update-mime-database -n %{_datadir}/mime &> /dev/null || : fi %posttrans glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null || : +update-mime-database -n %{_datadir}/mime &> /dev/null || : %post extensions -p /sbin/ldconfig %postun extensions -p /sbin/ldconfig %files -f %{name}.lang -%doc AUTHORS COPYING COPYING-DOCS COPYING.LIB NEWS README -%{_datadir}/nautilus +%doc AUTHORS COPYING COPYING.LIB NEWS README +%{_datadir}/appdata/org.gnome.Nautilus.appdata.xml %{_datadir}/applications/* %{_datadir}/mime/packages/nautilus.xml %{_bindir}/* %{_datadir}/dbus-1/services/org.gnome.Nautilus.service %{_datadir}/dbus-1/services/org.freedesktop.FileManager1.service %{_datadir}/gnome-shell/search-providers/nautilus-search-provider.ini -%{_datadir}/dbus-1/services/org.gnome.Nautilus.SearchProvider.service %{_mandir}/man1/nautilus-connect-server.1.gz %{_mandir}/man1/nautilus.1.gz %{_libexecdir}/nautilus-convert-metadata @@ -195,6 +198,39 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null || : %doc %{_datadir}/gtk-doc/html/libnautilus-extension/ %changelog +* Tue Oct 6 2015 Carlos Soriano 3.14.3-7 +- Backport two patches from upstream and remove a wrong patch + Resolves: #1254161 #1266477 + +* Wed Sep 23 2015 Ray Strode 3.14.3-6 +- Add more goo to the compat desktop file to prevent it + from getting exposed in control-center + Related: #1259292 + +* Mon Sep 14 2015 David King - 3.14.3-5 +- Refresh patches to fix regression after undo changes (#1252434) + +* Thu Sep 03 2015 David King - 3.14.3-4 +- Backport fix for crash with file bookmarks (#1115338) + +* Wed Jul 15 2015 David King - 3.14.3-3 +- Backport delete keyboard shortcut improvements (#1102849) + +* Fri Jun 26 2015 Ray Strode 3.14.3-2 +- Add backward compatible nautilus.desktop for user defined mime associations + Related: #1174562 1235413 + +* Wed Jun 17 2015 David King - 3.14.3-1 +- Update to 3.14.3 (#1174562) + +* Wed May 06 2015 Ray Strode 3.14.2-2 +- Rebuild against new gnome-desktop3 + Related: #1174562 + +* Thu Mar 19 2015 Richard Hughes - 3.14.2-1 +- Update to 3.14.2 +- Resolves: #1174562 + * Tue Nov 11 2014 David King - 3.8.2-10 - Handle desktop link file DND (#1080484) - Drop symlink renaming patches