diff options
author | Nick Schermer <nick@xfce.org> | 2013-02-04 11:32:14 +0100 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2013-02-04 11:32:14 +0100 |
commit | 02cfd3341e6846f653e3e888c70e996c914c2327 (patch) | |
tree | 3f04d7dca5170a0500c10b86113bc046849131d5 | |
parent | 58a3c6c6caef9f1aeb6a09922f20ebf0841c20b8 (diff) | |
download | thunar-nick/desktop.tar.gz |
Use GBinding.nick/desktop
75 files changed, 844 insertions, 625 deletions
diff --git a/thunar/main.c b/thunar/main.c index f9c393e4..7450f076 100644 --- a/thunar/main.c +++ b/thunar/main.c @@ -106,7 +106,7 @@ thunar_delayed_exit_check (gpointer user_data) /* don't call this function again */ return FALSE; } - + } @@ -143,7 +143,7 @@ main (int argc, char **argv) if (!g_thread_supported ()) g_thread_init (NULL); #endif - + /* get the startup notification id */ startup_id = g_getenv ("DESKTOP_STARTUP_ID"); @@ -314,7 +314,7 @@ error0: * schedule an idle source which repeatedly checks whether we are done * processing. Once we're done, it'll make the application quit if there * are no open windows */ - g_idle_add_full (G_PRIORITY_LOW, thunar_delayed_exit_check, + g_idle_add_full (G_PRIORITY_LOW, thunar_delayed_exit_check, g_object_ref (application), g_object_unref); } diff --git a/thunar/thunar-abstract-icon-view.c b/thunar/thunar-abstract-icon-view.c index c9a4d7d5..bb24f0d1 100644 --- a/thunar/thunar-abstract-icon-view.c +++ b/thunar/thunar-abstract-icon-view.c @@ -508,7 +508,7 @@ thunar_abstract_icon_view_button_press_event (ExoIconView *view, * to make sure that the folder context menu is opened. */ exo_icon_view_unselect_all (view); - + /* open the context menu */ thunar_standard_view_context_menu (THUNAR_STANDARD_VIEW (abstract_icon_view), event->button, event->time); } diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c index 458760d5..2d1fd30c 100644 --- a/thunar/thunar-application.c +++ b/thunar/thunar-application.c @@ -4,18 +4,18 @@ * Copyright (c) 2005 Jeff Franks <jcfranks@xfce.org> * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -172,9 +172,9 @@ static void thunar_application_class_init (ThunarApplicationClass *klass) { GObjectClass *gobject_class; - + /* pre-allocate the required quarks */ - thunar_application_screen_quark = + thunar_application_screen_quark = g_quark_from_static_string ("thunar-application-screen"); thunar_application_startup_id_quark = g_quark_from_static_string ("thunar-application-startup-id"); @@ -234,7 +234,7 @@ thunar_application_init (ThunarApplication *application) /* connect to the client in order to be notified when devices are plugged in * or disconnected from the computer */ - g_signal_connect (application->udev_client, "uevent", + g_signal_connect (application->udev_client, "uevent", G_CALLBACK (thunar_application_uevent), application); #endif } @@ -264,7 +264,7 @@ thunar_application_finalize (GObject *object) /* cancel any pending volman watch source */ if (G_UNLIKELY (application->volman_watch_id != 0)) g_source_remove (application->volman_watch_id); - + /* cancel any pending volman idle source */ if (G_UNLIKELY (application->volman_idle_id != 0)) g_source_remove (application->volman_idle_id); @@ -298,7 +298,7 @@ thunar_application_finalize (GObject *object) /* disconnect from the preferences */ g_object_unref (G_OBJECT (application->preferences)); - + (*G_OBJECT_CLASS (thunar_application_parent_class)->finalize) (object); } @@ -311,7 +311,7 @@ thunar_application_get_property (GObject *object, GParamSpec *pspec) { ThunarApplication *application = THUNAR_APPLICATION (object); - + switch (prop_id) { case PROP_DAEMON: @@ -333,7 +333,7 @@ thunar_application_set_property (GObject *object, GParamSpec *pspec) { ThunarApplication *application = THUNAR_APPLICATION (object); - + switch (prop_id) { case PROP_DAEMON: @@ -497,7 +497,7 @@ thunar_application_launch (ThunarApplication *application, if (thunar_progress_dialog_has_jobs (THUNAR_PROGRESS_DIALOG (dialog))) { /* add the job to the dialog */ - thunar_progress_dialog_add_job (THUNAR_PROGRESS_DIALOG (dialog), + thunar_progress_dialog_add_job (THUNAR_PROGRESS_DIALOG (dialog), job, icon_name, title); /* show the dialog immediately */ @@ -506,7 +506,7 @@ thunar_application_launch (ThunarApplication *application, else { /* add the job to the dialog */ - thunar_progress_dialog_add_job (THUNAR_PROGRESS_DIALOG (dialog), + thunar_progress_dialog_add_job (THUNAR_PROGRESS_DIALOG (dialog), job, icon_name, title); /* Set up a timer to show the dialog, to make sure we don't @@ -514,7 +514,7 @@ thunar_application_launch (ThunarApplication *application, */ if (G_LIKELY (application->show_dialogs_timer_id == 0)) { - application->show_dialogs_timer_id = + application->show_dialogs_timer_id = g_timeout_add_full (G_PRIORITY_DEFAULT, 750, thunar_application_show_dialogs, application, thunar_application_show_dialogs_destroy); } @@ -577,23 +577,23 @@ thunar_application_uevent (GUdevClient *client, has_media = g_udev_device_get_property_as_boolean (device, "ID_CDROM_MEDIA"); /* distinguish between "add", "change" and "remove" actions, ignore "move" */ - if (g_strcmp0 (action, "add") == 0 + if (g_strcmp0 (action, "add") == 0 || (is_cdrom && has_media && g_strcmp0 (action, "change") == 0)) { /* only insert the path if we don't have it already */ - if (g_slist_find_custom (application->volman_udis, sysfs_path, + if (g_slist_find_custom (application->volman_udis, sysfs_path, (GCompareFunc) g_utf8_collate) == NULL) { - application->volman_udis = g_slist_prepend (application->volman_udis, + application->volman_udis = g_slist_prepend (application->volman_udis, g_strdup (sysfs_path)); /* check if there's currently no active or scheduled handler */ - if (G_LIKELY (application->volman_idle_id == 0 + if (G_LIKELY (application->volman_idle_id == 0 && application->volman_watch_id == 0)) { /* schedule a new handler using the idle source, which invokes the handler */ - application->volman_idle_id = - g_idle_add_full (G_PRIORITY_LOW, thunar_application_volman_idle, + application->volman_idle_id = + g_idle_add_full (G_PRIORITY_LOW, thunar_application_volman_idle, application, thunar_application_volman_idle_destroy); } } @@ -601,7 +601,7 @@ thunar_application_uevent (GUdevClient *client, else if (g_strcmp0 (action, "remove") == 0) { /* look for the sysfs path in the list of pending paths */ - lp = g_slist_find_custom (application->volman_udis, sysfs_path, + lp = g_slist_find_custom (application->volman_udis, sysfs_path, (GCompareFunc) g_utf8_collate); if (G_LIKELY (lp != NULL)) @@ -874,7 +874,7 @@ thunar_application_has_windows (ThunarApplication *application) * Lets @application take over control of the specified @window. * @application will not exit until the last controlled #GtkWindow * is closed by the user. - * + * * If the @window has no transient window, it will also create a * new #GtkWindowGroup for this window. This will make different * windows work independant (think gtk_dialog_run). @@ -1072,7 +1072,7 @@ thunar_application_get_progress_dialog (ThunarApplication *application) g_object_add_weak_pointer (G_OBJECT (application->progress_dialog), (gpointer) &application->progress_dialog); - thunar_application_take_window (application, + thunar_application_take_window (application, GTK_WINDOW (application->progress_dialog)); } @@ -1087,7 +1087,7 @@ thunar_application_process_files_finish (ThunarBrowser *browser, ThunarFile *target_file, GError *error, gpointer unused) -{ +{ ThunarApplication *application = THUNAR_APPLICATION (browser); GdkScreen *screen; const gchar *startup_id; @@ -1110,7 +1110,7 @@ thunar_application_process_files_finish (ThunarBrowser *browser, if (error->domain != G_IO_ERROR || error->code != G_IO_ERROR_CANCELLED) { /* tell the user that we were unable to launch the file specified */ - thunar_dialogs_show_error (screen, error, _("Failed to open \"%s\""), + thunar_dialogs_show_error (screen, error, _("Failed to open \"%s\""), thunar_file_get_display_name (file)); } @@ -1152,7 +1152,7 @@ thunar_application_process_files (ThunarApplication *application) GdkScreen *screen; _thunar_return_if_fail (THUNAR_IS_APPLICATION (application)); - + /* don't do anything if no files are to be processed */ if (application->files_to_launch == NULL) return; @@ -1163,7 +1163,7 @@ thunar_application_process_files (ThunarApplication *application) /* retrieve the screen we need to launch the file on */ screen = g_object_get_qdata (G_OBJECT (file), thunar_application_screen_quark); - /* resolve the file and/or mount its enclosing volume + /* resolve the file and/or mount its enclosing volume * before handling it in the callback */ thunar_browser_poke_file (THUNAR_BROWSER (application), file, screen, thunar_application_process_files_finish, NULL); @@ -1236,10 +1236,10 @@ thunar_application_process_filenames (ThunarApplication *application, else { /* tell the user that we were unable to launch the file specified */ - thunar_dialogs_show_error (screen, derror, _("Failed to open \"%s\""), + thunar_dialogs_show_error (screen, derror, _("Failed to open \"%s\""), filenames[n]); - g_set_error (error, derror->domain, derror->code, + g_set_error (error, derror->domain, derror->code, _("Failed to open \"%s\": %s"), filenames[n], derror->message); g_error_free (derror); @@ -1257,11 +1257,11 @@ thunar_application_process_filenames (ThunarApplication *application, /* remember the startup id to set on the window */ if (G_LIKELY (startup_id != NULL && *startup_id != '\0')) - g_object_set_qdata_full (G_OBJECT (lp->data), thunar_application_startup_id_quark, + g_object_set_qdata_full (G_OBJECT (lp->data), thunar_application_startup_id_quark, g_strdup (startup_id), (GDestroyNotify) g_free); /* append the file to the list of files we need to launch */ - application->files_to_launch = g_list_append (application->files_to_launch, + application->files_to_launch = g_list_append (application->files_to_launch, lp->data); } @@ -1304,7 +1304,7 @@ thunar_application_rename_file_error (ExoJob *job, g_assert (screen != NULL); g_assert (file != NULL); - thunar_dialogs_show_error (screen, error, _("Failed to rename \"%s\""), + thunar_dialogs_show_error (screen, error, _("Failed to rename \"%s\""), thunar_file_get_display_name (file)); } @@ -1354,11 +1354,11 @@ thunar_application_rename_file (ThunarApplication *application, { /* remember the screen and file */ g_object_set_qdata (G_OBJECT (job), thunar_application_screen_quark, screen); - g_object_set_qdata_full (G_OBJECT (job), thunar_application_file_quark, + g_object_set_qdata_full (G_OBJECT (job), thunar_application_file_quark, g_object_ref (file), g_object_unref); /* handle rename errors */ - g_signal_connect (job, "error", + g_signal_connect (job, "error", G_CALLBACK (thunar_application_rename_file_error), application); /* destroy the job when it has finished */ @@ -1380,7 +1380,7 @@ thunar_application_rename_file (ThunarApplication *application, * with dbus to make focus stealing work properly. * * Prompts the user to create a new file or directory in @parent_directory. - * The @content_type defines the icon and other elements in the filename + * The @content_type defines the icon and other elements in the filename * prompt dialog. **/ void @@ -1475,9 +1475,9 @@ thunar_application_create_file_from_template (ThunarApplication *application, /* TODO pass the startup ID to the rename dialog */ /* ask the user to enter a name for the new document */ - name = thunar_show_create_dialog (screen, + name = thunar_show_create_dialog (screen, thunar_file_get_content_type (template_file), - thunar_file_get_display_name (template_file), + thunar_file_get_display_name (template_file), title); if (G_LIKELY (name != NULL)) { @@ -1518,7 +1518,7 @@ thunar_application_create_file_from_template (ThunarApplication *application, * Copies all files from @source_file_list to their locations specified in * @target_file_list. * - * @source_file_list and @target_file_list must be of the same length. + * @source_file_list and @target_file_list must be of the same length. **/ void thunar_application_copy_to (ThunarApplication *application, @@ -1575,7 +1575,7 @@ thunar_application_copy_into (ThunarApplication *application, /* collect the target files and launch the job */ thunar_application_collect_and_launch (application, parent, "stock_folder-copy", title, thunar_io_jobs_copy_files, - source_file_list, target_file, + source_file_list, target_file, new_files_closure); /* free the title */ @@ -1620,8 +1620,8 @@ thunar_application_link_into (ThunarApplication *application, /* collect the target files and launch the job */ thunar_application_collect_and_launch (application, parent, "insert-link", - title, thunar_io_jobs_link_files, - source_file_list, target_file, + title, thunar_io_jobs_link_files, + source_file_list, target_file, new_files_closure); /* free the title */ @@ -1658,7 +1658,7 @@ thunar_application_move_into (ThunarApplication *application, _thunar_return_if_fail (parent == NULL || GDK_IS_SCREEN (parent) || GTK_IS_WIDGET (parent)); _thunar_return_if_fail (THUNAR_IS_APPLICATION (application)); _thunar_return_if_fail (target_file != NULL); - + /* launch the appropriate operation depending on the target file */ if (thunar_g_file_is_trashed (target_file)) { @@ -1672,10 +1672,10 @@ thunar_application_move_into (ThunarApplication *application, g_free (display_name); /* collect the target files and launch the job */ - thunar_application_collect_and_launch (application, parent, + thunar_application_collect_and_launch (application, parent, "stock_folder-move", title, - thunar_io_jobs_move_files, - source_file_list, target_file, + thunar_io_jobs_move_files, + source_file_list, target_file, new_files_closure); /* free the title */ @@ -1731,7 +1731,7 @@ thunar_application_unlink_files (ThunarApplication *application, /* prepend the path to the path list */ path_list = thunar_g_file_list_prepend (path_list, thunar_file_get_file (lp->data)); - /* permanently delete if at least one of the file is not a local + /* permanently delete if at least one of the file is not a local * file (e.g. resides in the trash) or cannot be trashed */ if (!thunar_file_is_local (lp->data) || !thunar_file_can_be_trashed (lp->data)) permanently = TRUE; @@ -1774,7 +1774,7 @@ thunar_application_unlink_files (ThunarApplication *application, GTK_STOCK_DELETE, GTK_RESPONSE_YES, NULL); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), _("If you delete a file, it is permanently lost.")); response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); @@ -1819,7 +1819,7 @@ thunar_application_trash (ThunarApplication *application, _thunar_return_if_fail (THUNAR_IS_APPLICATION (application)); _thunar_return_if_fail (file_list != NULL); - thunar_application_launch (application, parent, "user-trash-full", + thunar_application_launch (application, parent, "user-trash-full", _("Moving files into the trash..."), trash_stub, file_list, NULL, NULL); } @@ -1860,7 +1860,7 @@ thunar_application_creat (ThunarApplication *application, _thunar_return_if_fail (parent == NULL || GDK_IS_SCREEN (parent) || GTK_IS_WIDGET (parent)); _thunar_return_if_fail (THUNAR_IS_APPLICATION (application)); - + template_list.next = template_list.prev = NULL; template_list.data = template_file; @@ -2034,7 +2034,7 @@ thunar_application_restore_files (ThunarApplication *application, if (G_UNLIKELY (err != NULL)) { /* display an error dialog */ - thunar_dialogs_show_error (parent, err, _("Could not restore \"%s\""), + thunar_dialogs_show_error (parent, err, _("Could not restore \"%s\""), thunar_file_get_display_name (lp->data)); g_error_free (err); } diff --git a/thunar/thunar-application.h b/thunar/thunar-application.h index 3cd56281..5fa261ca 100644 --- a/thunar/thunar-application.h +++ b/thunar/thunar-application.h @@ -4,18 +4,18 @@ * Copyright (c) 2005 Jeff Franks <jcfranks@xfce.org> * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-chooser-button.c b/thunar/thunar-chooser-button.c index f2993b8b..375df90f 100644 --- a/thunar/thunar-chooser-button.c +++ b/thunar/thunar-chooser-button.c @@ -4,18 +4,18 @@ * Copyright (c) 2010 Nick Schermer <nick@xfce.org> * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -141,10 +141,10 @@ thunar_chooser_button_init (ThunarChooserButton *chooser_button) G_TYPE_OBJECT, G_TYPE_BOOLEAN, PANGO_TYPE_STYLE); - gtk_combo_box_set_model (GTK_COMBO_BOX (chooser_button), + gtk_combo_box_set_model (GTK_COMBO_BOX (chooser_button), GTK_TREE_MODEL (chooser_button->store)); - g_signal_connect (chooser_button, "changed", + g_signal_connect (chooser_button, "changed", G_CALLBACK (thunar_chooser_button_changed), NULL); g_signal_connect (chooser_button, "popup", G_CALLBACK (thunar_chooser_button_popup), NULL); @@ -158,9 +158,9 @@ thunar_chooser_button_init (ThunarChooserButton *chooser_button) renderer = gtk_cell_renderer_pixbuf_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (chooser_button), renderer, FALSE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (chooser_button), renderer, - "gicon", + "gicon", THUNAR_CHOOSER_BUTTON_STORE_COLUMN_ICON, - "sensitive", + "sensitive", THUNAR_CHOOSER_BUTTON_STORE_COLUMN_SENSITIVE, NULL); @@ -168,9 +168,9 @@ thunar_chooser_button_init (ThunarChooserButton *chooser_button) renderer = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (chooser_button), renderer, FALSE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (chooser_button), renderer, - "text", + "text", THUNAR_CHOOSER_BUTTON_STORE_COLUMN_NAME, - "sensitive", + "sensitive", THUNAR_CHOOSER_BUTTON_STORE_COLUMN_SENSITIVE, "style", THUNAR_CHOOSER_BUTTON_STORE_COLUMN_STYLE, @@ -256,8 +256,8 @@ thunar_chooser_button_scroll_event (GtkWidget *widget, && gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter) && gtk_tree_model_iter_next (model, &iter)) { - gtk_tree_model_get (model, &iter, - THUNAR_CHOOSER_BUTTON_STORE_COLUMN_APPLICATION, + gtk_tree_model_get (model, &iter, + THUNAR_CHOOSER_BUTTON_STORE_COLUMN_APPLICATION, &application, -1); if (application == NULL) @@ -305,7 +305,7 @@ thunar_chooser_button_changed (GtkComboBox *combo_box) if (!g_app_info_set_as_default_for_type (app_info, content_type, &error)) { /* tell the user that it didn't work */ - thunar_dialogs_show_error (GTK_WIDGET (chooser_button), error, + thunar_dialogs_show_error (GTK_WIDGET (chooser_button), error, _("Failed to set default application for \"%s\""), thunar_file_get_display_name (chooser_button->file)); g_error_free (error); @@ -393,7 +393,9 @@ thunar_chooser_button_chooser_dialog (ThunarChooserButton *chooser_button) /* popup the application chooser dialog */ dialog = g_object_new (THUNAR_TYPE_CHOOSER_DIALOG, "open", FALSE, NULL); - exo_binding_new (G_OBJECT (chooser_button), "file", G_OBJECT (dialog), "file"); + g_object_bind_property (G_OBJECT (chooser_button), "file", + G_OBJECT (dialog), "file", + G_BINDING_SYNC_CREATE); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (toplevel)); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_ACCEPT) @@ -449,7 +451,7 @@ thunar_chooser_button_file_changed (ThunarChooserButton *chooser_button, /* determine all applications that claim to be able to handle the file */ app_infos = g_app_info_get_all_for_type (content_type); app_infos = g_list_sort (app_infos, thunar_chooser_button_sort_applications); - + /* add all possible applications */ for (lp = app_infos, i = 0; lp != NULL; lp = lp->next, ++i) { @@ -466,7 +468,7 @@ thunar_chooser_button_file_changed (ThunarChooserButton *chooser_button, THUNAR_CHOOSER_BUTTON_STORE_COLUMN_SENSITIVE, TRUE, -1); - + /* pre-select the default application */ if (g_app_info_equal (lp->data, app_info)) gtk_combo_box_set_active_iter (GTK_COMBO_BOX (chooser_button), &iter); @@ -486,7 +488,7 @@ thunar_chooser_button_file_changed (ThunarChooserButton *chooser_button, chooser_button->has_default_application = TRUE; } } - + if (content_type == NULL || !chooser_button->has_default_application) { /* add the "No application selected" item and set as active */ diff --git a/thunar/thunar-chooser-dialog.c b/thunar/thunar-chooser-dialog.c index 1ce3f32a..08f08ec0 100644 --- a/thunar/thunar-chooser-dialog.c +++ b/thunar/thunar-chooser-dialog.c @@ -257,7 +257,9 @@ thunar_chooser_dialog_init (ThunarChooserDialog *dialog) dialog->custom_expander = gtk_expander_new_with_mnemonic (_("Use a _custom command:")); gtk_widget_set_tooltip_text (dialog->custom_expander, _("Use a custom command for an application that is not " "available from the above application list.")); - exo_binding_new_with_negation (G_OBJECT (dialog->custom_expander), "expanded", G_OBJECT (dialog->tree_view), "sensitive"); + g_object_bind_property (G_OBJECT (dialog->custom_expander), "expanded", + G_OBJECT (dialog->tree_view), "sensitive", + G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE); g_signal_connect (G_OBJECT (dialog->custom_expander), "notify::expanded", G_CALLBACK (thunar_chooser_dialog_notify_expanded), dialog); gtk_box_pack_start (GTK_BOX (box), dialog->custom_expander, FALSE, FALSE, 0); gtk_widget_show (dialog->custom_expander); @@ -282,7 +284,9 @@ thunar_chooser_dialog_init (ThunarChooserDialog *dialog) /* create the "Use as default for this kind of file" button */ dialog->default_button = gtk_check_button_new_with_mnemonic (_("Use as _default for this kind of file")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->default_button), TRUE); - exo_binding_new (G_OBJECT (dialog), "open", G_OBJECT (dialog->default_button), "visible"); + g_object_bind_property (G_OBJECT (dialog), "open", + G_OBJECT (dialog->default_button), "visible", + G_BINDING_SYNC_CREATE); gtk_box_pack_start (GTK_BOX (box), dialog->default_button, FALSE, FALSE, 0); gtk_widget_show (dialog->default_button); @@ -460,8 +464,8 @@ thunar_chooser_dialog_response (GtkDialog *widget, if (G_UNLIKELY (!succeed)) { /* display an error to the user */ - thunar_dialogs_show_error (GTK_WIDGET (dialog), - error, + thunar_dialogs_show_error (GTK_WIDGET (dialog), + error, _("Failed to set default application for \"%s\""), thunar_file_get_display_name (dialog->file)); @@ -488,9 +492,9 @@ thunar_chooser_dialog_response (GtkDialog *widget, if (!g_app_info_launch (app_info, &list, G_APP_LAUNCH_CONTEXT (context), &error)) { /* display an error to the user */ - thunar_dialogs_show_error (GTK_WIDGET (dialog), - error, - _("Failed to execute application \"%s\""), + thunar_dialogs_show_error (GTK_WIDGET (dialog), + error, + _("Failed to execute application \"%s\""), g_app_info_get_name (app_info)); /* release the error */ diff --git a/thunar/thunar-chooser-model.c b/thunar/thunar-chooser-model.c index e3ae672d..648d2e0e 100644 --- a/thunar/thunar-chooser-model.c +++ b/thunar/thunar-chooser-model.c @@ -96,11 +96,11 @@ thunar_chooser_model_class_init (ThunarChooserModelClass *klass) **/ g_object_class_install_property (gobject_class, PROP_CONTENT_TYPE, - g_param_spec_string ("content-type", - "content-type", + g_param_spec_string ("content-type", + "content-type", "content-type", NULL, - G_PARAM_CONSTRUCT_ONLY | + G_PARAM_CONSTRUCT_ONLY | EXO_PARAM_READWRITE)); } @@ -120,8 +120,8 @@ thunar_chooser_model_init (ThunarChooserModel *model) }; /* register the column types */ - gtk_tree_store_set_column_types (GTK_TREE_STORE (model), - G_N_ELEMENTS (column_types), + gtk_tree_store_set_column_types (GTK_TREE_STORE (model), + G_N_ELEMENTS (column_types), column_types); } @@ -242,7 +242,7 @@ thunar_chooser_model_append (ThunarChooserModel *model, inserted_infos = TRUE; } } - + if (!inserted_infos) { /* tell the user that we don't have any applications for this category */ @@ -294,9 +294,9 @@ thunar_chooser_model_reload (ThunarChooserModel *model) /* append them as recommended */ recommended = g_list_sort (recommended, sort_app_infos); - thunar_chooser_model_append (model, - _("Recommended Applications"), - "preferences-desktop-default-applications", + thunar_chooser_model_append (model, + _("Recommended Applications"), + "preferences-desktop-default-applications", recommended); all = g_app_info_get_all (); @@ -385,9 +385,9 @@ thunar_chooser_model_remove (ThunarChooserModel *model, _thunar_return_val_if_fail (gtk_tree_store_iter_is_valid (GTK_TREE_STORE (model), iter), FALSE); /* determine the app info for the iter */ - gtk_tree_model_get (GTK_TREE_MODEL (model), - iter, - THUNAR_CHOOSER_MODEL_COLUMN_APPLICATION, &app_info, + gtk_tree_model_get (GTK_TREE_MODEL (model), + iter, + THUNAR_CHOOSER_MODEL_COLUMN_APPLICATION, &app_info, -1); if (G_UNLIKELY (app_info == NULL)) diff --git a/thunar/thunar-clipboard-manager.c b/thunar/thunar-clipboard-manager.c index 19b50d06..40e06505 100644 --- a/thunar/thunar-clipboard-manager.c +++ b/thunar/thunar-clipboard-manager.c @@ -3,18 +3,18 @@ * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -341,7 +341,7 @@ thunar_clipboard_manager_contents_received (GtkClipboard *clipboard, if (G_UNLIKELY (!path_copy)) gtk_clipboard_clear (manager->clipboard); - /* check the contents of the clipboard again if either the Xserver or + /* check the contents of the clipboard again if either the Xserver or * our GTK+ version doesn't support the XFixes extension */ if (!gdk_display_supports_selection_notification (gtk_clipboard_get_display (manager->clipboard))) { diff --git a/thunar/thunar-column-editor.c b/thunar/thunar-column-editor.c index b321d528..f165eb5b 100644 --- a/thunar/thunar-column-editor.c +++ b/thunar/thunar-column-editor.c @@ -259,7 +259,11 @@ thunar_column_editor_init (ThunarColumnEditor *column_editor) /* create the "Automatically expand columns as needed" button */ button = gtk_check_button_new_with_mnemonic (_("Automatically _expand columns as needed")); - exo_mutual_binding_new_with_negation (G_OBJECT (column_editor->preferences), "last-details-view-fixed-columns", G_OBJECT (button), "active"); + g_object_bind_property (G_OBJECT (column_editor->preferences), "last-details-view-fixed-columns", + G_OBJECT (button), "active", + G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE + | G_BINDING_INVERT_BOOLEAN); gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), button); gtk_widget_show (button); diff --git a/thunar/thunar-column-model.c b/thunar/thunar-column-model.c index 7eb47242..178e2e7e 100644 --- a/thunar/thunar-column-model.c +++ b/thunar/thunar-column-model.c @@ -44,7 +44,7 @@ static void thunar_column_model_tree_model_init (GtkTreeMo static void thunar_column_model_finalize (GObject *object); static GtkTreeModelFlags thunar_column_model_get_flags (GtkTreeModel *tree_model); static gint thunar_column_model_get_n_columns (GtkTreeModel *tree_model); -static GType thunar_column_model_get_column_type (GtkTreeModel *tree_model, +static GType thunar_column_model_get_column_type (GtkTreeModel *tree_model, gint idx); static gboolean thunar_column_model_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, @@ -233,7 +233,7 @@ thunar_column_model_get_n_columns (GtkTreeModel *tree_model) static GType -thunar_column_model_get_column_type (GtkTreeModel *tree_model, +thunar_column_model_get_column_type (GtkTreeModel *tree_model, gint idx) { switch (idx) diff --git a/thunar/thunar-create-dialog.c b/thunar/thunar-create-dialog.c index 781b060e..5eb938cc 100644 --- a/thunar/thunar-create-dialog.c +++ b/thunar/thunar-create-dialog.c @@ -106,8 +106,8 @@ thunar_create_dialog_class_init (ThunarCreateDialogClass *klass) **/ g_object_class_install_property (gobject_class, PROP_FILENAME, - g_param_spec_string ("filename", - "filename", + g_param_spec_string ("filename", + "filename", "filename", NULL, EXO_PARAM_READWRITE)); @@ -119,8 +119,8 @@ thunar_create_dialog_class_init (ThunarCreateDialogClass *klass) **/ g_object_class_install_property (gobject_class, PROP_CONTENT_TYPE, - g_param_spec_string ("content-type", - "content-type", + g_param_spec_string ("content-type", + "content-type", "content-type", NULL, EXO_PARAM_READWRITE)); @@ -150,7 +150,7 @@ thunar_create_dialog_init (ThunarCreateDialog *dialog) gtk_widget_show (table); dialog->image = g_object_new (GTK_TYPE_IMAGE, "xpad", 6, "ypad", 6, NULL); - gtk_table_attach (GTK_TABLE (table), dialog->image, 0, 1, 0, 2, GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE (table), dialog->image, 0, 1, 0, 2, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (dialog->image); label = g_object_new (GTK_TYPE_LABEL, "label", _("Enter the new name:"), "xalign", 0.0f, NULL); @@ -324,7 +324,7 @@ thunar_create_dialog_set_filename (ThunarCreateDialog *dialog, _thunar_return_if_fail (THUNAR_IS_CREATE_DIALOG (dialog)); _thunar_return_if_fail (filename != NULL); - + /* setup the new filename */ gtk_entry_set_text (GTK_ENTRY (dialog->entry), filename); @@ -361,7 +361,7 @@ thunar_create_dialog_set_filename (ThunarCreateDialog *dialog, * thunar_create_dialog_set_content_type: * @dialog : a #ThunarCreateDialog. * @content_type : the new content type. - * + * * Set the content type for @dialog to @content_type. **/ void diff --git a/thunar/thunar-dbus-service.c b/thunar/thunar-dbus-service.c index 30eba1bc..15060dc9 100644 --- a/thunar/thunar-dbus-service.c +++ b/thunar/thunar-dbus-service.c @@ -232,7 +232,7 @@ thunar_dbus_service_class_init (ThunarDBusServiceClass *klass) gobject_class->finalize = thunar_dbus_service_finalize; /* install the D-BUS info for our class */ - dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), &dbus_glib_thunar_dbus_service_object_info); /** @@ -401,7 +401,7 @@ thunar_dbus_service_trash_bin_changed (ThunarDBusService *dbus_service, _thunar_return_if_fail (THUNAR_IS_FILE (trash_bin)); /* emit the "trash-changed" signal with the new state */ - g_signal_emit_by_name (G_OBJECT (dbus_service), "trash-changed", + g_signal_emit_by_name (G_OBJECT (dbus_service), "trash-changed", thunar_file_get_item_count (trash_bin) > 0); } @@ -1023,13 +1023,13 @@ thunar_dbus_service_transfer_files (ThunarDBusTransferMode transfer_mode, /* verify that at least one file to transfer is given */ if (source_filenames == NULL || *source_filenames == NULL) { - g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_INVAL, + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_INVAL, _("At least one source filename must be specified")); return FALSE; } /* verify that the target filename is set / enough target filenames are given */ - if (transfer_mode == THUNAR_DBUS_TRANSFER_MODE_COPY_TO) + if (transfer_mode == THUNAR_DBUS_TRANSFER_MODE_COPY_TO) { if (g_strv_length ((gchar **)source_filenames) != g_strv_length ((gchar **)target_filenames)) { @@ -1097,23 +1097,23 @@ thunar_dbus_service_transfer_files (ThunarDBusTransferMode transfer_mode, switch (transfer_mode) { case THUNAR_DBUS_TRANSFER_MODE_COPY_TO: - thunar_application_copy_to (application, screen, - source_file_list, target_file_list, + thunar_application_copy_to (application, screen, + source_file_list, target_file_list, NULL); break; case THUNAR_DBUS_TRANSFER_MODE_COPY_INTO: - thunar_application_copy_into (application, screen, - source_file_list, target_file_list->data, + thunar_application_copy_into (application, screen, + source_file_list, target_file_list->data, NULL); break; case THUNAR_DBUS_TRANSFER_MODE_MOVE_INTO: - thunar_application_move_into (application, screen, - source_file_list, target_file_list->data, + thunar_application_move_into (application, screen, + source_file_list, target_file_list->data, NULL); break; case THUNAR_DBUS_TRANSFER_MODE_LINK_INTO: - thunar_application_link_into (application, screen, - source_file_list, target_file_list->data, + thunar_application_link_into (application, screen, + source_file_list, target_file_list->data, NULL); break; } diff --git a/thunar/thunar-deep-count-job.h b/thunar/thunar-deep-count-job.h index 735a1210..265e9c8e 100644 --- a/thunar/thunar-deep-count-job.h +++ b/thunar/thunar-deep-count-job.h @@ -2,19 +2,19 @@ /*- * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org>. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ diff --git a/thunar/thunar-details-view.c b/thunar/thunar-details-view.c index 05a539bf..033e0977 100644 --- a/thunar/thunar-details-view.c +++ b/thunar/thunar-details-view.c @@ -295,10 +295,10 @@ thunar_details_view_init (ThunarDetailsView *details_view) thunar_details_view_columns_changed (details_view->column_model, details_view); /* synchronize the "fixed-columns" property */ - exo_binding_new (G_OBJECT (THUNAR_STANDARD_VIEW (details_view)->preferences), - "last-details-view-fixed-columns", - G_OBJECT (details_view), - "fixed-columns"); + g_object_bind_property (G_OBJECT (THUNAR_STANDARD_VIEW (details_view)->preferences), + "last-details-view-fixed-columns", + G_OBJECT (details_view), "fixed-columns", + G_BINDING_SYNC_CREATE); /* apply fixed column widths if we start in fixed column mode */ if (G_UNLIKELY (details_view->fixed_columns)) @@ -743,7 +743,7 @@ thunar_details_view_button_press_event (GtkTreeView *tree_view, } action = thunar_gtk_ui_manager_get_action_by_name (THUNAR_STANDARD_VIEW (details_view)->ui_manager, action_name); - + /* emit the action */ if (G_LIKELY (action != NULL)) gtk_action_activate (action); diff --git a/thunar/thunar-device-monitor.c b/thunar/thunar-device-monitor.c index 6ac8e826..938c018a 100644 --- a/thunar/thunar-device-monitor.c +++ b/thunar/thunar-device-monitor.c @@ -195,8 +195,9 @@ thunar_device_monitor_init (ThunarDeviceMonitor *monitor) GList *lp; monitor->preferences = thunar_preferences_get (); - exo_binding_new (G_OBJECT (monitor->preferences), "hidden-devices", - G_OBJECT (monitor), "hidden-devices"); + g_object_bind_property (G_OBJECT (monitor->preferences), "hidden-devices", + G_OBJECT (monitor), "hidden-devices", + G_BINDING_SYNC_CREATE); /* table for GVolume/GMount (key) -> ThunarDevice (value) */ monitor->devices = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, g_object_unref); diff --git a/thunar/thunar-device.c b/thunar/thunar-device.c index 94dd9a7e..65cab877 100644 --- a/thunar/thunar-device.c +++ b/thunar/thunar-device.c @@ -247,7 +247,7 @@ thunar_device_operation_finish (GObject *object, { ThunarDeviceOperation *op = user_data; GError *error = NULL; - + _thunar_return_if_fail (G_IS_OBJECT (object)); _thunar_return_if_fail (G_IS_ASYNC_RESULT (result)); diff --git a/thunar/thunar-dialogs.c b/thunar/thunar-dialogs.c index 953d4f50..5255c9ae 100644 --- a/thunar/thunar-dialogs.c +++ b/thunar/thunar-dialogs.c @@ -176,7 +176,7 @@ thunar_dialogs_show_rename_file (gpointer parent, { /* hide the dialog */ gtk_widget_hide (dialog); - + /* determine the new filename */ text = gtk_entry_get_text (GTK_ENTRY (entry)); @@ -224,7 +224,7 @@ thunar_dialogs_show_about (GtkWindow *parent, "Nick Schermer <nick@xfce.org>", NULL, }; - + static const gchar *documenters[] = { "Benedikt Meurer <benny@xfce.org>", @@ -244,7 +244,7 @@ thunar_dialogs_show_about (GtkWindow *parent, comments = g_strdup_vprintf (format, args); va_end (args); - + /* try to load the about logo */ logo = gdk_pixbuf_new_from_file (DATADIR "/pixmaps/Thunar/Thunar-about-logo.png", NULL); @@ -572,7 +572,7 @@ thunar_dialogs_show_job_ask_replace (GtkWindow *parent, if (thunar_file_is_symlink (dst_file)) { - text = g_strdup_printf (_("This folder already contains a symbolic link \"%s\"."), + text = g_strdup_printf (_("This folder already contains a symbolic link \"%s\"."), thunar_file_get_display_name (dst_file)); } else if (thunar_file_is_directory (dst_file)) @@ -581,8 +581,8 @@ thunar_dialogs_show_job_ask_replace (GtkWindow *parent, thunar_file_get_display_name (dst_file)); } else - { - text = g_strdup_printf (_("This folder already contains a file \"%s\"."), + { + text = g_strdup_printf (_("This folder already contains a file \"%s\"."), thunar_file_get_display_name (dst_file)); } diff --git a/thunar/thunar-dnd.c b/thunar/thunar-dnd.c index 6a4339f9..acdca683 100644 --- a/thunar/thunar-dnd.c +++ b/thunar/thunar-dnd.c @@ -3,18 +3,18 @@ * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-exec.c b/thunar/thunar-exec.c index 06ceb825..edbe270e 100644 --- a/thunar/thunar-exec.c +++ b/thunar/thunar-exec.c @@ -3,18 +3,18 @@ * Copyright (c) 2005-2007 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-exec.h b/thunar/thunar-exec.h index 32b5b3c2..449d6286 100644 --- a/thunar/thunar-exec.h +++ b/thunar/thunar-exec.h @@ -3,18 +3,18 @@ * Copyright (c) 2005-2007 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-file-monitor.c b/thunar/thunar-file-monitor.c index 9c885c6f..b715c6f9 100644 --- a/thunar/thunar-file-monitor.c +++ b/thunar/thunar-file-monitor.c @@ -130,7 +130,7 @@ thunar_file_monitor_get_default (void) { /* allocate the default monitor */ file_monitor_default = g_object_new (THUNAR_TYPE_FILE_MONITOR, NULL); - g_object_add_weak_pointer (G_OBJECT (file_monitor_default), + g_object_add_weak_pointer (G_OBJECT (file_monitor_default), (gpointer) &file_monitor_default); } else diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c index 0878817b..0dd7e140 100644 --- a/thunar/thunar-file.c +++ b/thunar/thunar-file.c @@ -3,18 +3,18 @@ * Copyright (c) 2005-2007 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -524,7 +524,7 @@ static GFileInfo * thunar_file_info_get_file_info (ThunarxFileInfo *file_info) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file_info), NULL); - + if (THUNAR_FILE (file_info)->info != NULL) return g_object_ref (THUNAR_FILE (file_info)->info); else @@ -538,7 +538,7 @@ thunar_file_info_get_filesystem_info (ThunarxFileInfo *file_info) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file_info), NULL); - return g_file_query_filesystem_info (THUNAR_FILE (file_info)->gfile, + return g_file_query_filesystem_info (THUNAR_FILE (file_info)->gfile, THUNARX_FILESYSTEM_INFO_NAMESPACE, NULL, NULL); } @@ -603,7 +603,7 @@ thunar_file_denies_access_permission (const ThunarFile *file, { /* we're the owner, so the usr permissions must be granted */ result = ((mode & usr_permissions) == 0); - + /* release the user */ g_object_unref (G_OBJECT (user)); } @@ -628,7 +628,7 @@ thunar_file_denies_access_permission (const ThunarFile *file, g_object_unref (G_OBJECT (group)); return ((mode & grp_permissions) == 0); } - + /* release the effective user */ g_object_unref (G_OBJECT (user)); } @@ -770,7 +770,7 @@ static void thunar_file_info_clear (ThunarFile *file) { _thunar_return_if_fail (THUNAR_IS_FILE (file)); - + /* release the current file info */ if (file->info != NULL) { @@ -874,14 +874,14 @@ thunar_file_info_reload (ThunarFile *file, if (key_file != NULL) { /* read the icon name from the .desktop file */ - file->custom_icon_name = g_key_file_get_string (key_file, + file->custom_icon_name = g_key_file_get_string (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, NULL); if (G_UNLIKELY (exo_str_is_empty (file->custom_icon_name))) { - /* make sure we set null if the string is empty else the assertion in + /* make sure we set null if the string is empty else the assertion in * thunar_icon_factory_lookup_icon() will fail */ g_free (file->custom_icon_name); file->custom_icon_name = NULL; @@ -903,7 +903,7 @@ thunar_file_info_reload (ThunarFile *file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NAME, NULL, NULL); - + /* drop the name if it's empty or has invalid encoding */ if (exo_str_is_empty (file->display_name) || !g_utf8_validate (file->display_name, -1, NULL)) @@ -1028,7 +1028,7 @@ thunar_file_get_async_finish (GObject *object, * @error : return location for errors or %NULL. * * Loads all information about the file. As this is a possibly - * blocking call, it can be cancelled using @cancellable. + * blocking call, it can be cancelled using @cancellable. * * If loading the file fails or the operation is cancelled, * @error will be set. @@ -1297,7 +1297,7 @@ thunar_file_get_async (GFile *location, * * The returned #GFile is owned by @file and must not be released * with g_object_unref(). - * + * * Return value: the #GFile corresponding to @file. **/ GFile * @@ -1400,7 +1400,7 @@ thunar_file_check_loaded (ThunarFile *file) /** * thunar_file_execute: * @file : a #ThunarFile instance. - * @working_directory : the working directory used to resolve relative filenames + * @working_directory : the working directory used to resolve relative filenames * in @file_list. * @parent : %NULL, a #GdkScreen or #GtkWidget. * @file_list : the list of #GFile<!---->s to supply to @file on execution. @@ -1509,7 +1509,7 @@ thunar_file_execute (ThunarFile *file, else { /* TRANSLATORS: `URL' is a field name in a .desktop file. Don't translate it. */ - g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_INVAL, + g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_INVAL, _("No URL field specified")); } } @@ -1559,7 +1559,7 @@ thunar_file_execute (ThunarFile *file, } /* execute the command */ - result = xfce_spawn_on_screen (thunar_util_parse_parent (parent, NULL), + result = xfce_spawn_on_screen (thunar_util_parse_parent (parent, NULL), directory, argv, NULL, G_SPAWN_SEARCH_PATH, snotify, gtk_get_current_event_time (), icon_name, error); } @@ -1786,7 +1786,7 @@ thunar_file_rename (ThunarFile *file, { /* remember the previous file */ previous_file = g_object_ref (file->gfile); - + /* try to rename the file */ renamed_file = g_file_set_display_name (file->gfile, name, cancellable, error); @@ -1925,7 +1925,7 @@ thunar_file_accepts_drop (ThunarFile *file, /* if the source offers both copy and move and the GTK+ suggested action is copy, try to be smart telling whether * we should copy or move by default by checking whether the source and target are on the same disk. */ - if ((actions & (GDK_ACTION_COPY | GDK_ACTION_MOVE)) != 0 + if ((actions & (GDK_ACTION_COPY | GDK_ACTION_MOVE)) != 0 && (suggested_action == GDK_ACTION_COPY)) { /* default to move as suggested action */ @@ -1944,10 +1944,10 @@ thunar_file_accepts_drop (ThunarFile *file, /* we have only move if we know the source and both the source and the target * are on the same disk, and the source file is owned by the current user. */ - if (ofile == NULL + if (ofile == NULL || !thunar_file_same_filesystem (file, ofile) - || (ofile->info != NULL - && g_file_info_get_attribute_uint32 (ofile->info, + || (ofile->info != NULL + && g_file_info_get_attribute_uint32 (ofile->info, G_FILE_ATTRIBUTE_UNIX_UID) != effective_user_id)) { /* default to copy and get outa here */ @@ -2008,16 +2008,16 @@ thunar_file_get_date (const ThunarFile *file, if (file->info == NULL) return 0; - + switch (date_type) { - case THUNAR_FILE_DATE_ACCESSED: + case THUNAR_FILE_DATE_ACCESSED: attribute = G_FILE_ATTRIBUTE_TIME_ACCESS; break; case THUNAR_FILE_DATE_CHANGED: attribute = G_FILE_ATTRIBUTE_TIME_CHANGED; break; - case THUNAR_FILE_DATE_MODIFIED: + case THUNAR_FILE_DATE_MODIFIED: attribute = G_FILE_ATTRIBUTE_TIME_MODIFIED; break; default: @@ -2147,8 +2147,8 @@ thunar_file_get_size_string (const ThunarFile *file) * thunar_file_get_volume: * @file : a #ThunarFile instance. * - * Attempts to determine the #GVolume on which @file is located. If @file cannot - * determine it's volume, then %NULL will be returned. Else a #GVolume instance + * Attempts to determine the #GVolume on which @file is located. If @file cannot + * determine it's volume, then %NULL will be returned. Else a #GVolume instance * is returned which has to be released by the caller using g_object_unref(). * * Return value: the #GVolume for @file or %NULL. @@ -2367,8 +2367,8 @@ thunar_file_get_basename (const ThunarFile *file) * * Return value: %TRUE if @file is a symbolic link. **/ -gboolean -thunar_file_is_symlink (const ThunarFile *file) +gboolean +thunar_file_is_symlink (const ThunarFile *file) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE); @@ -2407,14 +2407,14 @@ thunar_file_get_size (const ThunarFile *file) * @file : a #ThunarFile instance. * * Returns the default #GAppInfo for @file or %NULL if there is none. - * + * * The caller is responsible to free the returned #GAppInfo using * g_object_unref(). * * Return value: Default #GAppInfo for @file or %NULL if there is none. **/ GAppInfo * -thunar_file_get_default_handler (const ThunarFile *file) +thunar_file_get_default_handler (const ThunarFile *file) { const gchar *content_type; GAppInfo *app_info = NULL; @@ -2450,7 +2450,7 @@ thunar_file_get_default_handler (const ThunarFile *file) * Return value: the kind of @file. **/ GFileType -thunar_file_get_kind (const ThunarFile *file) +thunar_file_get_kind (const ThunarFile *file) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file), G_FILE_TYPE_UNKNOWN); return file->kind; @@ -2467,7 +2467,7 @@ thunar_file_get_target_location (const ThunarFile *file) if (file->info == NULL) return g_object_ref (file->gfile); - + uri = g_file_info_get_attribute_string (file->info, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI); @@ -2485,7 +2485,7 @@ thunar_file_get_target_location (const ThunarFile *file) * Return value: the permission bits of @file. **/ ThunarFileMode -thunar_file_get_mode (const ThunarFile *file) +thunar_file_get_mode (const ThunarFile *file) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file), 0); @@ -2527,7 +2527,7 @@ thunar_file_exists (const ThunarFile *file) * Return value: %TRUE if @file is a directory. **/ gboolean -thunar_file_is_directory (const ThunarFile *file) +thunar_file_is_directory (const ThunarFile *file) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE); return file->kind == G_FILE_TYPE_DIRECTORY; @@ -2544,7 +2544,7 @@ thunar_file_is_directory (const ThunarFile *file) * Return value: %TRUE if @file is a shortcut. **/ gboolean -thunar_file_is_shortcut (const ThunarFile *file) +thunar_file_is_shortcut (const ThunarFile *file) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE); return file->kind == G_FILE_TYPE_SHORTCUT; @@ -2561,7 +2561,7 @@ thunar_file_is_shortcut (const ThunarFile *file) * Return value: %TRUE if @file is a mountable file/directory. **/ gboolean -thunar_file_is_mountable (const ThunarFile *file) +thunar_file_is_mountable (const ThunarFile *file) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE); return file->kind == G_FILE_TYPE_MOUNTABLE; @@ -2685,7 +2685,7 @@ thunar_file_is_ancestor (const ThunarFile *file, * * Determines whether the owner of the current process is allowed * to execute the @file (or enter the directory refered to by - * @file). On UNIX it also returns %TRUE if @file refers to a + * @file). On UNIX it also returns %TRUE if @file refers to a * desktop entry. * * Return value: %TRUE if @file can be executed. @@ -2747,8 +2747,8 @@ thunar_file_is_readable (const ThunarFile *file) if (!g_file_info_has_attribute (file->info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ)) return TRUE; - - return g_file_info_get_attribute_boolean (file->info, + + return g_file_info_get_attribute_boolean (file->info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ); } @@ -2767,14 +2767,14 @@ gboolean thunar_file_is_writable (const ThunarFile *file) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE); - + if (file->info == NULL) return FALSE; if (!g_file_info_has_attribute (file->info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE)) return TRUE; - return g_file_info_get_attribute_boolean (file->info, + return g_file_info_get_attribute_boolean (file->info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE); } @@ -2792,7 +2792,7 @@ gboolean thunar_file_is_hidden (const ThunarFile *file) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE); - + if (file->info == NULL) return FALSE; @@ -2840,7 +2840,7 @@ thunar_file_is_regular (const ThunarFile *file) * thunar_file_is_trashed: * @file : a #ThunarFile instance. * - * Returns %TRUE if @file is a local file that resides in + * Returns %TRUE if @file is a local file that resides in * the trash bin. * * Return value: %TRUE if @file is in the trash, or @@ -3013,7 +3013,7 @@ thunar_file_get_original_path (const ThunarFile *file) * Returns the number of items in the trash, if @file refers to the * trash root directory. Otherwise returns 0. * - * Return value: number of files in the trash if @file is the trash + * Return value: number of files in the trash if @file is the trash * root dir, 0 otherwise. **/ guint32 @@ -3024,7 +3024,7 @@ thunar_file_get_item_count (const ThunarFile *file) if (file->info == NULL) return 0; - return g_file_info_get_attribute_uint32 (file->info, + return g_file_info_get_attribute_uint32 (file->info, G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT); } @@ -3056,7 +3056,7 @@ thunar_file_is_chmodable (const ThunarFile *file) } else { - return ((effective_user_id == 0 + return ((effective_user_id == 0 || effective_user_id == g_file_info_get_attribute_uint32 (file->info, G_FILE_ATTRIBUTE_UNIX_UID)) && !thunar_file_is_trashed (file)); @@ -3080,7 +3080,7 @@ gboolean thunar_file_is_renameable (const ThunarFile *file) { _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE); - + if (file->info == NULL) return FALSE; @@ -3098,7 +3098,7 @@ thunar_file_can_be_trashed (const ThunarFile *file) if (file->info == NULL) return FALSE; - return g_file_info_get_attribute_boolean (file->info, + return g_file_info_get_attribute_boolean (file->info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH); } @@ -3146,8 +3146,8 @@ thunar_file_get_emblem_names (ThunarFile *file) /* determine the user ID of the file owner */ /* TODO what are we going to do here on non-UNIX systems? */ - uid = file->info != NULL - ? g_file_info_get_attribute_uint32 (file->info, G_FILE_ATTRIBUTE_UNIX_UID) + uid = file->info != NULL + ? g_file_info_get_attribute_uint32 (file->info, G_FILE_ATTRIBUTE_UNIX_UID) : 0; /* we add "cant-read" if either (a) the file is not readable or (b) a directory, that lacks the @@ -3328,7 +3328,7 @@ thunar_file_get_thumbnail_path (ThunarFile *file) basename = g_strconcat (g_checksum_get_string (checksum), ".png", NULL); g_checksum_free (checksum); - file->thumbnail_path = g_build_filename (xfce_get_homedir (), ".thumbnails", + file->thumbnail_path = g_build_filename (xfce_get_homedir (), ".thumbnails", "normal", basename, NULL); g_free (basename); @@ -3363,12 +3363,12 @@ thunar_file_get_thumb_state (const ThunarFile *file) * @file : a #ThunarFile. * @thumb_state : the new #ThunarFileThumbState. * - * Sets the #ThunarFileThumbState for @file to @thumb_state. + * Sets the #ThunarFileThumbState for @file to @thumb_state. * This will cause a "file-changed" signal to be emitted from - * #ThunarFileMonitor. - **/ + * #ThunarFileMonitor. + **/ void -thunar_file_set_thumb_state (ThunarFile *file, +thunar_file_set_thumb_state (ThunarFile *file, ThunarFileThumbState state) { _thunar_return_if_fail (THUNAR_IS_FILE (file)); @@ -3399,7 +3399,7 @@ thunar_file_set_thumb_state (ThunarFile *file, * thunar_file_get_custom_icon: * @file : a #ThunarFile instance. * - * Queries the custom icon from @file if any, else %NULL is returned. + * Queries the custom icon from @file if any, else %NULL is returned. * The custom icon can be either a themed icon name or an absolute path * to an icon file in the local file system. * @@ -3750,11 +3750,11 @@ thunar_file_reload (ThunarFile *file) /* ... and tell others */ thunar_file_changed (file); - + } - + /** * thunar_file_destroy: * @file : a #ThunarFile instance. @@ -3852,10 +3852,10 @@ thunar_file_same_filesystem (const ThunarFile *file_a, return FALSE; /* determine the filesystem IDs */ - filesystem_id_a = g_file_info_get_attribute_string (file_a->info, + filesystem_id_a = g_file_info_get_attribute_string (file_a->info, G_FILE_ATTRIBUTE_ID_FILESYSTEM); - filesystem_id_b = g_file_info_get_attribute_string (file_b->info, + filesystem_id_b = g_file_info_get_attribute_string (file_b->info, G_FILE_ATTRIBUTE_ID_FILESYSTEM); /* compare the filesystem IDs */ @@ -3892,9 +3892,9 @@ thunar_file_cache_lookup (const GFile *file) /* allocate the ThunarFile cache on-demand */ if (G_UNLIKELY (file_cache == NULL)) { - file_cache = g_hash_table_new_full (g_file_hash, - (GEqualFunc) g_file_equal, - (GDestroyNotify) g_object_unref, + file_cache = g_hash_table_new_full (g_file_hash, + (GEqualFunc) g_file_equal, + (GDestroyNotify) g_object_unref, NULL); } @@ -3944,7 +3944,7 @@ compare_app_infos (gconstpointer a, * thunar_file_list_get_applications: * @file_list : a #GList of #ThunarFile<!---->s. * - * Returns the #GList of #GAppInfo<!---->s that can be used to open + * Returns the #GList of #GAppInfo<!---->s that can be used to open * all #ThunarFile<!---->s in the given @file_list. * * The caller is responsible to free the returned list using something like: @@ -3952,7 +3952,7 @@ compare_app_infos (gconstpointer a, * g_list_free_full (list, g_object_unref); * </programlisting></informalexample> * - * Return value: the list of #GAppInfo<!---->s that can be used to open all + * Return value: the list of #GAppInfo<!---->s that can be used to open all * items in the @file_list. **/ GList* diff --git a/thunar/thunar-file.h b/thunar/thunar-file.h index 74ed6f8d..33d70f56 100644 --- a/thunar/thunar-file.h +++ b/thunar/thunar-file.h @@ -191,9 +191,9 @@ gboolean thunar_file_is_mountable (const ThunarFile *file gboolean thunar_file_is_local (const ThunarFile *file); gboolean thunar_file_is_parent (const ThunarFile *file, const ThunarFile *child); -gboolean thunar_file_is_gfile_ancestor (const ThunarFile *file, +gboolean thunar_file_is_gfile_ancestor (const ThunarFile *file, GFile *ancestor); -gboolean thunar_file_is_ancestor (const ThunarFile *file, +gboolean thunar_file_is_ancestor (const ThunarFile *file, const ThunarFile *ancestor); gboolean thunar_file_is_executable (const ThunarFile *file); gboolean thunar_file_is_writable (const ThunarFile *file); @@ -225,7 +225,7 @@ gboolean thunar_file_set_custom_icon (ThunarFile *fil const gchar *thunar_file_get_thumbnail_path (ThunarFile *file); ThunarFileThumbState thunar_file_get_thumb_state (const ThunarFile *file); -void thunar_file_set_thumb_state (ThunarFile *file, +void thunar_file_set_thumb_state (ThunarFile *file, ThunarFileThumbState state); GIcon *thunar_file_get_preview_icon (const ThunarFile *file); GFilesystemPreviewType thunar_file_get_preview_type (const ThunarFile *file); diff --git a/thunar/thunar-gdk-extensions.c b/thunar/thunar-gdk-extensions.c index 8c1fb738..b9acedc4 100644 --- a/thunar/thunar-gdk-extensions.c +++ b/thunar/thunar-gdk-extensions.c @@ -151,7 +151,7 @@ thunar_gdk_cairo_create_surface (const GdkPixbuf *pixbuf) * @display_name : a fully qualified display name. * @error : return location for errors or %NULL. * - * Opens the screen referenced by the @display_name. Returns a + * Opens the screen referenced by the @display_name. Returns a * reference on the #GdkScreen for @display_name or %NULL if * @display_name couldn't be opened. * diff --git a/thunar/thunar-gtk-extensions.c b/thunar/thunar-gtk-extensions.c index f158a33e..38e0fd5f 100644 --- a/thunar/thunar-gtk-extensions.c +++ b/thunar/thunar-gtk-extensions.c @@ -201,7 +201,7 @@ thunar_gtk_ui_manager_get_action_by_name (GtkUIManager *ui_manager, _thunar_return_val_if_fail (ui_manager == NULL || GTK_IS_UI_MANAGER (ui_manager), NULL); _thunar_return_val_if_fail (action_name != NULL, NULL); - + if (ui_manager == NULL) return NULL; diff --git a/thunar/thunar-icon-factory.c b/thunar/thunar-icon-factory.c index 96d783df..3ebc5e02 100644 --- a/thunar/thunar-icon-factory.c +++ b/thunar/thunar-icon-factory.c @@ -3,18 +3,18 @@ * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -670,8 +670,9 @@ thunar_icon_factory_get_for_icon_theme (GtkIconTheme *icon_theme) /* connect the "show-thumbnails" property to the global preference */ factory->preferences = thunar_preferences_get (); - exo_binding_new (G_OBJECT (factory->preferences), "misc-thumbnail-mode", - G_OBJECT (factory), "thumbnail-mode"); + g_object_bind_property (G_OBJECT (factory->preferences), "misc-thumbnail-mode", + G_OBJECT (factory), "thumbnail-mode", + G_BINDING_SYNC_CREATE); } else { @@ -749,7 +750,7 @@ thunar_icon_factory_load_icon (ThunarIconFactory *factory, { _thunar_return_val_if_fail (THUNAR_IS_ICON_FACTORY (factory), NULL); _thunar_return_val_if_fail (size > 0, NULL); - + /* cannot happen unless there's no XSETTINGS manager * for the default screen, but just in case... */ @@ -833,9 +834,9 @@ thunar_icon_factory_load_file_icon (ThunarIconFactory *factory, if (G_IS_THEMED_ICON (gicon)) { /* we have a themed preview icon, look it up using the icon theme */ - icon_info = - gtk_icon_theme_lookup_by_gicon (factory->icon_theme, - gicon, icon_size, + icon_info = + gtk_icon_theme_lookup_by_gicon (factory->icon_theme, + gicon, icon_size, GTK_ICON_LOOKUP_USE_BUILTIN | GTK_ICON_LOOKUP_FORCE_SIZE); diff --git a/thunar/thunar-icon-view.c b/thunar/thunar-icon-view.c index af2cc2c1..b14c39f7 100644 --- a/thunar/thunar-icon-view.c +++ b/thunar/thunar-icon-view.c @@ -107,7 +107,9 @@ thunar_icon_view_init (ThunarIconView *icon_view) NULL); /* synchronize the "text-beside-icons" property with the global preference */ - exo_binding_new (G_OBJECT (THUNAR_STANDARD_VIEW (icon_view)->preferences), "misc-text-beside-icons", G_OBJECT (icon_view), "text-beside-icons"); + g_object_bind_property (G_OBJECT (THUNAR_STANDARD_VIEW (icon_view)->preferences), "misc-text-beside-icons", + G_OBJECT (icon_view), "text-beside-icons", + G_BINDING_SYNC_CREATE); } diff --git a/thunar/thunar-image.c b/thunar/thunar-image.c index 650da202..cff52052 100644 --- a/thunar/thunar-image.c +++ b/thunar/thunar-image.c @@ -2,18 +2,18 @@ /*- * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -93,7 +93,7 @@ thunar_image_class_init (ThunarImageClass *klass) g_type_class_add_private (klass, sizeof (ThunarImagePrivate)); gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = thunar_image_finalize; + gobject_class->finalize = thunar_image_finalize; gobject_class->get_property = thunar_image_get_property; gobject_class->set_property = thunar_image_set_property; @@ -114,7 +114,7 @@ thunar_image_init (ThunarImage *image) image->priv->file = NULL; image->priv->monitor = thunar_file_monitor_get_default (); - g_signal_connect (image->priv->monitor, "file-changed", + g_signal_connect (image->priv->monitor, "file-changed", G_CALLBACK (thunar_image_file_changed), image); } @@ -125,7 +125,7 @@ thunar_image_finalize (GObject *object) { ThunarImage *image = THUNAR_IMAGE (object); - g_signal_handlers_disconnect_by_func (image->priv->monitor, + g_signal_handlers_disconnect_by_func (image->priv->monitor, thunar_image_file_changed, image); g_object_unref (image->priv->monitor); @@ -187,7 +187,7 @@ thunar_image_update (ThunarImage *image) GdkScreen *screen; _thunar_return_if_fail (THUNAR_IS_IMAGE (image)); - + if (THUNAR_IS_FILE (image->priv->file)) { screen = gtk_widget_get_screen (GTK_WIDGET (image)); diff --git a/thunar/thunar-image.h b/thunar/thunar-image.h index 8714475b..25c4e90c 100644 --- a/thunar/thunar-image.h +++ b/thunar/thunar-image.h @@ -2,18 +2,18 @@ /*- * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-io-jobs-util.c b/thunar/thunar-io-jobs-util.c index 1f9a1516..fd0cff69 100644 --- a/thunar/thunar-io-jobs-util.c +++ b/thunar/thunar-io-jobs-util.c @@ -31,7 +31,7 @@ -static const gchar *duplicate_names[4][2] = +static const gchar *duplicate_names[4][2] = { /* Copy/link name for n <= 3 */ { N_("copy of %s"), N_("link to %s"), }, @@ -61,7 +61,7 @@ static const gchar *duplicate_names[4][2] = * n >= 4: "@n<!---->th copy of X" * * Links follow the same naming scheme, except that they use - * "link to X" instead of "copy of X". + * "link to X" instead of "copy of X". * * If there are errors or the job was cancelled, the return value * will be %NULL and @error will be set. @@ -83,7 +83,7 @@ thunar_io_jobs_util_next_duplicate_file (ThunarJob *job, gchar *display_name; gint type_index; gint name_index; - + _thunar_return_val_if_fail (THUNAR_IS_JOB (job), NULL); _thunar_return_val_if_fail (G_IS_FILE (file), NULL); _thunar_return_val_if_fail (0 < n, NULL); @@ -95,7 +95,7 @@ thunar_io_jobs_util_next_duplicate_file (ThunarJob *job, return NULL; /* query the source file info / display name */ - info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, + info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, exo_job_get_cancellable (EXO_JOB (job)), &err); @@ -111,7 +111,7 @@ thunar_io_jobs_util_next_duplicate_file (ThunarJob *job, /* make sure the name index is not out of bounds */ name_index = MIN (n-1, G_N_ELEMENTS (duplicate_names)-1); - + /* generate the display name for the nth copy/link of the source file */ if (name_index < (gint) G_N_ELEMENTS (duplicate_names)-1) { diff --git a/thunar/thunar-io-jobs.c b/thunar/thunar-io-jobs.c index 9d904f96..242400f4 100644 --- a/thunar/thunar-io-jobs.c +++ b/thunar/thunar-io-jobs.c @@ -50,13 +50,13 @@ _tij_collect_nofollow (ThunarJob *job, GList *lp; /* recursively collect the files */ - for (lp = base_file_list; - err == NULL && lp != NULL && !exo_job_is_cancelled (EXO_JOB (job)); + for (lp = base_file_list; + err == NULL && lp != NULL && !exo_job_is_cancelled (EXO_JOB (job)); lp = lp->next) { /* try to scan the directory */ - child_file_list = thunar_io_scan_directory (job, lp->data, - G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, + child_file_list = thunar_io_scan_directory (job, lp->data, + G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, TRUE, unlinking, FALSE, &err); /* prepend the new files to the existing list */ @@ -98,7 +98,7 @@ _thunar_io_jobs_create (ThunarJob *job, gchar *display_name; GFile *template_file; GFileInputStream *template_stream = NULL; - + _thunar_return_val_if_fail (THUNAR_IS_JOB (job), FALSE); _thunar_return_val_if_fail (param_values != NULL, FALSE); _thunar_return_val_if_fail (param_values->len == 2, FALSE); @@ -124,8 +124,8 @@ _thunar_io_jobs_create (ThunarJob *job, } /* iterate over all files in the list */ - for (lp = file_list; - err == NULL && lp != NULL && !exo_job_is_cancelled (EXO_JOB (job)); + for (lp = file_list; + err == NULL && lp != NULL && !exo_job_is_cancelled (EXO_JOB (job)); lp = lp->next) { g_assert (G_IS_FILE (lp->data)); @@ -135,8 +135,8 @@ _thunar_io_jobs_create (ThunarJob *job, again: /* try to create the file */ - stream = g_file_create (lp->data, - G_FILE_CREATE_NONE, + stream = g_file_create (lp->data, + G_FILE_CREATE_NONE, exo_job_get_cancellable (EXO_JOB (job)), &err); @@ -176,8 +176,8 @@ again: } /* ask the user whether he wants to overwrite the existing file */ - response = thunar_job_ask_overwrite (THUNAR_JOB (job), - _("The file \"%s\" already exists"), + response = thunar_job_ask_overwrite (THUNAR_JOB (job), + _("The file \"%s\" already exists"), display_name); /* check if we should overwrite */ @@ -187,11 +187,11 @@ again: if (g_file_delete (lp->data, exo_job_get_cancellable (EXO_JOB (job)), &err)) goto again; } - + /* clean up */ g_free (display_name); } - else + else { /* determine display name of the file */ base_name = g_file_get_basename (lp->data); @@ -199,7 +199,7 @@ again: g_free (base_name); /* ask the user whether to skip/retry this path (cancels the job if not) */ - response = thunar_job_ask_skip (THUNAR_JOB (job), + response = thunar_job_ask_skip (THUNAR_JOB (job), _("Failed to create empty file \"%s\": %s"), display_name, err->message); g_free (display_name); @@ -283,7 +283,7 @@ _thunar_io_jobs_mkdir (ThunarJob *job, /* we know the total list of files to process */ thunar_job_set_total_files (THUNAR_JOB (job), file_list); - for (lp = file_list; + for (lp = file_list; err == NULL && lp != NULL && !exo_job_is_cancelled (EXO_JOB (job)); lp = lp->next) { @@ -330,7 +330,7 @@ again: } /* ask the user whether he wants to overwrite the existing file */ - response = thunar_job_ask_overwrite (THUNAR_JOB (job), + response = thunar_job_ask_overwrite (THUNAR_JOB (job), _("The file \"%s\" already exists"), display_name); @@ -353,7 +353,7 @@ again: g_free (base_name); /* ask the user whether to skip/retry this path (cancels the job if not) */ - response = thunar_job_ask_skip (THUNAR_JOB (job), + response = thunar_job_ask_skip (THUNAR_JOB (job), _("Failed to create directory \"%s\": %s"), display_name, err->message); g_free (display_name); @@ -381,7 +381,7 @@ again: /* emit the "new-files" signal with the given file list */ thunar_job_new_files (THUNAR_JOB (job), file_list); - + return TRUE; } @@ -465,10 +465,10 @@ again: else { /* query the file info for the display name */ - info = g_file_query_info (lp->data, + info = g_file_query_info (lp->data, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, - G_FILE_QUERY_INFO_NONE, - exo_job_get_cancellable (EXO_JOB (job)), + G_FILE_QUERY_INFO_NONE, + exo_job_get_cancellable (EXO_JOB (job)), NULL); /* abort if the job was cancelled */ @@ -492,8 +492,8 @@ again: } /* ask the user whether he wants to skip this file */ - response = thunar_job_ask_skip (THUNAR_JOB (job), - _("Could not delete file \"%s\": %s"), + response = thunar_job_ask_skip (THUNAR_JOB (job), + _("Could not delete file \"%s\": %s"), display_name, err->message); g_free (display_name); @@ -539,9 +539,9 @@ thunar_io_jobs_move_files (GList *source_file_list, _thunar_return_val_if_fail (target_file_list != NULL, NULL); _thunar_return_val_if_fail (g_list_length (source_file_list) == g_list_length (target_file_list), NULL); - job = thunar_transfer_job_new (source_file_list, target_file_list, + job = thunar_transfer_job_new (source_file_list, target_file_list, THUNAR_TRANSFER_JOB_MOVE); - + return THUNAR_JOB (exo_job_launch (EXO_JOB (job))); } @@ -606,7 +606,7 @@ _thunar_io_jobs_link_file (ThunarJob *job, if (!g_file_equal (source_file, target_file)) { /* try to create the symlink */ - if (g_file_make_symbolic_link (target_file, source_path, + if (g_file_make_symbolic_link (target_file, source_path, exo_job_get_cancellable (EXO_JOB (job)), &err)) { @@ -639,7 +639,7 @@ _thunar_io_jobs_link_file (ThunarJob *job, /* return the real target file */ return duplicate_file; } - + /* release the duplicate file, we no longer need it */ g_object_unref (duplicate_file); } @@ -668,7 +668,7 @@ _thunar_io_jobs_link_file (ThunarJob *job, /* try to delete the file */ if (response == THUNAR_JOB_RESPONSE_YES) { - /* try to remove the target file. if not possible, err will be set and + /* try to remove the target file. if not possible, err will be set and * the while loop will be aborted */ g_file_delete (target_file, exo_job_get_cancellable (EXO_JOB (job)), &err); } @@ -740,16 +740,16 @@ _thunar_io_jobs_link (ThunarJob *job, /* queue the file for the folder update unless it was skipped */ if (sp->data != real_target_file) { - new_files_list = thunar_g_file_list_prepend (new_files_list, + new_files_list = thunar_g_file_list_prepend (new_files_list, real_target_file); /* notify the thumbnail cache that we need to copy the original * thumbnail for the symlink to have one too */ - thunar_thumbnail_cache_copy_file (thumbnail_cache, sp->data, + thunar_thumbnail_cache_copy_file (thumbnail_cache, sp->data, real_target_file); } - + /* release the real target file */ g_object_unref (real_target_file); } @@ -863,7 +863,7 @@ thunar_io_jobs_restore_files (GList *source_file_list, _thunar_return_val_if_fail (target_file_list != NULL, NULL); _thunar_return_val_if_fail (g_list_length (source_file_list) == g_list_length (target_file_list), NULL); - job = thunar_transfer_job_new (source_file_list, target_file_list, + job = thunar_transfer_job_new (source_file_list, target_file_list, THUNAR_TRANSFER_JOB_MOVE); return THUNAR_JOB (exo_job_launch (EXO_JOB (job))); @@ -920,7 +920,7 @@ _thunar_io_jobs_chown (ThunarJob *job, thunar_job_processing_file (THUNAR_JOB (job), lp); /* try to query information about the file */ - info = g_file_query_info (lp->data, + info = g_file_query_info (lp->data, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, exo_job_get_cancellable (EXO_JOB (job)), @@ -953,11 +953,11 @@ retry_chown: if (err != NULL && !exo_job_is_cancelled (EXO_JOB (job))) { /* generate a useful error message */ - message = G_LIKELY (uid >= 0) ? _("Failed to change the owner of \"%s\": %s") + message = G_LIKELY (uid >= 0) ? _("Failed to change the owner of \"%s\": %s") : _("Failed to change the group of \"%s\": %s"); /* ask the user whether to skip/retry this file */ - response = thunar_job_ask_skip (THUNAR_JOB (job), message, + response = thunar_job_ask_skip (THUNAR_JOB (job), message, g_file_info_get_display_name (info), err->message); @@ -1062,7 +1062,7 @@ _thunar_io_jobs_chmod (ThunarJob *job, thunar_job_processing_file (THUNAR_JOB (job), lp); /* try to query information about the file */ - info = g_file_query_info (lp->data, + info = g_file_query_info (lp->data, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_UNIX_MODE, @@ -1089,7 +1089,7 @@ retry_chown: /* determine the current mode */ old_mode = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_MODE); - /* generate the new mode, taking the old mode (which contains file type + /* generate the new mode, taking the old mode (which contains file type * information) into account */ new_mode = ((old_mode & ~mask) | mode) & 07777; @@ -1108,7 +1108,7 @@ retry_chown: { /* ask the user whether to skip/retry this file */ response = thunar_job_ask_skip (job, - _("Failed to change the permissions of \"%s\": %s"), + _("Failed to change the permissions of \"%s\": %s"), g_file_info_get_display_name (info), err->message); @@ -1190,7 +1190,7 @@ _thunar_io_jobs_ls (ThunarJob *job, /* collect directory contents (non-recursively) */ file_list = thunar_io_scan_directory (job, directory, - G_FILE_QUERY_INFO_NONE, + G_FILE_QUERY_INFO_NONE, FALSE, FALSE, TRUE, &err); /* abort on errors or cancellation */ @@ -1216,7 +1216,7 @@ _thunar_io_jobs_ls (ThunarJob *job, thunar_g_file_list_free (file_list); } } - + /* there should be no errors here */ _thunar_assert (err == NULL); @@ -1236,7 +1236,7 @@ ThunarJob * thunar_io_jobs_list_directory (GFile *directory) { _thunar_return_val_if_fail (G_IS_FILE (directory), NULL); - + return thunar_simple_job_launch (_thunar_io_jobs_ls, 1, G_TYPE_FILE, directory); } @@ -1284,8 +1284,8 @@ _thunar_io_jobs_rename (ThunarJob *job, /* try to rename the file */ if (thunar_file_rename (file, display_name, exo_job_get_cancellable (EXO_JOB (job)), TRUE, &err)) { - exo_job_send_to_mainloop (EXO_JOB (job), - (GSourceFunc) _thunar_io_jobs_rename_notify, + exo_job_send_to_mainloop (EXO_JOB (job), + (GSourceFunc) _thunar_io_jobs_rename_notify, g_object_ref (file), g_object_unref); } @@ -1308,7 +1308,7 @@ thunar_io_jobs_rename_file (ThunarFile *file, _thunar_return_val_if_fail (THUNAR_IS_FILE (file), NULL); _thunar_return_val_if_fail (g_utf8_validate (display_name, -1, NULL), NULL); - return thunar_simple_job_launch (_thunar_io_jobs_rename, 2, - THUNAR_TYPE_FILE, file, + return thunar_simple_job_launch (_thunar_io_jobs_rename, 2, + THUNAR_TYPE_FILE, file, G_TYPE_STRING, display_name); } diff --git a/thunar/thunar-io-scan-directory.c b/thunar/thunar-io-scan-directory.c index 66ddbdfa..8f81724c 100644 --- a/thunar/thunar-io-scan-directory.c +++ b/thunar/thunar-io-scan-directory.c @@ -52,7 +52,7 @@ thunar_io_scan_directory (ThunarJob *job, const gchar *namespace; ThunarFile *thunar_file; gboolean is_mounted; - + _thunar_return_val_if_fail (THUNAR_IS_JOB (job), NULL); _thunar_return_val_if_fail (G_IS_FILE (file), NULL); _thunar_return_val_if_fail (error == NULL || *error == NULL, NULL); @@ -61,8 +61,8 @@ thunar_io_scan_directory (ThunarJob *job, if (exo_job_set_error_if_cancelled (EXO_JOB (job), error)) return NULL; - /* don't recurse when we are scanning prior to unlinking and the current - * file/dir is in the trash. In GVfs, only the top-level directories in + /* don't recurse when we are scanning prior to unlinking and the current + * file/dir is in the trash. In GVfs, only the top-level directories in * the trash can be modified and deleted directly. See * http://bugzilla.xfce.org/show_bug.cgi?id=7147 * for more information */ @@ -108,7 +108,7 @@ thunar_io_scan_directory (ThunarJob *job, { /* query info of the child */ info = g_file_enumerator_next_file (enumerator, - exo_job_get_cancellable (EXO_JOB (job)), + exo_job_get_cancellable (EXO_JOB (job)), &err); if (G_UNLIKELY (info == NULL)) @@ -150,10 +150,10 @@ thunar_io_scan_directory (ThunarJob *job, && is_mounted && g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) { - child_files = thunar_io_scan_directory (job, child_file, flags, recursively, + child_files = thunar_io_scan_directory (job, child_file, flags, recursively, unlinking, return_thunar_files, &err); - /* prepend children to the file list to make sure they're + /* prepend children to the file list to make sure they're * processed first (required for unlinking) */ files = g_list_concat (child_files, files); } @@ -177,6 +177,6 @@ thunar_io_scan_directory (ThunarJob *job, thunar_g_file_list_free (files); return NULL; } - + return files; } diff --git a/thunar/thunar-job.c b/thunar/thunar-job.c index 0cd0c38c..2345a2a6 100644 --- a/thunar/thunar-job.c +++ b/thunar/thunar-job.c @@ -2,18 +2,18 @@ /*- * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -148,7 +148,7 @@ thunar_job_class_init (ThunarJobClass *klass) G_STRUCT_OFFSET (ThunarJobClass, ask_replace), _thunar_job_ask_accumulator, NULL, _thunar_marshal_FLAGS__OBJECT_OBJECT, - THUNAR_TYPE_JOB_RESPONSE, + THUNAR_TYPE_JOB_RESPONSE, 2, THUNAR_TYPE_FILE, THUNAR_TYPE_FILE); /** @@ -157,9 +157,9 @@ thunar_job_class_init (ThunarJobClass *klass) * @file_list : a list of #ThunarFile<!---->s. * * This signal is used by #ThunarJob<!---->s returned by - * the thunar_io_jobs_list_directory() function whenever - * there's a bunch of #ThunarFile<!---->s ready. This signal - * is garantied to be never emitted with an @file_list + * the thunar_io_jobs_list_directory() function whenever + * there's a bunch of #ThunarFile<!---->s ready. This signal + * is garantied to be never emitted with an @file_list * parameter of %NULL. * * To allow some further optimizations on the handler-side, @@ -225,7 +225,7 @@ thunar_job_finalize (GObject *object) -static ThunarJobResponse +static ThunarJobResponse thunar_job_real_ask (ThunarJob *job, const gchar *message, ThunarJobResponse choices) @@ -239,7 +239,7 @@ thunar_job_real_ask (ThunarJob *job, -static ThunarJobResponse +static ThunarJobResponse thunar_job_real_ask_replace (ThunarJob *job, ThunarFile *source_file, ThunarFile *target_file) @@ -284,13 +284,13 @@ _thunar_job_ask_valist (ThunarJob *job, _thunar_return_val_if_fail (THUNAR_IS_JOB (job), THUNAR_JOB_RESPONSE_CANCEL); _thunar_return_val_if_fail (g_utf8_validate (format, -1, NULL), THUNAR_JOB_RESPONSE_CANCEL); - + /* generate the dialog message */ text = g_strdup_vprintf (format, var_args); - message = (question != NULL) - ? g_strconcat (text, ".\n\n", question, NULL) + message = (question != NULL) + ? g_strconcat (text, ".\n\n", question, NULL) : g_strconcat (text, ".", NULL); - g_free (text); + g_free (text); /* send the question and wait for the answer */ exo_job_emit (EXO_JOB (job), job_signals[ASK], 0, message, choices, &response); @@ -332,7 +332,7 @@ thunar_job_ask_overwrite (ThunarJob *job, va_start (var_args, format); response = _thunar_job_ask_valist (job, format, var_args, _("Do you want to overwrite it?"), - THUNAR_JOB_RESPONSE_YES + THUNAR_JOB_RESPONSE_YES | THUNAR_JOB_RESPONSE_YES_ALL | THUNAR_JOB_RESPONSE_NO | THUNAR_JOB_RESPONSE_NO_ALL @@ -386,7 +386,7 @@ thunar_job_ask_create (ThunarJob *job, va_start (var_args, format); response = _thunar_job_ask_valist (job, format, var_args, _("Do you want to create it?"), - THUNAR_JOB_RESPONSE_YES + THUNAR_JOB_RESPONSE_YES | THUNAR_JOB_RESPONSE_CANCEL); va_end (var_args); @@ -405,7 +405,7 @@ thunar_job_ask_create (ThunarJob *job, -ThunarJobResponse +ThunarJobResponse thunar_job_ask_replace (ThunarJob *job, GFile *source_path, GFile *target_path, @@ -443,7 +443,7 @@ thunar_job_ask_replace (ThunarJob *job, return THUNAR_JOB_RESPONSE_NO; } - exo_job_emit (EXO_JOB (job), job_signals[ASK_REPLACE], 0, + exo_job_emit (EXO_JOB (job), job_signals[ASK_REPLACE], 0, source_file, target_file, &response); g_object_unref (source_file); @@ -465,14 +465,14 @@ thunar_job_ask_replace (ThunarJob *job, -ThunarJobResponse +ThunarJobResponse thunar_job_ask_skip (ThunarJob *job, const gchar *format, ...) { ThunarJobResponse response; va_list var_args; - + _thunar_return_val_if_fail (THUNAR_IS_JOB (job), THUNAR_JOB_RESPONSE_CANCEL); _thunar_return_val_if_fail (format != NULL, THUNAR_JOB_RESPONSE_CANCEL); @@ -488,7 +488,7 @@ thunar_job_ask_skip (ThunarJob *job, va_start (var_args, format); response = _thunar_job_ask_valist (job, format, var_args, _("Do you want to skip it?"), - THUNAR_JOB_RESPONSE_YES + THUNAR_JOB_RESPONSE_YES | THUNAR_JOB_RESPONSE_YES_ALL | THUNAR_JOB_RESPONSE_CANCEL | THUNAR_JOB_RESPONSE_RETRY); diff --git a/thunar/thunar-list-model.c b/thunar/thunar-list-model.c index 9cdd1c3f..58911f53 100644 --- a/thunar/thunar-list-model.c +++ b/thunar/thunar-list-model.c @@ -227,7 +227,7 @@ struct _ThunarListModel gboolean sort_folders_first : 1; gint sort_sign; /* 1 = ascending, -1 descending */ ThunarSortFunc sort_func; - + ThunarListModelVisibleFunc visible_func; gpointer visible_data; }; diff --git a/thunar/thunar-location-button.c b/thunar/thunar-location-button.c index 6c7180b2..6d559d4d 100644 --- a/thunar/thunar-location-button.c +++ b/thunar/thunar-location-button.c @@ -136,7 +136,7 @@ struct _ThunarLocationButton /* the current icon state (i.e. accepting drops) */ ThunarFileIconState file_icon_state; - + /* enter folders using DnD */ guint enter_timeout_id; @@ -267,7 +267,10 @@ thunar_location_button_init (ThunarLocationButton *location_button) button = gtk_toggle_button_new (); gtk_widget_set_can_focus (button, FALSE); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (thunar_location_button_clicked), location_button); - exo_mutual_binding_new (G_OBJECT (location_button), "active", G_OBJECT (button), "active"); + g_object_bind_property (G_OBJECT (location_button), "active", + G_OBJECT (button), "active", + G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE); gtk_container_add (GTK_CONTAINER (location_button), button); gtk_widget_show (button); @@ -440,7 +443,7 @@ thunar_location_button_file_changed (ThunarLocationButton *location_button, icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (location_button))); /* update and show the label widget (hide for the local root folder) */ - if (thunar_file_is_local (file) && thunar_file_is_root (file)) + if (thunar_file_is_local (file) && thunar_file_is_root (file)) { /* hide the alignment in which the label would otherwise show up */ gtk_widget_hide (gtk_widget_get_parent (location_button->label)); diff --git a/thunar/thunar-location-buttons.c b/thunar/thunar-location-buttons.c index 62325e8b..6b3a6692 100644 --- a/thunar/thunar-location-buttons.c +++ b/thunar/thunar-location-buttons.c @@ -1303,9 +1303,9 @@ thunar_location_buttons_action_create_folder (GtkAction *action, return; /* ask the user to enter a name for the new folder */ - name = thunar_show_create_dialog (GTK_WIDGET (buttons), - "inode/directory", - _("New Folder"), + name = thunar_show_create_dialog (GTK_WIDGET (buttons), + "inode/directory", + _("New Folder"), _("Create New Folder")); if (G_LIKELY (name != NULL)) { diff --git a/thunar/thunar-location-dialog.c b/thunar/thunar-location-dialog.c index 19d09b48..71ea55b5 100644 --- a/thunar/thunar-location-dialog.c +++ b/thunar/thunar-location-dialog.c @@ -3,18 +3,18 @@ * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2010 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -35,7 +35,8 @@ G_DEFINE_TYPE (ThunarLocationDialog, thunar_location_dialog, THUNAR_TYPE_ABSTRAC static gboolean -transform_object_to_boolean (const GValue *src_value, +transform_object_to_boolean (GBinding *binding, + const GValue *src_value, GValue *dst_value, gpointer user_data) { @@ -88,16 +89,18 @@ thunar_location_dialog_init (ThunarLocationDialog *location_dialog) gtk_widget_show (location_dialog->entry); /* the "Open" button is only sensitive if a valid file is entered */ - exo_binding_new_full (G_OBJECT (location_dialog->entry), "current-file", - G_OBJECT (open_button), "sensitive", - transform_object_to_boolean, NULL, NULL); + g_object_bind_property_full (G_OBJECT (location_dialog->entry), "current-file", + G_OBJECT (open_button), "sensitive", + G_BINDING_SYNC_CREATE, + transform_object_to_boolean, NULL, + NULL, NULL); } /** * thunar_location_dialog_new: - * + * * Allocates a new #ThunarLocationDialog instance. * * Return value: the newly allocated #ThunarLocationDialog. @@ -143,7 +146,7 @@ thunar_location_dialog_set_selected_file (ThunarLocationDialog *location_dialog, _thunar_return_if_fail (THUNAR_IS_LOCATION_DIALOG (location_dialog)); _thunar_return_if_fail (selected_file == NULL || THUNAR_IS_FILE (selected_file)); - thunar_path_entry_set_current_file (THUNAR_PATH_ENTRY (location_dialog->entry), + thunar_path_entry_set_current_file (THUNAR_PATH_ENTRY (location_dialog->entry), selected_file); } diff --git a/thunar/thunar-location-dialog.h b/thunar/thunar-location-dialog.h index 441e8a0a..6d34c944 100644 --- a/thunar/thunar-location-dialog.h +++ b/thunar/thunar-location-dialog.h @@ -3,18 +3,18 @@ * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2010 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-location-entry.c b/thunar/thunar-location-entry.c index d9f7be49..262a9cff 100644 --- a/thunar/thunar-location-entry.c +++ b/thunar/thunar-location-entry.c @@ -3,18 +3,18 @@ * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2009-2010 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -190,7 +190,9 @@ thunar_location_entry_init (ThunarLocationEntry *location_entry) gtk_box_set_spacing (GTK_BOX (location_entry), 0); location_entry->path_entry = thunar_path_entry_new (); - exo_binding_new (G_OBJECT (location_entry), "current-directory", G_OBJECT (location_entry->path_entry), "current-file"); + g_object_bind_property (G_OBJECT (location_entry), "current-directory", + G_OBJECT (location_entry->path_entry), "current-file", + G_BINDING_SYNC_CREATE); g_signal_connect_after (G_OBJECT (location_entry->path_entry), "activate", G_CALLBACK (thunar_location_entry_activate), location_entry); gtk_box_pack_start (GTK_BOX (location_entry), location_entry->path_entry, TRUE, TRUE, 0); gtk_widget_show (location_entry->path_entry); @@ -261,7 +263,7 @@ thunar_location_entry_set_property (GObject *object, { case PROP_CURRENT_DIRECTORY: thunar_navigator_set_current_directory (THUNAR_NAVIGATOR (object), g_value_get_object (value)); - thunar_path_entry_set_working_directory (THUNAR_PATH_ENTRY (entry->path_entry), + thunar_path_entry_set_working_directory (THUNAR_PATH_ENTRY (entry->path_entry), entry->current_directory); break; @@ -385,7 +387,7 @@ thunar_location_entry_open_or_launch (ThunarLocationEntry *location_entry, /* be sure to reset the current file of the path entry */ if (G_LIKELY (location_entry->current_directory != NULL)) { - thunar_path_entry_set_current_file (THUNAR_PATH_ENTRY (location_entry->path_entry), + thunar_path_entry_set_current_file (THUNAR_PATH_ENTRY (location_entry->path_entry), location_entry->current_directory); } } @@ -398,8 +400,8 @@ thunar_location_entry_open_or_launch (ThunarLocationEntry *location_entry, /* check if we need to display an error dialog */ if (error != NULL) { - thunar_dialogs_show_error (location_entry->path_entry, error, - _("Failed to open \"%s\""), + thunar_dialogs_show_error (location_entry->path_entry, error, + _("Failed to open \"%s\""), thunar_file_get_display_name (file)); g_error_free (error); } @@ -420,14 +422,14 @@ thunar_location_entry_poke_file_finish (ThunarBrowser *browser, if (error == NULL) { /* try to open or launch the target file */ - thunar_location_entry_open_or_launch (THUNAR_LOCATION_ENTRY (browser), + thunar_location_entry_open_or_launch (THUNAR_LOCATION_ENTRY (browser), target_file); } else { /* display an error explaining why we couldn't open/mount the file */ thunar_dialogs_show_error (THUNAR_LOCATION_ENTRY (browser)->path_entry, - error, _("Failed to open \"%s\""), + error, _("Failed to open \"%s\""), thunar_file_get_display_name (file)); } } diff --git a/thunar/thunar-misc-jobs.c b/thunar/thunar-misc-jobs.c index 373e2f59..506ec2cd 100644 --- a/thunar/thunar-misc-jobs.c +++ b/thunar/thunar-misc-jobs.c @@ -70,7 +70,7 @@ _thunar_misc_jobs_load_templates (ThunarJob *job, if (files == NULL || exo_job_is_cancelled (EXO_JOB (job))) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, + g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND, _("No templates installed")); return FALSE; diff --git a/thunar/thunar-navigator.c b/thunar/thunar-navigator.c index ae965a58..64d236ed 100644 --- a/thunar/thunar-navigator.c +++ b/thunar/thunar-navigator.c @@ -67,7 +67,7 @@ thunar_navigator_get_type (void) type = g_type_register_static (G_TYPE_INTERFACE, I_("ThunarNavigator"), &info, 0); g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); - + g_once_init_leave (&type__volatile, type); } diff --git a/thunar/thunar-path-entry.c b/thunar/thunar-path-entry.c index 6a559de6..6ecbd16f 100644 --- a/thunar/thunar-path-entry.c +++ b/thunar/thunar-path-entry.c @@ -3,18 +3,18 @@ * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2009-2010 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * @@ -62,11 +62,11 @@ enum static void thunar_path_entry_editable_init (GtkEditableClass *iface); static void thunar_path_entry_finalize (GObject *object); -static void thunar_path_entry_get_property (GObject *object, +static void thunar_path_entry_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); -static void thunar_path_entry_set_property (GObject *object, +static void thunar_path_entry_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); @@ -303,7 +303,7 @@ thunar_path_entry_finalize (GObject *object) static void -thunar_path_entry_get_property (GObject *object, +thunar_path_entry_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) @@ -325,7 +325,7 @@ thunar_path_entry_get_property (GObject *object, static void -thunar_path_entry_set_property (GObject *object, +thunar_path_entry_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) @@ -829,7 +829,7 @@ thunar_path_entry_common_prefix_lookup (ThunarPathEntry *path_entry, model = gtk_entry_completion_get_model (gtk_entry_get_completion (GTK_ENTRY (path_entry))); if (gtk_tree_model_get_iter_first (model, &iter)) { - do + do { /* determine the real file name for the iter */ gtk_tree_model_get (model, &iter, THUNAR_COLUMN_FILE_NAME, &name, -1); @@ -842,7 +842,7 @@ thunar_path_entry_common_prefix_lookup (ThunarPathEntry *path_entry, { /* remember the prefix */ *prefix_return = g_strdup (name); - + /* determine the file for the iter */ gtk_tree_model_get (model, &iter, THUNAR_COLUMN_FILE, file_return, -1); } @@ -954,7 +954,7 @@ thunar_path_entry_match_selected (GtkEntryCompletion *completion, /* determine the file for the iterator */ gtk_tree_model_get (model, iter, THUNAR_COLUMN_FILE, &file, -1); - + /* determine the real name for the file */ gtk_tree_model_get (model, iter, THUNAR_COLUMN_FILE_NAME, &real_name, -1); @@ -1107,7 +1107,7 @@ thunar_path_entry_check_completion_idle_destroy (gpointer user_data) /** * thunar_path_entry_new: - * + * * Allocates a new #ThunarPathEntry instance. * * Return value: the newly allocated #ThunarPathEntry. diff --git a/thunar/thunar-path-entry.h b/thunar/thunar-path-entry.h index 0baa21a5..41bbb8f0 100644 --- a/thunar/thunar-path-entry.h +++ b/thunar/thunar-path-entry.h @@ -3,18 +3,18 @@ * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2010 Benedikt Meurer <benny@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-permissions-chooser.c b/thunar/thunar-permissions-chooser.c index 027e5617..a0cbf47d 100644 --- a/thunar/thunar-permissions-chooser.c +++ b/thunar/thunar-permissions-chooser.c @@ -244,7 +244,9 @@ thunar_permissions_chooser_init (ThunarPermissionsChooser *chooser) gtk_label_set_mnemonic_widget (GTK_LABEL (label), chooser->access_combos[2]); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (chooser->access_combos[2]), renderer_text, TRUE); gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (chooser->access_combos[2]), renderer_text, "text", 0); - exo_binding_new (G_OBJECT (chooser), "mutable", G_OBJECT (chooser->access_combos[2]), "sensitive"); + g_object_bind_property (G_OBJECT (chooser), "mutable", + G_OBJECT (chooser->access_combos[2]), "sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped (G_OBJECT (chooser->access_combos[2]), "changed", G_CALLBACK (thunar_permissions_chooser_access_changed), chooser); gtk_table_attach (GTK_TABLE (chooser->table), chooser->access_combos[2], 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), chooser->access_combos[2]); @@ -269,7 +271,9 @@ thunar_permissions_chooser_init (ThunarPermissionsChooser *chooser) gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (chooser->group_combo), renderer_text, TRUE); gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (chooser->group_combo), renderer_text, "text", THUNAR_PERMISSIONS_STORE_COLUMN_NAME); gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (chooser->group_combo), thunar_permissions_chooser_row_separator, NULL, NULL); - exo_binding_new (G_OBJECT (chooser), "mutable", G_OBJECT (chooser->group_combo), "sensitive"); + g_object_bind_property (G_OBJECT (chooser), "mutable", + G_OBJECT (chooser->group_combo), "sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped (G_OBJECT (chooser->group_combo), "changed", G_CALLBACK (thunar_permissions_chooser_group_changed), chooser); gtk_table_attach (GTK_TABLE (chooser->table), chooser->group_combo, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), chooser->group_combo); @@ -287,7 +291,9 @@ thunar_permissions_chooser_init (ThunarPermissionsChooser *chooser) gtk_label_set_mnemonic_widget (GTK_LABEL (label), chooser->access_combos[1]); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (chooser->access_combos[1]), renderer_text, TRUE); gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (chooser->access_combos[1]), renderer_text, "text", 0); - exo_binding_new (G_OBJECT (chooser), "mutable", G_OBJECT (chooser->access_combos[1]), "sensitive"); + g_object_bind_property (G_OBJECT (chooser), "mutable", + G_OBJECT (chooser->access_combos[1]), "sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped (G_OBJECT (chooser->access_combos[1]), "changed", G_CALLBACK (thunar_permissions_chooser_access_changed), chooser); gtk_table_attach (GTK_TABLE (chooser->table), chooser->access_combos[1], 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), chooser->access_combos[1]); @@ -311,7 +317,9 @@ thunar_permissions_chooser_init (ThunarPermissionsChooser *chooser) gtk_label_set_mnemonic_widget (GTK_LABEL (label), chooser->access_combos[0]); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (chooser->access_combos[0]), renderer_text, TRUE); gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (chooser->access_combos[0]), renderer_text, "text", 0); - exo_binding_new (G_OBJECT (chooser), "mutable", G_OBJECT (chooser->access_combos[0]), "sensitive"); + g_object_bind_property (G_OBJECT (chooser), "mutable", + G_OBJECT (chooser->access_combos[0]), "sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped (G_OBJECT (chooser->access_combos[0]), "changed", G_CALLBACK (thunar_permissions_chooser_access_changed), chooser); gtk_table_attach (GTK_TABLE (chooser->table), chooser->access_combos[0], 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), chooser->access_combos[0]); @@ -332,8 +340,12 @@ thunar_permissions_chooser_init (ThunarPermissionsChooser *chooser) gtk_widget_show (label); chooser->program_button = gtk_check_button_new_with_mnemonic (_("Allow this file to _run as a program")); - exo_binding_new (G_OBJECT (chooser->program_button), "visible", G_OBJECT (label), "visible"); - exo_binding_new (G_OBJECT (chooser), "mutable", G_OBJECT (chooser->program_button), "sensitive"); + g_object_bind_property (G_OBJECT (chooser->program_button), "visible", + G_OBJECT (label), "visible", + G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (chooser), "mutable", + G_OBJECT (chooser->program_button), "sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped (G_OBJECT (chooser->program_button), "toggled", G_CALLBACK (thunar_permissions_chooser_program_toggled), chooser); gtk_table_attach (GTK_TABLE (chooser->table), chooser->program_button, 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), chooser->program_button); @@ -342,8 +354,12 @@ thunar_permissions_chooser_init (ThunarPermissionsChooser *chooser) row += 1; hbox = gtk_hbox_new (FALSE, 6); - exo_binding_new (G_OBJECT (chooser), "mutable", G_OBJECT (hbox), "sensitive"); - exo_binding_new (G_OBJECT (chooser->program_button), "visible", G_OBJECT (hbox), "visible"); + g_object_bind_property (G_OBJECT (chooser), "mutable", + G_OBJECT (hbox), "sensitive", + G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (chooser->program_button), "visible", + G_OBJECT (hbox), "visible", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (chooser->table), hbox, 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (hbox); @@ -358,7 +374,9 @@ thunar_permissions_chooser_init (ThunarPermissionsChooser *chooser) gtk_widget_show (label); hbox = gtk_hbox_new (FALSE, 6); - exo_binding_new (G_OBJECT (chooser), "mutable", G_OBJECT (hbox), "sensitive"); + g_object_bind_property (G_OBJECT (chooser), "mutable", + G_OBJECT (hbox), "sensitive", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (chooser->table), hbox, 1, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (hbox); @@ -369,7 +387,9 @@ thunar_permissions_chooser_init (ThunarPermissionsChooser *chooser) chooser->fixperm_label = gtk_label_new (_("The folder permissions are inconsistent, you\nmay not be able to work with files in this folder.")); gtk_misc_set_alignment (GTK_MISC (chooser->fixperm_label), 0.0f, 0.5f); gtk_label_set_attributes (GTK_LABEL (chooser->fixperm_label), thunar_pango_attr_list_small_italic ()); - exo_binding_new (G_OBJECT (chooser->fixperm_label), "visible", G_OBJECT (hbox), "visible"); + g_object_bind_property (G_OBJECT (chooser->fixperm_label), "visible", + G_OBJECT (hbox), "visible", + G_BINDING_SYNC_CREATE); gtk_box_pack_start (GTK_BOX (hbox), chooser->fixperm_label, TRUE, TRUE, 0); gtk_widget_show (chooser->fixperm_label); @@ -382,7 +402,9 @@ thunar_permissions_chooser_init (ThunarPermissionsChooser *chooser) chooser->fixperm_button = gtk_button_new_with_mnemonic (_("Correct _folder permissions...")); gtk_widget_set_tooltip_text (chooser->fixperm_button, _("Click here to automatically fix the folder permissions.")); g_signal_connect_swapped (G_OBJECT (chooser->fixperm_button), "clicked", G_CALLBACK (thunar_permissions_chooser_fixperm_clicked), chooser); - exo_binding_new (G_OBJECT (chooser->fixperm_button), "visible", G_OBJECT (hbox), "visible"); + g_object_bind_property (G_OBJECT (chooser->fixperm_button), "visible", + G_OBJECT (hbox), "visible", + G_BINDING_SYNC_CREATE); gtk_box_pack_end (GTK_BOX (hbox), chooser->fixperm_button, FALSE, FALSE, 0); gtk_widget_show (chooser->fixperm_button); @@ -392,7 +414,9 @@ thunar_permissions_chooser_init (ThunarPermissionsChooser *chooser) chooser->job_progress = gtk_progress_bar_new (); gtk_progress_bar_set_text (GTK_PROGRESS_BAR (chooser->job_progress), _("Please wait...")); - exo_binding_new (G_OBJECT (chooser->job_progress), "visible", G_OBJECT (hbox), "visible"); + g_object_bind_property (G_OBJECT (chooser->job_progress), "visible", + G_OBJECT (hbox), "visible", + G_BINDING_SYNC_CREATE); gtk_box_pack_start (GTK_BOX (hbox), chooser->job_progress, TRUE, TRUE, 0); button = gtk_button_new (); diff --git a/thunar/thunar-preferences-dialog.c b/thunar/thunar-preferences-dialog.c index 162b9029..92eea803 100644 --- a/thunar/thunar-preferences-dialog.c +++ b/thunar/thunar-preferences-dialog.c @@ -62,7 +62,8 @@ G_DEFINE_TYPE (ThunarPreferencesDialog, thunar_preferences_dialog, XFCE_TYPE_TIT static gboolean -transform_icon_size_to_index (const GValue *src_value, +transform_icon_size_to_index (GBinding *binding, + const GValue *src_value, GValue *dst_value, gpointer user_data) { @@ -81,7 +82,8 @@ transform_icon_size_to_index (const GValue *src_value, static gboolean -transform_index_to_icon_size (const GValue *src_value, +transform_index_to_icon_size (GBinding *binding, + const GValue *src_value, GValue *dst_value, gpointer user_data) { @@ -97,7 +99,8 @@ transform_index_to_icon_size (const GValue *src_value, static gboolean -transform_view_string_to_index (const GValue *src_value, +transform_view_string_to_index (GBinding *binding, + const GValue *src_value, GValue *dst_value, gpointer user_data) { @@ -119,7 +122,8 @@ transform_view_string_to_index (const GValue *src_value, static gboolean -transform_view_index_to_string (const GValue *src_value, +transform_view_index_to_string (GBinding *binding, + const GValue *src_value, GValue *dst_value, gpointer user_data) { @@ -148,7 +152,8 @@ transform_view_index_to_string (const GValue *src_value, static gboolean -transform_thumbnail_mode_to_index (const GValue *src_value, +transform_thumbnail_mode_to_index (GBinding *binding, + const GValue *src_value, GValue *dst_value, gpointer user_data) { @@ -167,7 +172,8 @@ transform_thumbnail_mode_to_index (const GValue *src_value, static gboolean -transform_thumbnail_index_to_mode (const GValue *src_value, +transform_thumbnail_index_to_mode (GBinding *binding, + const GValue *src_value, GValue *dst_value, gpointer user_data) { @@ -271,8 +277,12 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Detailed List View")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Compact List View")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Last Active View")); - exo_mutual_binding_new_full (G_OBJECT (dialog->preferences), "default-view", G_OBJECT (combo), "active", - transform_view_string_to_index, transform_view_index_to_string, NULL, NULL); + g_object_bind_property_full (G_OBJECT (dialog->preferences), "default-view", + G_OBJECT (combo), "active", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, + transform_view_string_to_index, + transform_view_index_to_string, + NULL, NULL); gtk_table_attach (GTK_TABLE (table), combo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), combo); gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo); @@ -287,15 +297,22 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Never")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Local Files Only")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Always")); - exo_mutual_binding_new_full (G_OBJECT (dialog->preferences), "misc-thumbnail-mode", G_OBJECT (combo), "active", - transform_thumbnail_mode_to_index, transform_thumbnail_index_to_mode, NULL, NULL); + g_object_bind_property_full (G_OBJECT (dialog->preferences), "misc-thumbnail-mode", + G_OBJECT (combo), "active", + G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, + transform_thumbnail_mode_to_index, + transform_thumbnail_index_to_mode, + NULL, NULL); gtk_table_attach (GTK_TABLE (table), combo, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), combo); gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo); gtk_widget_show (combo); button = gtk_check_button_new_with_mnemonic (_("Sort _folders before files")); - exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-folders-first", G_OBJECT (button), "active"); + g_object_bind_property (G_OBJECT (dialog->preferences), "misc-folders-first", + G_OBJECT (button), "active", + G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE); gtk_widget_set_tooltip_text (button, _("Select this option to list folders before files when you sort a folder.")); gtk_table_attach (GTK_TABLE (table), button, 0, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (button); @@ -317,7 +334,10 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_widget_show (table); button = gtk_check_button_new_with_mnemonic (_("_Text beside icons")); - exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-text-beside-icons", G_OBJECT (button), "active"); + g_object_bind_property (G_OBJECT (dialog->preferences), "misc-text-beside-icons", + G_OBJECT (button), "active", + G_BINDING_SYNC_CREATE + | G_BINDING_BIDIRECTIONAL); gtk_widget_set_tooltip_text (button, _("Select this option to place the icon captions for items " "beside the icon rather than below the icon.")); gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); @@ -350,7 +370,10 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), date); g_free (date); } - exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-date-style", G_OBJECT (combo), "active"); + g_object_bind_property (G_OBJECT (dialog->preferences), "misc-date-style", + G_OBJECT (combo), "active", + G_BINDING_SYNC_CREATE + | G_BINDING_BIDIRECTIONAL); gtk_table_attach (GTK_TABLE (table), combo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), combo); gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo); @@ -394,15 +417,22 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Large")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Larger")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Very Large")); - exo_mutual_binding_new_full (G_OBJECT (dialog->preferences), "shortcuts-icon-size", G_OBJECT (combo), "active", - transform_icon_size_to_index, transform_index_to_icon_size, NULL, NULL); + g_object_bind_property_full (G_OBJECT (dialog->preferences), "shortcuts-icon-size", + G_OBJECT (combo), "active", + G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, + transform_icon_size_to_index, + transform_index_to_icon_size, + NULL, NULL); gtk_table_attach (GTK_TABLE (table), combo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), combo); gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo); gtk_widget_show (combo); button = gtk_check_button_new_with_mnemonic (_("Show Icon _Emblems")); - exo_mutual_binding_new (G_OBJECT (dialog->preferences), "shortcuts-icon-emblems", G_OBJECT (button), "active"); + g_object_bind_property (G_OBJECT (dialog->preferences), "shortcuts-icon-emblems", + G_OBJECT (button), "active", + G_BINDING_SYNC_CREATE + | G_BINDING_BIDIRECTIONAL); gtk_widget_set_tooltip_text (button, _("Select this option to display icon emblems in the shortcuts pane for all folders " "for which emblems have been defined in the folders properties dialog.")); gtk_table_attach (GTK_TABLE (table), button, 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); @@ -436,15 +466,22 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Large")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Larger")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Very Large")); - exo_mutual_binding_new_full (G_OBJECT (dialog->preferences), "tree-icon-size", G_OBJECT (combo), "active", - transform_icon_size_to_index, transform_index_to_icon_size, NULL, NULL); + g_object_bind_property_full (G_OBJECT (dialog->preferences), "tree-icon-size", + G_OBJECT (combo), "active", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, + transform_icon_size_to_index, + transform_index_to_icon_size, + NULL, NULL); gtk_table_attach (GTK_TABLE (table), combo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), combo); gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo); gtk_widget_show (combo); button = gtk_check_button_new_with_mnemonic (_("Show Icon E_mblems")); - exo_mutual_binding_new (G_OBJECT (dialog->preferences), "tree-icon-emblems", G_OBJECT (button), "active"); + g_object_bind_property (G_OBJECT (dialog->preferences), "tree-icon-emblems", + G_OBJECT (button), "active", + G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE); gtk_widget_set_tooltip_text (button, _("Select this option to display icon emblems in the tree pane for all folders " "for which emblems have been defined in the folders properties dialog.")); gtk_table_attach (GTK_TABLE (table), button, 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); @@ -477,14 +514,19 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_widget_show (table); button = gtk_radio_button_new_with_mnemonic (NULL, _("_Single click to activate items")); - exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-single-click", G_OBJECT (button), "active"); + g_object_bind_property (G_OBJECT (dialog->preferences), "misc-single-click", + G_OBJECT (button), "active", + G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE); g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (g_object_notify), "active"); gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_widget_show (button); align = gtk_alignment_new (0.0f, 0.0f, 1.0f, 1.0f); gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 6, 18, 0); - exo_binding_new (G_OBJECT (button), "active", G_OBJECT (align), "sensitive"); + g_object_bind_property (G_OBJECT (button), "active", + G_OBJECT (align), "sensitive", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), align, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_widget_show (align); @@ -520,7 +562,10 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) /* connect the range's adjustment to the preferences */ adjustment = gtk_range_get_adjustment (GTK_RANGE (range)); - exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-single-click-timeout", G_OBJECT (adjustment), "value"); + g_object_bind_property (G_OBJECT (dialog->preferences), "misc-single-click-timeout", + G_OBJECT (adjustment), "value", + G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE); hbox = gtk_hbox_new (TRUE, 6); gtk_box_pack_start (GTK_BOX (ibox), hbox, FALSE, FALSE, 0); @@ -545,7 +590,11 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_widget_show (label); button = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (button), _("_Double click to activate items")); - exo_mutual_binding_new_with_negation (G_OBJECT (dialog->preferences), "misc-single-click", G_OBJECT (button), "active"); + g_object_bind_property (G_OBJECT (dialog->preferences), "misc-single-click", + G_OBJECT (button), "active", + G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE + | G_BINDING_INVERT_BOOLEAN); g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (g_object_notify), "active"); gtk_table_attach (GTK_TABLE (table), button, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_widget_show (button); @@ -570,7 +619,10 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_widget_show (button); button = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (button), _("Open folder in new _tab")); - exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-middle-click-in-tab", G_OBJECT (button), "active"); + g_object_bind_property (G_OBJECT (dialog->preferences), "misc-middle-click-in-tab", + G_OBJECT (button), "active", + G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE); g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (g_object_notify), "active"); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, TRUE, 0); gtk_widget_show (button); @@ -611,7 +663,10 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Ask everytime")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Apply to Folder Only")); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Apply to Folder and Contents")); - exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-recursive-permissions", G_OBJECT (combo), "active"); + g_object_bind_property (G_OBJECT (dialog->preferences), "misc-recursive-permissions", + G_OBJECT (combo), "active", + G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), combo, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), combo); gtk_widget_show (combo); @@ -637,13 +692,18 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) /* add check button to enable/disable auto mounting */ button = gtk_check_button_new_with_mnemonic (_("Enable _Volume Management")); - exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-volume-management", G_OBJECT (button), "active"); + g_object_bind_property (G_OBJECT (dialog->preferences), "misc-volume-management", + G_OBJECT (button), "active", + G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (button); label = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.5f); - exo_binding_new (G_OBJECT (button), "active", G_OBJECT (label), "sensitive"); + g_object_bind_property (G_OBJECT (button), "active", + G_OBJECT (label), "sensitive", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped (G_OBJECT (label), "activate-link", G_CALLBACK (thunar_preferences_dialog_configure), dialog); gtk_label_set_markup (GTK_LABEL (label), _("<a href=\"volman-config:\">Configure</a> the management of removable drives\n" "and media (i.e. how cameras should be handled).")); diff --git a/thunar/thunar-progress-dialog.c b/thunar/thunar-progress-dialog.c index 1fe2cfa6..fce6f98d 100644 --- a/thunar/thunar-progress-dialog.c +++ b/thunar/thunar-progress-dialog.c @@ -2,18 +2,18 @@ /*- * Copyright (c) 2009-2010 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -38,7 +38,7 @@ static void thunar_progress_dialog_dispose (GObject static void thunar_progress_dialog_finalize (GObject *object); static void thunar_progress_dialog_shown (ThunarProgressDialog *dialog); static gboolean thunar_progress_dialog_closed (ThunarProgressDialog *dialog); -static gboolean thunar_progress_dialog_toggled (ThunarProgressDialog *dialog, +static gboolean thunar_progress_dialog_toggled (ThunarProgressDialog *dialog, GdkEventButton *button, GtkStatusIcon *status_icon); static void thunar_progress_dialog_update_status_icon (ThunarProgressDialog *dialog); @@ -98,10 +98,10 @@ thunar_progress_dialog_init (ThunarProgressDialog *dialog) gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), FALSE); gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_NORMAL); - g_signal_connect_swapped (dialog, "show", + g_signal_connect_swapped (dialog, "show", G_CALLBACK (thunar_progress_dialog_shown), dialog); - g_signal_connect (dialog, "delete-event", + g_signal_connect (dialog, "delete-event", G_CALLBACK (thunar_progress_dialog_closed), dialog); dialog->vbox = gtk_vbox_new (FALSE, 0); @@ -188,7 +188,7 @@ thunar_progress_dialog_toggled (ThunarProgressDialog *dialog, _thunar_return_val_if_fail (GTK_IS_STATUS_ICON (status_icon), FALSE); /* check if the window is visible and has the focus */ - if (gtk_widget_get_visible (GTK_WIDGET (dialog)) + if (gtk_widget_get_visible (GTK_WIDGET (dialog)) && gtk_window_is_active (GTK_WINDOW (dialog))) { /* remember the position of the dialog */ @@ -259,7 +259,7 @@ thunar_progress_dialog_job_finished (ThunarProgressDialog *dialog, gtk_widget_destroy (dialog->scrollwin); } - /* check if we have less than SCROLLVIEW_THRESHOLD views + /* check if we have less than SCROLLVIEW_THRESHOLD views * and need to shrink the window */ if (n_views < SCROLLVIEW_THRESHOLD) { @@ -296,9 +296,9 @@ thunar_progress_dialog_update_status_icon (ThunarProgressDialog *dialog) n_views = g_list_length (dialog->views); /* build the tooltip text */ - tooltip_text = g_strdup_printf (ngettext ("%d file operation running", + tooltip_text = g_strdup_printf (ngettext ("%d file operation running", "%d file operations running", - n_views), + n_views), n_views); /* update the tooltip */ @@ -347,13 +347,13 @@ thunar_progress_dialog_add_job (ThunarProgressDialog *dialog, /* add the view to the list of known views */ dialog->views = g_list_prepend (dialog->views, view); - /* check if we need to wrap the views in a scroll window (starting + /* check if we need to wrap the views in a scroll window (starting * at SCROLLVIEW_THRESHOLD parallel operations */ if (g_list_length (dialog->views) == SCROLLVIEW_THRESHOLD) { /* create a scrolled window and add it to the dialog */ dialog->scrollwin = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (dialog->scrollwin), + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (dialog->scrollwin), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (dialog->vbox), dialog->scrollwin); gtk_widget_show (dialog->scrollwin); @@ -369,7 +369,7 @@ thunar_progress_dialog_add_job (ThunarProgressDialog *dialog, gtk_widget_reparent (dialog->content_box, viewport); } - g_signal_connect_swapped (view, "need-attention", + g_signal_connect_swapped (view, "need-attention", G_CALLBACK (thunar_progress_dialog_view_needs_attention), dialog); g_signal_connect_swapped (view, "finished", diff --git a/thunar/thunar-progress-dialog.h b/thunar/thunar-progress-dialog.h index 335fa622..04e148de 100644 --- a/thunar/thunar-progress-dialog.h +++ b/thunar/thunar-progress-dialog.h @@ -2,18 +2,18 @@ /*- * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-progress-view.c b/thunar/thunar-progress-view.c index c66a9c69..8fed70cf 100644 --- a/thunar/thunar-progress-view.c +++ b/thunar/thunar-progress-view.c @@ -189,7 +189,9 @@ thunar_progress_view_init (ThunarProgressView *view) image = g_object_new (GTK_TYPE_IMAGE, "icon-size", GTK_ICON_SIZE_BUTTON, NULL); gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, TRUE, 0); - exo_binding_new (G_OBJECT (view), "icon-name", G_OBJECT (image), "icon-name"); + g_object_bind_property (G_OBJECT (view), "icon-name", + G_OBJECT (image), "icon-name", + G_BINDING_SYNC_CREATE); gtk_widget_show (image); vbox2 = gtk_vbox_new (FALSE, 6); @@ -236,7 +238,9 @@ thunar_progress_view_init (ThunarProgressView *view) gtk_widget_show (image); /* connect the view title to the action label */ - exo_binding_new (G_OBJECT (view), "title", G_OBJECT (label), "label"); + g_object_bind_property (G_OBJECT (view), "title", + G_OBJECT (label), "label", + G_BINDING_SYNC_CREATE); } diff --git a/thunar/thunar-properties-dialog.c b/thunar/thunar-properties-dialog.c index f5e5483d..e7a7f072 100644 --- a/thunar/thunar-properties-dialog.c +++ b/thunar/thunar-properties-dialog.c @@ -272,7 +272,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) g_signal_connect (G_OBJECT (dialog->name_entry), "activate", G_CALLBACK (thunar_properties_dialog_name_activate), dialog); g_signal_connect (G_OBJECT (dialog->name_entry), "focus-out-event", G_CALLBACK (thunar_properties_dialog_name_focus_out_event), dialog); gtk_table_attach (GTK_TABLE (table), dialog->name_entry, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); - exo_binding_new (G_OBJECT (dialog->single_box), "visible", G_OBJECT (dialog->name_entry), "visible"); + g_object_bind_property (G_OBJECT (dialog->single_box), "visible", + G_OBJECT (dialog->name_entry), "visible", + G_BINDING_SYNC_CREATE); ++row; @@ -282,7 +284,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) */ box = gtk_hbox_new (FALSE, 6); gtk_table_attach (GTK_TABLE (table), box, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 3); - exo_binding_new_with_negation (G_OBJECT (dialog->single_box), "visible", G_OBJECT (box), "visible"); + g_object_bind_property (G_OBJECT (dialog->single_box), + "visible", G_OBJECT (box), "visible", + G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN); image = gtk_image_new_from_icon_name ("text-x-generic", GTK_ICON_SIZE_DIALOG); gtk_box_pack_start (GTK_BOX (box), image, FALSE, TRUE, 0); @@ -299,7 +303,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) gtk_table_attach (GTK_TABLE (table), dialog->names_label, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_label_set_ellipsize (GTK_LABEL (dialog->names_label), PANGO_ELLIPSIZE_END); gtk_label_set_selectable (GTK_LABEL (dialog->names_label), TRUE); - exo_binding_new (G_OBJECT (box), "visible", G_OBJECT (dialog->names_label), "visible"); + g_object_bind_property (G_OBJECT (box), "visible", + G_OBJECT (dialog->names_label), "visible", + G_BINDING_SYNC_CREATE); ++row; @@ -317,7 +323,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) dialog->kind_ebox = gtk_event_box_new (); gtk_event_box_set_above_child (GTK_EVENT_BOX (dialog->kind_ebox), TRUE); gtk_event_box_set_visible_window (GTK_EVENT_BOX (dialog->kind_ebox), FALSE); - exo_binding_new (G_OBJECT (dialog->kind_ebox), "visible", G_OBJECT (label), "visible"); + g_object_bind_property (G_OBJECT (dialog->kind_ebox), "visible", + G_OBJECT (label), "visible", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), dialog->kind_ebox, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_widget_show (dialog->kind_ebox); @@ -337,7 +345,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) dialog->openwith_chooser = thunar_chooser_button_new (); gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->openwith_chooser); - exo_binding_new (G_OBJECT (dialog->openwith_chooser), "visible", G_OBJECT (label), "visible"); + g_object_bind_property (G_OBJECT (dialog->openwith_chooser), "visible", + G_OBJECT (label), "visible", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), dialog->openwith_chooser, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_widget_show (dialog->openwith_chooser); @@ -351,7 +361,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) dialog->link_label = g_object_new (GTK_TYPE_LABEL, "ellipsize", PANGO_ELLIPSIZE_START, "xalign", 0.0f, NULL); gtk_label_set_selectable (GTK_LABEL (dialog->link_label), TRUE); - exo_binding_new (G_OBJECT (dialog->link_label), "visible", G_OBJECT (label), "visible"); + g_object_bind_property (G_OBJECT (dialog->link_label), "visible", + G_OBJECT (label), "visible", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), dialog->link_label, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_widget_show (dialog->link_label); @@ -369,7 +381,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) dialog->origin_label = g_object_new (GTK_TYPE_LABEL, "ellipsize", PANGO_ELLIPSIZE_START, "xalign", 0.0f, NULL); gtk_label_set_selectable (GTK_LABEL (dialog->origin_label), TRUE); - exo_binding_new (G_OBJECT (dialog->origin_label), "visible", G_OBJECT (label), "visible"); + g_object_bind_property (G_OBJECT (dialog->origin_label), "visible", + G_OBJECT (label), "visible", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), dialog->origin_label, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_widget_show (dialog->origin_label); @@ -383,7 +397,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) dialog->location_label = g_object_new (GTK_TYPE_LABEL, "ellipsize", PANGO_ELLIPSIZE_START, "xalign", 0.0f, NULL); gtk_label_set_selectable (GTK_LABEL (dialog->location_label), TRUE); - exo_binding_new (G_OBJECT (dialog->location_label), "visible", G_OBJECT (label), "visible"); + g_object_bind_property (G_OBJECT (dialog->location_label), "visible", + G_OBJECT (label), "visible", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), dialog->location_label, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_widget_show (dialog->location_label); @@ -408,7 +424,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) dialog->deleted_label = g_object_new (GTK_TYPE_LABEL, "xalign", 0.0f, NULL); gtk_label_set_selectable (GTK_LABEL (dialog->deleted_label), TRUE); - exo_binding_new (G_OBJECT (dialog->deleted_label), "visible", G_OBJECT (label), "visible"); + g_object_bind_property (G_OBJECT (dialog->deleted_label), "visible", + G_OBJECT (label), "visible", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), dialog->deleted_label, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_widget_show (dialog->deleted_label); @@ -422,7 +440,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) dialog->modified_label = g_object_new (GTK_TYPE_LABEL, "xalign", 0.0f, NULL); gtk_label_set_selectable (GTK_LABEL (dialog->modified_label), TRUE); - exo_binding_new (G_OBJECT (dialog->modified_label), "visible", G_OBJECT (label), "visible"); + g_object_bind_property (G_OBJECT (dialog->modified_label), "visible", + G_OBJECT (label), "visible", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), dialog->modified_label, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_widget_show (dialog->modified_label); @@ -436,7 +456,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) dialog->accessed_label = g_object_new (GTK_TYPE_LABEL, "xalign", 0.0f, NULL); gtk_label_set_selectable (GTK_LABEL (dialog->accessed_label), TRUE); - exo_binding_new (G_OBJECT (dialog->accessed_label), "visible", G_OBJECT (label), "visible"); + g_object_bind_property (G_OBJECT (dialog->accessed_label), "visible", + G_OBJECT (label), "visible", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), dialog->accessed_label, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_widget_show (dialog->accessed_label); @@ -445,7 +467,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) spacer = g_object_new (GTK_TYPE_ALIGNMENT, "height-request", 12, NULL); gtk_table_attach (GTK_TABLE (table), spacer, 0, 2, row, row + 1, GTK_FILL, GTK_FILL, 0, 3); - exo_binding_new (G_OBJECT (dialog->accessed_label), "visible", G_OBJECT (spacer), "visible"); + g_object_bind_property (G_OBJECT (dialog->accessed_label), "visible", + G_OBJECT (spacer), "visible", + G_BINDING_SYNC_CREATE); ++row; @@ -460,7 +484,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) gtk_widget_show (label); label = thunar_size_label_new (); - exo_binding_new (G_OBJECT (dialog), "files", G_OBJECT (label), "files"); + g_object_bind_property (G_OBJECT (dialog), "files", + G_OBJECT (label), "files", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), label, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_widget_show (label); @@ -473,18 +499,24 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) gtk_widget_show (label); box = gtk_hbox_new (FALSE, 6); - exo_binding_new (G_OBJECT (box), "visible", G_OBJECT (label), "visible"); + g_object_bind_property (G_OBJECT (box), "visible", + G_OBJECT (label), "visible", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), box, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_widget_show (box); dialog->volume_image = gtk_image_new (); - exo_binding_new (G_OBJECT (dialog->volume_image), "visible", G_OBJECT (box), "visible"); + g_object_bind_property (G_OBJECT (dialog->volume_image), "visible", + G_OBJECT (box), "visible", + G_BINDING_SYNC_CREATE); gtk_box_pack_start (GTK_BOX (box), dialog->volume_image, FALSE, TRUE, 0); gtk_widget_show (dialog->volume_image); dialog->volume_label = g_object_new (GTK_TYPE_LABEL, "xalign", 0.0f, NULL); gtk_label_set_selectable (GTK_LABEL (dialog->volume_label), TRUE); - exo_binding_new (G_OBJECT (dialog->volume_label), "visible", G_OBJECT (dialog->volume_image), "visible"); + g_object_bind_property (G_OBJECT (dialog->volume_label), "visible", + G_OBJECT (dialog->volume_image), "visible", + G_BINDING_SYNC_CREATE); gtk_box_pack_start (GTK_BOX (box), dialog->volume_label, TRUE, TRUE, 0); gtk_widget_show (dialog->volume_label); @@ -498,7 +530,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) dialog->freespace_label = g_object_new (GTK_TYPE_LABEL, "xalign", 0.0f, NULL); gtk_label_set_selectable (GTK_LABEL (dialog->freespace_label), TRUE); - exo_binding_new (G_OBJECT (dialog->freespace_label), "visible", G_OBJECT (label), "visible"); + g_object_bind_property (G_OBJECT (dialog->freespace_label), "visible", + G_OBJECT (label), "visible", + G_BINDING_SYNC_CREATE); gtk_table_attach (GTK_TABLE (table), dialog->freespace_label, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3); gtk_widget_show (dialog->freespace_label); @@ -517,7 +551,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) */ label = gtk_label_new (_("Emblems")); chooser = thunar_emblem_chooser_new (); - exo_binding_new (G_OBJECT (dialog), "files", G_OBJECT (chooser), "files"); + g_object_bind_property (G_OBJECT (dialog), "files", + G_OBJECT (chooser), "files", + G_BINDING_SYNC_CREATE); gtk_notebook_append_page (GTK_NOTEBOOK (dialog->notebook), chooser, label); gtk_widget_show (chooser); gtk_widget_show (label); @@ -527,7 +563,9 @@ thunar_properties_dialog_init (ThunarPropertiesDialog *dialog) */ label = gtk_label_new (_("Permissions")); dialog->permissions_chooser = thunar_permissions_chooser_new (); - exo_binding_new (G_OBJECT (dialog), "files", G_OBJECT (dialog->permissions_chooser), "files"); + g_object_bind_property (G_OBJECT (dialog), "files", + G_OBJECT (dialog->permissions_chooser), "files", + G_BINDING_SYNC_CREATE); gtk_notebook_append_page (GTK_NOTEBOOK (dialog->notebook), dialog->permissions_chooser, label); gtk_widget_show (dialog->permissions_chooser); gtk_widget_show (label); diff --git a/thunar/thunar-properties-dialog.h b/thunar/thunar-properties-dialog.h index 1a88ede0..43d37ca9 100644 --- a/thunar/thunar-properties-dialog.h +++ b/thunar/thunar-properties-dialog.h @@ -38,10 +38,10 @@ GType thunar_properties_dialog_get_type (void) G_GNUC_CONST; GtkWidget *thunar_properties_dialog_new (GtkWindow *parent); -void thunar_properties_dialog_set_files (ThunarPropertiesDialog *dialog, +void thunar_properties_dialog_set_files (ThunarPropertiesDialog *dialog, GList *files); -void thunar_properties_dialog_set_file (ThunarPropertiesDialog *dialog, +void thunar_properties_dialog_set_file (ThunarPropertiesDialog *dialog, ThunarFile *file); G_END_DECLS; diff --git a/thunar/thunar-renamer-dialog.c b/thunar/thunar-renamer-dialog.c index cb1d9110..54ea49c9 100644 --- a/thunar/thunar-renamer-dialog.c +++ b/thunar/thunar-renamer-dialog.c @@ -358,7 +358,9 @@ thunar_renamer_dialog_init (ThunarRenamerDialog *renamer_dialog) /* add the "Rename Files" button */ button = gtk_dialog_add_button (GTK_DIALOG (renamer_dialog), _("_Rename Files"), GTK_RESPONSE_ACCEPT); - exo_binding_new (G_OBJECT (renamer_dialog->model), "can-rename", G_OBJECT (button), "sensitive"); + g_object_bind_property (G_OBJECT (renamer_dialog->model), "can-rename", + G_OBJECT (button), "sensitive", + G_BINDING_SYNC_CREATE); gtk_dialog_set_default_response (GTK_DIALOG (renamer_dialog), GTK_RESPONSE_ACCEPT); gtk_widget_set_tooltip_text (button, _("Click here to actually rename the files listed above to their new names.")); @@ -380,11 +382,15 @@ thunar_renamer_dialog_init (ThunarRenamerDialog *renamer_dialog) renamer_dialog->launcher = thunar_launcher_new (); thunar_launcher_set_widget (renamer_dialog->launcher, GTK_WIDGET (renamer_dialog)); thunar_component_set_ui_manager (THUNAR_COMPONENT (renamer_dialog->launcher), renamer_dialog->ui_manager); - exo_binding_new (G_OBJECT (renamer_dialog), "selected-files", G_OBJECT (renamer_dialog->launcher), "selected-files"); + g_object_bind_property (G_OBJECT (renamer_dialog), "selected-files", + G_OBJECT (renamer_dialog->launcher), "selected-files", + G_BINDING_SYNC_CREATE); /* add the toolbar to the dialog */ toolbar = gtk_ui_manager_get_widget (renamer_dialog->ui_manager, "/toolbar"); - exo_binding_new (G_OBJECT (renamer_dialog), "standalone", G_OBJECT (toolbar), "visible"); + g_object_bind_property (G_OBJECT (renamer_dialog), "standalone", + G_OBJECT (toolbar), "visible", + G_BINDING_SYNC_CREATE); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (renamer_dialog)->vbox), toolbar, FALSE, FALSE, 0); /* create the main vbox */ @@ -462,10 +468,18 @@ thunar_renamer_dialog_init (ThunarRenamerDialog *renamer_dialog) /* create the rename progress bar */ renamer_dialog->progress = thunar_renamer_progress_new (); gtk_box_pack_start (GTK_BOX (vbox), renamer_dialog->progress, FALSE, FALSE, 0); - exo_binding_new_with_negation (G_OBJECT (renamer_dialog->progress), "visible", G_OBJECT (rbox), "visible"); - exo_binding_new_with_negation (G_OBJECT (renamer_dialog->progress), "visible", G_OBJECT (swin), "sensitive"); - exo_binding_new_with_negation (G_OBJECT (renamer_dialog->progress), "visible", G_OBJECT (toolbar), "sensitive"); - exo_binding_new (G_OBJECT (renamer_dialog->progress), "visible", G_OBJECT (renamer_dialog->model), "frozen"); + g_object_bind_property (G_OBJECT (renamer_dialog->progress), "visible", + G_OBJECT (rbox), "visible", + G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (renamer_dialog->progress), "visible", + G_OBJECT (swin), "sensitive", + G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (renamer_dialog->progress), "visible", + G_OBJECT (toolbar), "sensitive", + G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (renamer_dialog->progress), "visible", + G_OBJECT (renamer_dialog->model), "frozen", + G_BINDING_SYNC_CREATE); /* synchronize the height of the progress bar and the rbox with the combos */ size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL); @@ -517,7 +531,10 @@ thunar_renamer_dialog_init (ThunarRenamerDialog *renamer_dialog) active = n; gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (mcombo), _(klass->values[n].value_nick)); } - exo_mutual_binding_new (G_OBJECT (renamer_dialog->model), "mode", G_OBJECT (mcombo), "active"); + g_object_bind_property (G_OBJECT (renamer_dialog->model), "mode", + G_OBJECT (mcombo), "active", + G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE); gtk_box_pack_end (GTK_BOX (rbox), mcombo, FALSE, FALSE, 0); gtk_combo_box_set_active (GTK_COMBO_BOX (mcombo), active); g_type_class_unref (klass); @@ -570,7 +587,9 @@ thunar_renamer_dialog_init (ThunarRenamerDialog *renamer_dialog) gtk_combo_box_set_active (GTK_COMBO_BOX (rcombo), active); /* connect the combo box to the notebook */ - exo_binding_new (G_OBJECT (rcombo), "active", G_OBJECT (notebook), "page"); + g_object_bind_property (G_OBJECT (rcombo), "active", + G_OBJECT (notebook), "page", + G_BINDING_SYNC_CREATE); /* close the config handle */ xfce_rc_close (rc); @@ -1474,7 +1493,7 @@ thunar_renamer_dialog_drag_motion (GtkWidget *tree_view, /* we cannot handle the drop */ return FALSE; } - + /* compute the drop position */ if (gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (tree_view), x, y, &path, &position)) { @@ -1533,10 +1552,10 @@ thunar_renamer_dialog_drag_drop (GtkWidget *tree_view, GtkTreeViewDropPosition drop_pos; gint position = -1; GList *rows; - + _thunar_return_val_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog), FALSE); _thunar_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE); - + /* determine the drop target */ target = gtk_drag_dest_find_target (tree_view, context, NULL); if (G_LIKELY (target == gdk_atom_intern_static_string ("text/uri-list"))) @@ -1584,7 +1603,7 @@ thunar_renamer_dialog_drag_drop (GtkWidget *tree_view, return TRUE; } - + static void diff --git a/thunar/thunar-renamer-model.c b/thunar/thunar-renamer-model.c index 16ff1d49..875dcb82 100644 --- a/thunar/thunar-renamer-model.c +++ b/thunar/thunar-renamer-model.c @@ -1008,7 +1008,7 @@ thunar_renamer_model_cmp_array (gconstpointer pointer_a, { const SortTuple *a = pointer_a; const SortTuple *b = pointer_b; - + if (G_UNLIKELY (a->position == b->position)) /* return the sort order for the 'moved' items in the list */ return a->offset - b->offset; @@ -1326,7 +1326,7 @@ thunar_renamer_model_insert (ThunarRenamerModel *renamer_model, * @tree_paths : the list of #GtkTreePath that need to be moved to * @position. * @position : the new position for the list of paths. - * + * * Reorder the treepaths in the model to their new postion in the list * and sends an update to the treeview to reorder the list. **/ @@ -1417,7 +1417,7 @@ thunar_renamer_model_reorder (ThunarRenamerModel *renamer_model, /* invalidate all items */ thunar_renamer_model_invalidate_all (renamer_model); - + /* cleanup if we used the heap */ if (G_UNLIKELY (n_items >= 500)) g_free (sort_array); diff --git a/thunar/thunar-renamer-pair.c b/thunar/thunar-renamer-pair.c index 422fbeae..d35c6287 100644 --- a/thunar/thunar-renamer-pair.c +++ b/thunar/thunar-renamer-pair.c @@ -142,7 +142,7 @@ thunar_renamer_pair_list_copy (GList *renamer_pair_list) return result; } - + /** diff --git a/thunar/thunar-sendto-model.c b/thunar/thunar-sendto-model.c index 0854107d..85fc7a43 100644 --- a/thunar/thunar-sendto-model.c +++ b/thunar/thunar-sendto-model.c @@ -153,7 +153,7 @@ thunar_sendto_model_load (ThunarSendtoModel *sendto_model) if (G_LIKELY (app_info != NULL)) { /* add to our handler list, sorted by their desktop-ids (reverse order) */ - sendto_model->handlers = g_list_insert_sorted (sendto_model->handlers, + sendto_model->handlers = g_list_insert_sorted (sendto_model->handlers, G_APP_INFO (app_info), (GCompareFunc) g_app_info_compare); @@ -233,8 +233,8 @@ thunar_sendto_model_get_default (void) * thunar_sendto_model_get_matching: * @sendto_model : a #ThunarSendtoModel. * @files : a #GList of #ThunarFile<!---->s. - * - * Returns the list of #GAppInfo<!---->s for the "Send To" targets that + * + * Returns the list of #GAppInfo<!---->s for the "Send To" targets that * support the specified @files. * * The returned list is owned by the caller and must be freed when no diff --git a/thunar/thunar-shortcuts-icon-renderer.c b/thunar/thunar-shortcuts-icon-renderer.c index 5f122e6d..42134119 100644 --- a/thunar/thunar-shortcuts-icon-renderer.c +++ b/thunar/thunar-shortcuts-icon-renderer.c @@ -237,7 +237,7 @@ thunar_shortcuts_icon_renderer_render (GtkCellRenderer *renderer, else gicon = thunar_device_get_icon (shortcuts_icon_renderer->device); - icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, gicon, cell_area->width, + icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, gicon, cell_area->width, GTK_ICON_LOOKUP_USE_BUILTIN); g_object_unref (gicon); diff --git a/thunar/thunar-shortcuts-model.c b/thunar/thunar-shortcuts-model.c index ce05c9d0..0c6bdff9 100644 --- a/thunar/thunar-shortcuts-model.c +++ b/thunar/thunar-shortcuts-model.c @@ -268,8 +268,9 @@ thunar_shortcuts_model_init (ThunarShortcutsModel *model) /* hidden bookmarks */ model->preferences = thunar_preferences_get (); - exo_binding_new (G_OBJECT (model->preferences), "hidden-bookmarks", - G_OBJECT (model), "hidden-bookmarks"); + g_object_bind_property (G_OBJECT (model->preferences), "hidden-bookmarks", + G_OBJECT (model), "hidden-bookmarks", + G_BINDING_SYNC_CREATE); /* load volumes */ thunar_shortcuts_model_shortcut_devices (model); diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c index 7de04b1f..07e52700 100644 --- a/thunar/thunar-shortcuts-view.c +++ b/thunar/thunar-shortcuts-view.c @@ -331,8 +331,12 @@ thunar_shortcuts_view_init (ThunarShortcutsView *view) /* sync the "emblems" property of the icon renderer with the "shortcuts-icon-emblems" preference * and the "size" property of the renderer with the "shortcuts-icon-size" preference. */ - exo_binding_new (G_OBJECT (view->preferences), "shortcuts-icon-size", G_OBJECT (view->icon_renderer), "size"); - exo_binding_new (G_OBJECT (view->preferences), "shortcuts-icon-emblems", G_OBJECT (view->icon_renderer), "emblems"); + g_object_bind_property (G_OBJECT (view->preferences), "shortcuts-icon-size", + G_OBJECT (view->icon_renderer), "size", + G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (view->preferences), "shortcuts-icon-emblems", + G_OBJECT (view->icon_renderer), "emblems", + G_BINDING_SYNC_CREATE); /* allocate the text renderer (ellipsizing as required, but "File System" must fit) */ renderer = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT, @@ -1092,7 +1096,7 @@ thunar_shortcuts_view_context_menu (ThunarShortcutsView *view, /* set the stock icon */ image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); - + /* append the "Open in New Tab" menu action */ item = gtk_image_menu_item_new_with_mnemonic (_("Open in New Tab")); g_signal_connect_swapped (G_OBJECT (item), "activate", G_CALLBACK (thunar_shortcuts_view_open_in_new_tab_clicked), view); diff --git a/thunar/thunar-simple-job.c b/thunar/thunar-simple-job.c index 3fe9bd3c..8f587779 100644 --- a/thunar/thunar-simple-job.c +++ b/thunar/thunar-simple-job.c @@ -122,7 +122,7 @@ thunar_simple_job_execute (ExoJob *job, { g_assert (err != NULL || exo_job_is_cancelled (job)); - /* set error if the job was cancelled. otherwise just propagate + /* set error if the job was cancelled. otherwise just propagate * the results of the processing function */ if (exo_job_set_error_if_cancelled (job, error)) { diff --git a/thunar/thunar-simple-job.h b/thunar/thunar-simple-job.h index 336c735b..83e5b862 100644 --- a/thunar/thunar-simple-job.h +++ b/thunar/thunar-simple-job.h @@ -28,7 +28,7 @@ G_BEGIN_DECLS /** * ThunarSimpleJobFunc: * @job : a #ThunarJob. - * @param_values : a #GArray of the #GValue<!---->s passed to + * @param_values : a #GArray of the #GValue<!---->s passed to * thunar_simple_job_launch(). * @error : return location for errors. * diff --git a/thunar/thunar-size-label.c b/thunar/thunar-size-label.c index eff53e72..b7eecca0 100644 --- a/thunar/thunar-size-label.c +++ b/thunar/thunar-size-label.c @@ -143,7 +143,9 @@ thunar_size_label_init (ThunarSizeLabel *size_label) /* add the spinner widget */ size_label->spinner = gtk_spinner_new (); - exo_binding_new (G_OBJECT (size_label->spinner), "visible", G_OBJECT (ebox), "visible"); + g_object_bind_property (G_OBJECT (size_label->spinner), "visible", + G_OBJECT (ebox), "visible", + G_BINDING_SYNC_CREATE); gtk_container_add (GTK_CONTAINER (ebox), size_label->spinner); gtk_widget_show (size_label->spinner); @@ -377,7 +379,7 @@ thunar_size_label_status_update (ThunarDeepCountJob *job, size_string = g_format_size (total_size); text = g_strdup_printf (ngettext ("%u item, totalling %s", "%u items, totalling %s", n), n, size_string); g_free (size_string); - + if (unreadable_directory_count > 0) { /* TRANSLATORS: this is shows if during the deep count size @@ -386,7 +388,7 @@ thunar_size_label_status_update (ThunarDeepCountJob *job, g_free (text); text = unreable_text; } - + gtk_label_set_text (GTK_LABEL (size_label->label), text); g_free (text); } diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index 9cb1f672..57afbb20 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -690,19 +690,29 @@ thunar_standard_view_init (ThunarStandardView *standard_view) standard_view->priv->row_changed_id = g_signal_connect (G_OBJECT (standard_view->model), "row-changed", G_CALLBACK (thunar_standard_view_row_changed), standard_view); g_signal_connect_after (G_OBJECT (standard_view->model), "row-deleted", G_CALLBACK (thunar_standard_view_restore_selection), standard_view); g_signal_connect (G_OBJECT (standard_view->model), "error", G_CALLBACK (thunar_standard_view_error), standard_view); - exo_binding_new (G_OBJECT (standard_view->preferences), "misc-case-sensitive", G_OBJECT (standard_view->model), "case-sensitive"); - exo_binding_new (G_OBJECT (standard_view->preferences), "misc-date-style", G_OBJECT (standard_view->model), "date-style"); - exo_binding_new (G_OBJECT (standard_view->preferences), "misc-folders-first", G_OBJECT (standard_view->model), "folders-first"); + g_object_bind_property (G_OBJECT (standard_view->preferences), "misc-case-sensitive", + G_OBJECT (standard_view->model), "case-sensitive", + G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (standard_view->preferences), "misc-date-style", + G_OBJECT (standard_view->model), "date-style", + G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (standard_view->preferences), "misc-folders-first", + G_OBJECT (standard_view->model), "folders-first", + G_BINDING_SYNC_CREATE); /* setup the icon renderer */ standard_view->icon_renderer = thunar_icon_renderer_new (); g_object_ref_sink (G_OBJECT (standard_view->icon_renderer)); - exo_binding_new (G_OBJECT (standard_view), "zoom-level", G_OBJECT (standard_view->icon_renderer), "size"); + g_object_bind_property (G_OBJECT (standard_view), "zoom-level", + G_OBJECT (standard_view->icon_renderer), "size", + G_BINDING_SYNC_CREATE); /* setup the name renderer */ standard_view->name_renderer = thunar_text_renderer_new (); g_object_ref_sink (G_OBJECT (standard_view->name_renderer)); - exo_binding_new (G_OBJECT (standard_view->preferences), "misc-single-click", G_OBJECT (standard_view->name_renderer), "follow-prelit"); + g_object_bind_property (G_OBJECT (standard_view->preferences), "misc-single-click", + G_OBJECT (standard_view->name_renderer), "follow-prelit", + G_BINDING_SYNC_CREATE); /* be sure to update the selection whenever the folder changes */ g_signal_connect_swapped (G_OBJECT (standard_view->model), "notify::folder", G_CALLBACK (thunar_standard_view_selection_changed), standard_view); @@ -749,7 +759,8 @@ thunar_standard_view_constructor (GType type, thunar_view_set_zoom_level (THUNAR_VIEW (standard_view), zoom_level); /* save the "zoom-level" as "last-<view>-zoom-level" whenever the user changes the zoom level */ - g_object_bind_property (object, "zoom-level", G_OBJECT (standard_view->preferences), zoom_level_property_name, G_BINDING_DEFAULT); + g_object_bind_property (object, "zoom-level", G_OBJECT (standard_view->preferences), + zoom_level_property_name, G_BINDING_DEFAULT); } /* determine the real view widget (treeview or iconview) */ @@ -761,8 +772,12 @@ thunar_standard_view_constructor (GType type, g_object_set (G_OBJECT (view), "model", standard_view->model, NULL); /* apply the single-click settings to the view */ - exo_binding_new (G_OBJECT (standard_view->preferences), "misc-single-click", G_OBJECT (view), "single-click"); - exo_binding_new (G_OBJECT (standard_view->preferences), "misc-single-click-timeout", G_OBJECT (view), "single-click-timeout"); + g_object_bind_property (G_OBJECT (standard_view->preferences), "misc-single-click", + G_OBJECT (view), "single-click", + G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (standard_view->preferences), "misc-single-click-timeout", + G_OBJECT (view), "single-click-timeout", + G_BINDING_SYNC_CREATE); /* apply the default sort column and sort order */ g_object_get (G_OBJECT (standard_view->preferences), "last-sort-column", &sort_column, "last-sort-order", &sort_order, NULL); @@ -816,7 +831,7 @@ thunar_standard_view_dispose (GObject *object) /* unregister the "loading" binding */ if (G_UNLIKELY (standard_view->loading_binding != NULL)) - exo_binding_unbind (standard_view->loading_binding); + g_object_unref (standard_view->loading_binding); /* be sure to cancel any pending drag autoscroll timer */ if (G_UNLIKELY (standard_view->priv->drag_scroll_timer_id != 0)) @@ -1397,7 +1412,7 @@ thunar_standard_view_set_current_directory (ThunarNavigator *navigator, /* disconnect any previous "loading" binding */ if (G_LIKELY (standard_view->loading_binding != NULL)) - exo_binding_unbind (standard_view->loading_binding); + g_object_unref (standard_view->loading_binding); /* store the current scroll position */ if (current_directory != NULL) @@ -1454,10 +1469,12 @@ thunar_standard_view_set_current_directory (ThunarNavigator *navigator, folder = thunar_folder_get_for_file (current_directory); /* connect the "loading" binding */ - standard_view->loading_binding = exo_binding_new_full (G_OBJECT (folder), "loading", - G_OBJECT (standard_view), "loading", - NULL, thunar_standard_view_loading_unbound, - standard_view); + standard_view->loading_binding = g_object_bind_property_full (G_OBJECT (folder), "loading", + G_OBJECT (standard_view), "loading", + G_BINDING_SYNC_CREATE, + NULL, NULL, + standard_view, + thunar_standard_view_loading_unbound); /* apply the new folder */ thunar_list_model_set_folder (standard_view->model, folder); diff --git a/thunar/thunar-standard-view.h b/thunar/thunar-standard-view.h index 2828f3c4..1dd06309 100644 --- a/thunar/thunar-standard-view.h +++ b/thunar/thunar-standard-view.h @@ -135,7 +135,7 @@ struct _ThunarStandardView GtkCellRenderer *icon_renderer; GtkCellRenderer *name_renderer; - ExoBinding *loading_binding; + GBinding *loading_binding; gboolean loading; ThunarStandardViewPrivate *priv; diff --git a/thunar/thunar-statusbar.c b/thunar/thunar-statusbar.c index 39ea7c66..c029a826 100644 --- a/thunar/thunar-statusbar.c +++ b/thunar/thunar-statusbar.c @@ -3,18 +3,18 @@ * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-templates-action.c b/thunar/thunar-templates-action.c index 7ea185a1..ccbd284b 100644 --- a/thunar/thunar-templates-action.c +++ b/thunar/thunar-templates-action.c @@ -182,12 +182,12 @@ item_activated (GtkWidget *item, file = g_object_get_data (G_OBJECT (item), I_("thunar-file")); if (G_UNLIKELY (file != NULL)) { - g_signal_emit (G_OBJECT (templates_action), + g_signal_emit (G_OBJECT (templates_action), templates_action_signals[CREATE_TEMPLATE], 0, file); } else { - g_signal_emit (G_OBJECT (templates_action), + g_signal_emit (G_OBJECT (templates_action), templates_action_signals[CREATE_EMPTY_FILE], 0); } } @@ -212,8 +212,8 @@ find_parent_menu (ThunarFile *file, return NULL; /* iterate over all dirs and menu items */ - for (lp = g_list_first (dirs), ip = g_list_first (items); - parent_menu == NULL && lp != NULL && ip != NULL; + for (lp = g_list_first (dirs), ip = g_list_first (items); + parent_menu == NULL && lp != NULL && ip != NULL; lp = lp->next, ip = ip->next) { /* check if the current dir/item is the parent of our file */ @@ -247,14 +247,14 @@ compare_files (ThunarFile *a, /* check whether the files are equal */ if (g_file_equal (file_a, file_b)) return 0; - + /* directories always come first */ - if (thunar_file_get_kind (a) == G_FILE_TYPE_DIRECTORY + if (thunar_file_get_kind (a) == G_FILE_TYPE_DIRECTORY && thunar_file_get_kind (b) != G_FILE_TYPE_DIRECTORY) { return -1; } - else if (thunar_file_get_kind (a) != G_FILE_TYPE_DIRECTORY + else if (thunar_file_get_kind (a) != G_FILE_TYPE_DIRECTORY && thunar_file_get_kind (b) == G_FILE_TYPE_DIRECTORY) { return 1; @@ -332,14 +332,14 @@ thunar_templates_action_files_ready (ThunarJob *job, /* get the icon factory */ icon_factory = thunar_icon_factory_get_default (); - /* sort items so that directories come before files and ancestors come + /* sort items so that directories come before files and ancestors come * before descendants */ files = g_list_sort (files, (GCompareFunc) compare_files); for (lp = g_list_first (files); lp != NULL; lp = lp->next) { file = lp->data; - + /* determine the parent menu for this file/directory */ parent_menu = find_parent_menu (file, dirs, items); parent_menu = parent_menu == NULL ? menu : parent_menu; @@ -355,7 +355,7 @@ thunar_templates_action_files_ready (ThunarJob *job, item = gtk_image_menu_item_new_with_label (thunar_file_get_display_name (file)); gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), submenu); - /* prepend the directory, its item and the parent menu it should + /* prepend the directory, its item and the parent menu it should * later be added to to the respective lists */ dirs = g_list_prepend (dirs, file); items = g_list_prepend (items, item); @@ -365,9 +365,9 @@ thunar_templates_action_files_ready (ThunarJob *job, { /* allocate a new menu item */ item = gtk_image_menu_item_new_with_label (thunar_file_get_display_name (file)); - g_object_set_data_full (G_OBJECT (item), I_("thunar-file"), + g_object_set_data_full (G_OBJECT (item), I_("thunar-file"), g_object_ref (file), g_object_unref); - g_signal_connect (item, "activate", G_CALLBACK (item_activated), + g_signal_connect (item, "activate", G_CALLBACK (item_activated), templates_action); gtk_menu_shell_append (GTK_MENU_SHELL (parent_menu), item); gtk_widget_show (item); @@ -387,8 +387,8 @@ thunar_templates_action_files_ready (ThunarJob *job, } /* add all non-empty directory items to their parent menu */ - for (lp = items, pp = parent_menus; - lp != NULL && pp != NULL; + for (lp = items, pp = parent_menus; + lp != NULL && pp != NULL; lp = lp->next, pp = pp->next) { /* determine the submenu for this directory item */ @@ -471,7 +471,7 @@ thunar_templates_action_load_finished (ThunarJob *job, /* add the "Empty File" item */ item = gtk_image_menu_item_new_with_mnemonic (_("_Empty File")); - g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (item_activated), + g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (item_activated), templates_action); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show (item); @@ -508,13 +508,13 @@ thunar_templates_action_menu_shown (GtkWidget *menu, (gpointer) &templates_action->job); g_signal_connect (templates_action->job, "files-ready", - G_CALLBACK (thunar_templates_action_files_ready), + G_CALLBACK (thunar_templates_action_files_ready), templates_action); g_signal_connect (templates_action->job, "error", - G_CALLBACK (thunar_templates_action_load_error), + G_CALLBACK (thunar_templates_action_load_error), templates_action); g_signal_connect (templates_action->job, "finished", - G_CALLBACK (thunar_templates_action_load_finished), + G_CALLBACK (thunar_templates_action_load_finished), templates_action); } } diff --git a/thunar/thunar-thumbnail-cache.c b/thunar/thunar-thumbnail-cache.c index c7ff0c8f..b3686088 100644 --- a/thunar/thunar-thumbnail-cache.c +++ b/thunar/thunar-thumbnail-cache.c @@ -2,18 +2,18 @@ /*- * Copyright (c) 2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -61,7 +61,7 @@ struct _ThunarThumbnailCache #ifdef HAVE_DBUS DBusGProxy *cache_proxy; - + GList *move_source_queue; GList *move_target_queue; guint move_queue_idle_id; @@ -99,7 +99,7 @@ thunar_thumbnail_cache_class_init (ThunarThumbnailCacheClass *klass) thunar_thumbnail_cache_parent_class = g_type_class_peek_parent (klass); gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = thunar_thumbnail_cache_finalize; + gobject_class->finalize = thunar_thumbnail_cache_finalize; } @@ -287,7 +287,7 @@ thunar_thumbnail_cache_cleanup_async (ThunarThumbnailCache *cache, _thunar_return_if_fail (base_uris != NULL); /* request a thumbnail cache update asynchronously */ - thunar_thumbnail_cache_proxy_cleanup_async (cache->cache_proxy, + thunar_thumbnail_cache_proxy_cleanup_async (cache->cache_proxy, (const gchar **)base_uris, 0, thunar_thumbnail_cache_cleanup_async_reply, NULL); @@ -309,7 +309,7 @@ thunar_thumbnail_cache_process_move_queue (ThunarThumbnailCache *cache) /* acquire a cache lock */ _thumbnail_cache_lock (cache); - + /* compute how many URIs there are */ n_uris = g_list_length (cache->move_source_queue); @@ -319,9 +319,9 @@ thunar_thumbnail_cache_process_move_queue (ThunarThumbnailCache *cache) /* fill URI array with file URIs from the move queue */ for (n = 0, - sp = g_list_last (cache->move_source_queue), + sp = g_list_last (cache->move_source_queue), tp = g_list_last (cache->move_target_queue); - sp != NULL && tp != NULL; + sp != NULL && tp != NULL; sp = sp->prev, tp = tp->prev, ++n) { source_uris[n] = g_file_get_uri (sp->data); @@ -337,7 +337,7 @@ thunar_thumbnail_cache_process_move_queue (ThunarThumbnailCache *cache) target_uris[n] = NULL; /* asynchronously move the thumbnails */ - thunar_thumbnail_cache_move_async (cache, + thunar_thumbnail_cache_move_async (cache, (const gchar **)source_uris, (const gchar **)target_uris); @@ -376,7 +376,7 @@ thunar_thumbnail_cache_process_copy_queue (ThunarThumbnailCache *cache) /* acquire a cache lock */ _thumbnail_cache_lock (cache); - + /* compute how many URIs there are */ n_uris = g_list_length (cache->copy_source_queue); @@ -386,9 +386,9 @@ thunar_thumbnail_cache_process_copy_queue (ThunarThumbnailCache *cache) /* fill URI array with file URIs from the copy queue */ for (n = 0, - sp = g_list_last (cache->copy_source_queue), + sp = g_list_last (cache->copy_source_queue), tp = g_list_last (cache->copy_target_queue); - sp != NULL && tp != NULL; + sp != NULL && tp != NULL; sp = sp->prev, tp = tp->prev, ++n) { source_uris[n] = g_file_get_uri (sp->data); @@ -404,7 +404,7 @@ thunar_thumbnail_cache_process_copy_queue (ThunarThumbnailCache *cache) target_uris[n] = NULL; /* asynchronously copy the thumbnails */ - thunar_thumbnail_cache_copy_async (cache, + thunar_thumbnail_cache_copy_async (cache, (const gchar **)source_uris, (const gchar **)target_uris); @@ -441,7 +441,7 @@ thunar_thumbnail_cache_process_delete_queue (ThunarThumbnailCache *cache) /* acquire a cache lock */ _thumbnail_cache_lock (cache); - + /* compute how many URIs there are */ n_uris = g_list_length (cache->delete_queue); @@ -493,7 +493,7 @@ thunar_thumbnail_cache_process_cleanup_queue (ThunarThumbnailCache *cache) /* acquire a cache lock */ _thumbnail_cache_lock (cache); - + /* compute how many URIs there are */ n_uris = g_list_length (cache->cleanup_queue); @@ -574,7 +574,7 @@ thunar_thumbnail_cache_move_file (ThunarThumbnailCache *cache, } /* add the files to the move queue */ - cache->move_source_queue = g_list_prepend (cache->move_source_queue, + cache->move_source_queue = g_list_prepend (cache->move_source_queue, g_object_ref (source_file)); cache->move_target_queue = g_list_prepend (cache->move_target_queue, g_object_ref (target_file)); @@ -616,7 +616,7 @@ thunar_thumbnail_cache_copy_file (ThunarThumbnailCache *cache, } /* add the files to the copy queues */ - cache->copy_source_queue = g_list_prepend (cache->copy_source_queue, + cache->copy_source_queue = g_list_prepend (cache->copy_source_queue, g_object_ref (source_file)); cache->copy_target_queue = g_list_prepend (cache->copy_target_queue, g_object_ref (target_file)); @@ -659,8 +659,8 @@ thunar_thumbnail_cache_delete_file (ThunarThumbnailCache *cache, cache->delete_queue = g_list_prepend (cache->delete_queue, g_object_ref (file)); /* process the delete queue in a 250ms timeout */ - cache->delete_queue_idle_id = - g_timeout_add (500, (GSourceFunc) thunar_thumbnail_cache_process_delete_queue, + cache->delete_queue_idle_id = + g_timeout_add (500, (GSourceFunc) thunar_thumbnail_cache_process_delete_queue, cache); } diff --git a/thunar/thunar-thumbnail-cache.h b/thunar/thunar-thumbnail-cache.h index dc32fc80..bdcb70b3 100644 --- a/thunar/thunar-thumbnail-cache.h +++ b/thunar/thunar-thumbnail-cache.h @@ -2,18 +2,18 @@ /*- * Copyright (c) 2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-thumbnailer.h b/thunar/thunar-thumbnailer.h index daed6092..a7334002 100644 --- a/thunar/thunar-thumbnailer.h +++ b/thunar/thunar-thumbnailer.h @@ -2,18 +2,18 @@ /*- * Copyright (c) 2009-2011 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-transfer-job.h b/thunar/thunar-transfer-job.h index b5971675..d4eeaa59 100644 --- a/thunar/thunar-transfer-job.h +++ b/thunar/thunar-transfer-job.h @@ -2,19 +2,19 @@ /*- * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org>. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ diff --git a/thunar/thunar-trash-action.c b/thunar/thunar-trash-action.c index ed97e783..6794d8d4 100644 --- a/thunar/thunar-trash-action.c +++ b/thunar/thunar-trash-action.c @@ -98,7 +98,7 @@ thunar_trash_action_constructed (GObject *object) { ThunarTrashAction *trash_action = THUNAR_TRASH_ACTION (object); const gchar *label; - + if (trash_action->trash_bin != NULL) label = thunar_file_get_display_name (trash_action->trash_bin); else @@ -142,7 +142,7 @@ thunar_trash_action_changed (ThunarTrashAction *trash_action, thunar_icon_factory_clear_pixmap_cache (trash_bin); /* adjust the stock icon appropriately */ - if (thunar_file_get_item_count (trash_bin) > 0) + if (thunar_file_get_item_count (trash_bin) > 0) g_object_set (G_OBJECT (trash_action), "stock-id", THUNAR_STOCK_TRASH_FULL, NULL); else g_object_set (G_OBJECT (trash_action), "stock-id", THUNAR_STOCK_TRASH_EMPTY, NULL); diff --git a/thunar/thunar-tree-model.c b/thunar/thunar-tree-model.c index e2bbabf8..26ec7b4f 100644 --- a/thunar/thunar-tree-model.c +++ b/thunar/thunar-tree-model.c @@ -1802,7 +1802,9 @@ thunar_tree_model_get_default (void) /* synchronize the the global "misc-case-sensitive" preference */ preferences = thunar_preferences_get (); g_object_set_data_full (G_OBJECT (model), I_("thunar-preferences"), preferences, g_object_unref); - exo_binding_new (G_OBJECT (preferences), "misc-case-sensitive", G_OBJECT (model), "case-sensitive"); + g_object_bind_property (G_OBJECT (preferences), "misc-case-sensitive", + G_OBJECT (model), "case-sensitive", + G_BINDING_SYNC_CREATE); } else { diff --git a/thunar/thunar-tree-pane.c b/thunar/thunar-tree-pane.c index c28ea335..2b7f8c72 100644 --- a/thunar/thunar-tree-pane.c +++ b/thunar/thunar-tree-pane.c @@ -145,8 +145,12 @@ thunar_tree_pane_init (ThunarTreePane *tree_pane) /* allocate the tree view */ tree_pane->view = thunar_tree_view_new (); - exo_binding_new (G_OBJECT (tree_pane), "show-hidden", G_OBJECT (tree_pane->view), "show-hidden"); - exo_binding_new (G_OBJECT (tree_pane), "current-directory", G_OBJECT (tree_pane->view), "current-directory"); + g_object_bind_property (G_OBJECT (tree_pane), "show-hidden", + G_OBJECT (tree_pane->view), "show-hidden", + G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (tree_pane), "current-directory", + G_OBJECT (tree_pane->view), "current-directory", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped (G_OBJECT (tree_pane->view), "change-directory", G_CALLBACK (thunar_navigator_change_directory), tree_pane); g_signal_connect_swapped (G_OBJECT (tree_pane->view), "open-new-tab", G_CALLBACK (thunar_navigator_open_new_tab), tree_pane); gtk_container_add (GTK_CONTAINER (tree_pane), tree_pane->view); diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c index bb976f35..4d3e2c40 100644 --- a/thunar/thunar-tree-view.c +++ b/thunar/thunar-tree-view.c @@ -416,8 +416,12 @@ thunar_tree_view_init (ThunarTreeView *view) /* sync the "emblems" property of the icon renderer with the "tree-icon-emblems" preference * and the "size" property of the renderer with the "tree-icon-size" preference. */ - exo_binding_new (G_OBJECT (view->preferences), "tree-icon-size", G_OBJECT (view->icon_renderer), "size"); - exo_binding_new (G_OBJECT (view->preferences), "tree-icon-emblems", G_OBJECT (view->icon_renderer), "emblems"); + g_object_bind_property (G_OBJECT (view->preferences), "tree-icon-size", + G_OBJECT (view->icon_renderer), "size", + G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (view->preferences), "tree-icon-emblems", + G_OBJECT (view->icon_renderer), "emblems", + G_BINDING_SYNC_CREATE); /* allocate the text renderer */ renderer = gtk_cell_renderer_text_new (); @@ -1119,7 +1123,7 @@ thunar_tree_view_context_menu (ThunarTreeView *view, /* set the stock icon */ image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); - + /* append the "Open in New Tab" menu action */ item = gtk_image_menu_item_new_with_mnemonic (_("Open in New _Tab")); g_signal_connect_swapped (G_OBJECT (item), "activate", G_CALLBACK (thunar_tree_view_action_open_in_new_tab), view); @@ -1968,11 +1972,11 @@ thunar_tree_view_mount_finish (ThunarDevice *device, case OPEN_IN_WINDOW: thunar_tree_view_open_selection_in_new_window (data->view); break; - + case OPEN_IN_TAB: thunar_tree_view_open_selection_in_new_tab (data->view); break; - + default: thunar_tree_view_open_selection (data->view); break; diff --git a/thunar/thunar-util.c b/thunar/thunar-util.c index 7b8665f0..c124ecdf 100644 --- a/thunar/thunar-util.c +++ b/thunar/thunar-util.c @@ -3,18 +3,18 @@ * Copyright (c) 2006-2007 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2009-2010 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -199,7 +199,7 @@ thunar_util_expand_filename (const gchar *filename, /* use the homedir of the specified user */ replacement = passwd->pw_dir; } - + /* generate the filename */ return g_build_filename (replacement, slash, NULL); } @@ -207,12 +207,12 @@ thunar_util_expand_filename (const gchar *filename, { /* examine the remainder of the filename */ remainder = filename + 1; - + /* transform working directory into a filename string */ if (G_LIKELY (working_directory != NULL)) { pwd = g_file_get_path (working_directory); - + /* if we only have the slash then we want the working directory only */ if (G_UNLIKELY (*remainder == '\0')) return pwd; @@ -433,15 +433,15 @@ thunar_util_time_from_rfc3339 (const gchar *date_string) tm.tm_year = val - 1900; date_string++; tm.tm_mon = strtoul (date_string, (gchar **) &date_string, 10) - 1; - + if (G_UNLIKELY (*date_string++ != '-')) return 0; - + tm.tm_mday = strtoul (date_string, (gchar **) &date_string, 10); if (G_UNLIKELY (*date_string++ != 'T')) return 0; - + val = strtoul (date_string, (gchar **) &date_string, 10); if (G_UNLIKELY (*date_string != ':')) return 0; @@ -450,10 +450,10 @@ thunar_util_time_from_rfc3339 (const gchar *date_string) tm.tm_hour = val; date_string++; tm.tm_min = strtoul (date_string, (gchar **) &date_string, 10); - + if (G_UNLIKELY (*date_string++ != ':')) return 0; - + tm.tm_sec = strtoul (date_string, (gchar **) &date_string, 10); #endif /* !HAVE_STRPTIME */ diff --git a/thunar/thunar-util.h b/thunar/thunar-util.h index 8170bdc3..29b40d52 100644 --- a/thunar/thunar-util.h +++ b/thunar/thunar-util.h @@ -3,18 +3,18 @@ * Copyright (c) 2006-2007 Benedikt Meurer <benny@xfce.org> * Copyright (c) 2009-2010 Jannis Pohlmann <jannis@xfce.org> * - * This program is free software; you can redistribute it and/or + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 7f482e19..f90d6e5d 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -795,7 +795,9 @@ thunar_window_init (ThunarWindow *window) window->launcher = thunar_launcher_new (); thunar_launcher_set_widget (window->launcher, GTK_WIDGET (window)); thunar_component_set_ui_manager (THUNAR_COMPONENT (window->launcher), window->ui_manager); - exo_binding_new (G_OBJECT (window), "current-directory", G_OBJECT (window->launcher), "current-directory"); + g_object_bind_property (G_OBJECT (window), "current-directory", + G_OBJECT (window->launcher), "current-directory", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped (G_OBJECT (window->launcher), "change-directory", G_CALLBACK (thunar_window_set_current_directory), window); g_signal_connect_swapped (G_OBJECT (window->launcher), "open-new-tab", G_CALLBACK (thunar_window_notebook_insert), window); @@ -828,8 +830,9 @@ thunar_window_init (ThunarWindow *window) /* place the spinner into the menu item */ window->spinner = gtk_spinner_new (); gtk_container_add (GTK_CONTAINER (item), window->spinner); - exo_binding_new (G_OBJECT (window->spinner), "active", - G_OBJECT (window->spinner), "visible"); + g_object_bind_property (G_OBJECT (window->spinner), "active", + G_OBJECT (window->spinner), "visible", + G_BINDING_SYNC_CREATE); /* check if we need to add the root warning */ if (G_UNLIKELY (geteuid () == 0)) @@ -1729,8 +1732,12 @@ thunar_window_notebook_insert (ThunarWindow *window, label_box = gtk_hbox_new (FALSE, 0); label = gtk_label_new (NULL); - exo_binding_new (G_OBJECT (view), "display-name", G_OBJECT (label), "label"); - exo_binding_new (G_OBJECT (view), "tooltip-text", G_OBJECT (label), "tooltip-text"); + g_object_bind_property (G_OBJECT (view), "display-name", + G_OBJECT (label), "label", + G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (view), "tooltip-text", + G_OBJECT (label), "tooltip-text", + G_BINDING_SYNC_CREATE); gtk_widget_set_has_tooltip (label, TRUE); gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.5f); gtk_misc_set_padding (GTK_MISC (label), 3, 3); @@ -1807,7 +1814,9 @@ thunar_window_install_location_bar (ThunarWindow *window, { /* allocate the new location bar widget */ window->location_bar = g_object_new (type, "ui-manager", window->ui_manager, NULL); - exo_binding_new (G_OBJECT (window), "current-directory", G_OBJECT (window->location_bar), "current-directory"); + g_object_bind_property (G_OBJECT (window), "current-directory", + G_OBJECT (window->location_bar), "current-directory", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped (G_OBJECT (window->location_bar), "change-directory", G_CALLBACK (thunar_window_set_current_directory), window); g_signal_connect_swapped (G_OBJECT (window->location_bar), "open-new-tab", G_CALLBACK (thunar_window_notebook_insert), window); @@ -1874,8 +1883,12 @@ thunar_window_install_sidepane (ThunarWindow *window, window->sidepane = g_object_new (type, NULL); gtk_widget_set_size_request (window->sidepane, 0, -1); thunar_component_set_ui_manager (THUNAR_COMPONENT (window->sidepane), window->ui_manager); - exo_binding_new (G_OBJECT (window), "show-hidden", G_OBJECT (window->sidepane), "show-hidden"); - exo_binding_new (G_OBJECT (window), "current-directory", G_OBJECT (window->sidepane), "current-directory"); + g_object_bind_property (G_OBJECT (window), "show-hidden", + G_OBJECT (window->sidepane), "show-hidden", + G_BINDING_SYNC_CREATE); + g_object_bind_property (G_OBJECT (window), "current-directory", + G_OBJECT (window->sidepane), "current-directory", + G_BINDING_SYNC_CREATE); g_signal_connect_swapped (G_OBJECT (window->sidepane), "change-directory", G_CALLBACK (thunar_window_set_current_directory), window); g_signal_connect_swapped (G_OBJECT (window->sidepane), "open-new-tab", G_CALLBACK (thunar_window_notebook_insert), window); gtk_paned_pack1 (GTK_PANED (window->paned), window->sidepane, FALSE, FALSE); @@ -2978,7 +2991,12 @@ thunar_window_action_open_templates (GtkAction *action, gtk_widget_show (label); button = gtk_check_button_new_with_mnemonic (_("Do _not display this message again")); - exo_mutual_binding_new_with_negation (G_OBJECT (window->preferences), "misc-show-about-templates", G_OBJECT (button), "active"); + g_object_bind_property (G_OBJECT (window->preferences), + "misc-show-about-templates", + G_OBJECT (button), "active", + G_BINDING_INVERT_BOOLEAN + | G_BINDING_BIDIRECTIONAL + | G_BINDING_SYNC_CREATE); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_widget_show (button); |