From aa24676651f8bd3e8b434f72d5aac98e84c0867d Mon Sep 17 00:00:00 2001 From: Laurent Napias Date: Sat, 29 Jun 2019 10:43:23 +0200 Subject: Remove trailing whitespaces --- shell/eggfindbar.c | 34 ++-- shell/eggfindbar.h | 2 +- shell/ev-daemon.c | 2 +- shell/ev-file-monitor.c | 10 +- shell/ev-history.c | 8 +- shell/ev-history.h | 4 +- shell/ev-keyring.c | 2 +- shell/ev-media-player-keys.c | 4 +- shell/ev-media-player-keys.h | 2 +- shell/ev-message-area.c | 4 +- shell/ev-navigation-action-widget.c | 18 +- shell/ev-navigation-action-widget.h | 2 +- shell/ev-navigation-action.c | 10 +- shell/ev-navigation-action.h | 2 +- shell/ev-open-recent-action.c | 2 +- shell/ev-password-view.c | 18 +- shell/ev-password-view.h | 2 +- shell/ev-progress-message-area.c | 8 +- shell/ev-properties-dialog.c | 2 +- shell/ev-properties-fonts.c | 16 +- shell/ev-sidebar-attachments.c | 64 +++--- shell/ev-sidebar-layers.c | 28 +-- shell/ev-sidebar-links.c | 44 ++-- shell/ev-sidebar-links.h | 2 +- shell/ev-sidebar-page.c | 10 +- shell/ev-sidebar-thumbnails.c | 40 ++-- shell/ev-sidebar-thumbnails.h | 2 +- shell/ev-sidebar.c | 36 ++-- shell/ev-sidebar.h | 2 +- shell/ev-utils.c | 6 +- shell/ev-window-title.c | 6 +- shell/ev-window.c | 390 ++++++++++++++++++------------------ shell/main.c | 10 +- 33 files changed, 396 insertions(+), 396 deletions(-) (limited to 'shell') diff --git a/shell/eggfindbar.c b/shell/eggfindbar.c index 94a2b8d9..a0abdd4b 100644 --- a/shell/eggfindbar.c +++ b/shell/eggfindbar.c @@ -1,18 +1,18 @@ /* Copyright (C) 2004 Red Hat, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * This library 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 * Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with the Mate Library; see the file COPYING.LIB. If not, - * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ @@ -83,7 +83,7 @@ egg_find_bar_class_init (EggFindBarClass *klass) GObjectClass *object_class; GtkWidgetClass *widget_class; GtkBindingSet *binding_set; - + egg_find_bar_parent_class = g_type_class_peek_parent (klass); object_class = (GObjectClass *)klass; @@ -96,7 +96,7 @@ egg_find_bar_class_init (EggFindBarClass *klass) widget_class->show = egg_find_bar_show; widget_class->hide = egg_find_bar_hide; - + widget_class->grab_focus = egg_find_bar_grab_focus; find_bar_signals[NEXT] = @@ -257,7 +257,7 @@ entry_changed_callback (GtkEntry *entry, text = g_strdup (gtk_entry_get_text (entry)); egg_find_bar_set_search_string (find_bar, text); - + g_free (text); } @@ -293,8 +293,8 @@ egg_find_bar_init (EggFindBar *find_bar) /* Data */ priv = EGG_FIND_BAR_GET_PRIVATE (find_bar); - - find_bar->priv = priv; + + find_bar->priv = priv; priv->search_string = NULL; gtk_toolbar_set_style (GTK_TOOLBAR (find_bar), GTK_TOOLBAR_BOTH_HORIZ); @@ -302,7 +302,7 @@ egg_find_bar_init (EggFindBar *find_bar) /* Find: |_____| */ item = gtk_tool_item_new (); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); - + label = gtk_label_new_with_mnemonic (_("Find:")); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_hexpand (label, TRUE); @@ -535,11 +535,11 @@ egg_find_bar_set_search_string (EggFindBar *find_bar, priv = (EggFindBarPrivate *)find_bar->priv; g_object_freeze_notify (G_OBJECT (find_bar)); - + if (priv->search_string != search_string) { char *old; - + old = priv->search_string; if (search_string && *search_string == '\0') @@ -556,16 +556,16 @@ egg_find_bar_set_search_string (EggFindBar *find_bar, strcmp (old, search_string) != 0)) { gboolean not_empty; - + priv->search_string = g_strdup (search_string); g_free (old); - + gtk_entry_set_text (GTK_ENTRY (priv->find_entry), priv->search_string ? priv->search_string : ""); - - not_empty = (search_string == NULL) ? FALSE : TRUE; + + not_empty = (search_string == NULL) ? FALSE : TRUE; gtk_widget_set_sensitive (GTK_WIDGET (find_bar->priv->next_button), not_empty); gtk_widget_set_sensitive (GTK_WIDGET (find_bar->priv->previous_button), not_empty); @@ -675,7 +675,7 @@ egg_find_bar_set_status_text (EggFindBar *find_bar, g_return_if_fail (EGG_IS_FIND_BAR (find_bar)); priv = (EggFindBarPrivate *)find_bar->priv; - + gtk_label_set_text (GTK_LABEL (priv->status_label), text); g_object_set (priv->status_separator, "visible", text != NULL && *text != '\0', NULL); g_object_set (priv->status_item, "visible", text != NULL && *text !='\0', NULL); diff --git a/shell/eggfindbar.h b/shell/eggfindbar.h index 5ad01804..df7157e1 100644 --- a/shell/eggfindbar.h +++ b/shell/eggfindbar.h @@ -12,7 +12,7 @@ * * You should have received a copy of the GNU Library General Public * License along with the Mate Library; see the file COPYING.LIB. If not, - * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ diff --git a/shell/ev-daemon.c b/shell/ev-daemon.c index f836722b..14e72bf2 100644 --- a/shell/ev-daemon.c +++ b/shell/ev-daemon.c @@ -386,7 +386,7 @@ ev_daemon_application_dbus_register (GApplication *gapplication, g_object_unref (skeleton); return FALSE; } - + application->daemon = skeleton; g_signal_connect (skeleton, "handle-register-document", diff --git a/shell/ev-file-monitor.c b/shell/ev-file-monitor.c index 5107119e..fcb711d4 100644 --- a/shell/ev-file-monitor.c +++ b/shell/ev-file-monitor.c @@ -43,7 +43,7 @@ static void ev_file_monitor_changed_cb (GFileMonitor *monitor, GFile *other_file, GFileMonitorEvent event_type, EvFileMonitor *ev_monitor); - + #define EV_FILE_MONITOR_GET_PRIVATE(object) \ (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_FILE_MONITOR, EvFileMonitorPrivate)) @@ -63,7 +63,7 @@ ev_file_monitor_finalize (GObject *object) EvFileMonitor *ev_monitor = EV_FILE_MONITOR (object); ev_file_monitor_timeout_stop (ev_monitor); - + if (ev_monitor->priv->monitor) { g_signal_handlers_disconnect_by_func (ev_monitor->priv->monitor, ev_file_monitor_changed_cb, @@ -99,7 +99,7 @@ static gboolean timeout_cb (EvFileMonitor *ev_monitor) { g_signal_emit (ev_monitor, signals[CHANGED], 0); - + ev_monitor->priv->timeout_id = 0; return FALSE; } @@ -108,7 +108,7 @@ static void ev_file_monitor_timeout_start (EvFileMonitor *ev_monitor) { ev_file_monitor_timeout_stop (ev_monitor); - + ev_monitor->priv->timeout_id = g_timeout_add_seconds (5, (GSourceFunc)timeout_cb, ev_monitor); } @@ -149,7 +149,7 @@ ev_file_monitor_new (const gchar *uri) EvFileMonitor *ev_monitor; GFile *file; GError *error = NULL; - + ev_monitor = EV_FILE_MONITOR (g_object_new (EV_TYPE_FILE_MONITOR, NULL)); file = g_file_new_for_uri (uri); diff --git a/shell/ev-history.c b/shell/ev-history.c index 51ecb3fa..73d3c863 100644 --- a/shell/ev-history.c +++ b/shell/ev-history.c @@ -77,7 +77,7 @@ ev_history_class_init (EvHistoryClass *class) object_class->finalize = ev_history_finalize; - signals[HISTORY_CHANGED] = + signals[HISTORY_CHANGED] = g_signal_new ("changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, @@ -110,13 +110,13 @@ ev_history_add_link (EvHistory *history, EvLink *link) g_object_ref (link); history->priv->links = g_list_append (history->priv->links, link); - + if (g_list_length (history->priv->links) > HISTORY_LENGTH) { g_object_unref (G_OBJECT (history->priv->links->data)); - history->priv->links = g_list_delete_link (history->priv->links, + history->priv->links = g_list_delete_link (history->priv->links, history->priv->links); } - + g_signal_emit (history, signals[HISTORY_CHANGED], 0); } diff --git a/shell/ev-history.h b/shell/ev-history.h index d8bb53f5..27096c3f 100644 --- a/shell/ev-history.h +++ b/shell/ev-history.h @@ -40,7 +40,7 @@ typedef struct _EvHistoryClass EvHistoryClass; struct _EvHistory { GObject parent; - + /*< private >*/ EvHistoryPrivate *priv; }; @@ -48,7 +48,7 @@ struct _EvHistory struct _EvHistoryClass { GObjectClass parent_class; - + void (*changed) (EvHistory *history); }; diff --git a/shell/ev-keyring.c b/shell/ev-keyring.c index 3a9cd4c1..c4670d63 100644 --- a/shell/ev-keyring.c +++ b/shell/ev-keyring.c @@ -85,7 +85,7 @@ ev_keyring_save_password (const gchar *uri, unescaped_uri = g_uri_unescape_string (uri, NULL); name = g_strdup_printf (_("Password for document %s"), unescaped_uri); g_free (unescaped_uri); - + retval = secret_password_store_sync (EV_DOCUMENT_PASSWORD_SCHEMA, keyring, name, password, NULL, NULL, "type", "document_password", diff --git a/shell/ev-media-player-keys.c b/shell/ev-media-player-keys.c index e7d950c1..a3388f98 100644 --- a/shell/ev-media-player-keys.c +++ b/shell/ev-media-player-keys.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * Copyright (C) 2007 Jan Arne Petersen * Copyright (C) 2008 Bastien Nocera * Copyright © 2010 Christian Persch @@ -206,7 +206,7 @@ ev_media_player_keys_focused (EvMediaPlayerKeys *keys) { if (keys->proxy == NULL) return; - + ev_media_player_keys_grab_keys (keys); } diff --git a/shell/ev-media-player-keys.h b/shell/ev-media-player-keys.h index 8e2d62be..f18f192a 100644 --- a/shell/ev-media-player-keys.h +++ b/shell/ev-media-player-keys.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * Copyright (C) 2007 Jan Arne Petersen * Copyright (C) 2008 Bastien Nocera * diff --git a/shell/ev-message-area.c b/shell/ev-message-area.c index 8764411e..f6561f22 100644 --- a/shell/ev-message-area.c +++ b/shell/ev-message-area.c @@ -33,7 +33,7 @@ struct _EvMessageAreaPrivate { GtkWidget *image; GtkWidget *label; GtkWidget *secondary_label; - + guint message_type : 3; }; @@ -305,7 +305,7 @@ ev_message_area_set_image_from_stock (EvMessageArea *area, { g_return_if_fail (EV_IS_MESSAGE_AREA (area)); g_return_if_fail (icon_name != NULL); - + gtk_image_set_from_icon_name (GTK_IMAGE (area->priv->image), icon_name, GTK_ICON_SIZE_DIALOG); diff --git a/shell/ev-navigation-action-widget.c b/shell/ev-navigation-action-widget.c index 430d4e33..758cc820 100644 --- a/shell/ev-navigation-action-widget.c +++ b/shell/ev-navigation-action-widget.c @@ -27,7 +27,7 @@ static void ev_navigation_action_widget_init (EvNavigationActionWidget static void ev_navigation_action_widget_class_init (EvNavigationActionWidgetClass *action_widget); static void ev_navigation_action_widget_toggled (GtkToggleToolButton *toggle); static gboolean ev_navigation_action_widget_button_press_event (GtkWidget *widget, - GdkEventButton *event, + GdkEventButton *event, gpointer data); G_DEFINE_TYPE (EvNavigationActionWidget, ev_navigation_action_widget, GTK_TYPE_TOGGLE_TOOL_BUTTON) @@ -44,14 +44,14 @@ static void ev_navigation_action_widget_init (EvNavigationActionWidget *action_widget) { GtkWidget *toggle_button; - + /* It's rather dirty hack but we need a child to connect to * button press event */ - + toggle_button = gtk_bin_get_child (GTK_BIN (action_widget)); - - g_signal_connect (toggle_button, "button-press-event", + + g_signal_connect (toggle_button, "button-press-event", G_CALLBACK (ev_navigation_action_widget_button_press_event), action_widget); return; @@ -81,7 +81,7 @@ menu_deactivate_cb (GtkMenuShell *menu_shell, gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (widget), FALSE); return TRUE; } - + static void menu_detacher (GtkWidget *widget, GtkMenu *menu) @@ -97,13 +97,13 @@ ev_navigation_action_widget_set_menu(EvNavigationActionWidget *button, GtkWidget if (button->menu == GTK_MENU (menu)) return; - + if (button->menu && gtk_widget_get_visible (GTK_WIDGET (button->menu))) gtk_menu_shell_deactivate (GTK_MENU_SHELL (button->menu)); if (button->menu) { - g_signal_handlers_disconnect_by_func (button->menu, - menu_deactivate_cb, + g_signal_handlers_disconnect_by_func (button->menu, + menu_deactivate_cb, button); gtk_menu_detach (button->menu); } diff --git a/shell/ev-navigation-action-widget.h b/shell/ev-navigation-action-widget.h index 4241cd31..20702c6f 100644 --- a/shell/ev-navigation-action-widget.h +++ b/shell/ev-navigation-action-widget.h @@ -36,7 +36,7 @@ struct _EvNavigationActionWidget struct _EvNavigationActionWidgetClass { GtkToggleToolButtonClass parent_class; - + void (*show_menu) (EvNavigationActionWidget *widget); }; diff --git a/shell/ev-navigation-action.c b/shell/ev-navigation-action.c index b34c3789..45e744ee 100644 --- a/shell/ev-navigation-action.c +++ b/shell/ev-navigation-action.c @@ -54,7 +54,7 @@ ev_navigation_action_history_changed (EvHistory *history, gpointer data) { EvNavigationAction *action = EV_NAVIGATION_ACTION (data); - + gtk_action_set_sensitive (GTK_ACTION (action), ev_history_get_n_links (history) > 0); } @@ -67,7 +67,7 @@ ev_navigation_action_set_history (EvNavigationAction *action, g_object_add_weak_pointer (G_OBJECT (action->priv->history), (gpointer) &action->priv->history); - + g_signal_connect_object (history, "changed", G_CALLBACK (ev_navigation_action_history_changed), action, 0); @@ -81,12 +81,12 @@ activate_menu_item_cb (GtkWidget *widget, EvNavigationAction *action) g_return_if_fail (EV_IS_HISTORY (action->priv->history)); index = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "index")); - + if (action->priv->history) { EvLink *link; link = ev_history_get_link_nth (action->priv->history, index); - + g_signal_emit (action, widget_signals[WIDGET_ACTIVATE_LINK], 0, link); } } @@ -197,7 +197,7 @@ create_menu_item (GtkAction *action) gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), menu); gtk_widget_show (menu_item); - + return menu_item; } diff --git a/shell/ev-navigation-action.h b/shell/ev-navigation-action.h index 8089e4f4..55a3c40d 100644 --- a/shell/ev-navigation-action.h +++ b/shell/ev-navigation-action.h @@ -42,7 +42,7 @@ typedef struct _EvNavigationActionClass EvNavigationActionClass; struct _EvNavigationAction { GtkAction parent; - + /*< private >*/ EvNavigationActionPrivate *priv; }; diff --git a/shell/ev-open-recent-action.c b/shell/ev-open-recent-action.c index 47da1d53..d7815d2a 100644 --- a/shell/ev-open-recent-action.c +++ b/shell/ev-open-recent-action.c @@ -95,7 +95,7 @@ ev_open_recent_action_class_init (EvOpenRecentActionClass *class) G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (EvOpenRecentActionClass, item_activated), NULL, NULL, - g_cclosure_marshal_VOID__STRING, + g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); } diff --git a/shell/ev-password-view.c b/shell/ev-password-view.c index 0bf8ea90..7f1b98b0 100644 --- a/shell/ev-password-view.c +++ b/shell/ev-password-view.c @@ -140,7 +140,7 @@ ev_password_view_init (EvPasswordView *password_view) _("This document is locked and can only be read by entering the correct password.")); gtk_label_set_markup (GTK_LABEL (label), markup); g_free (markup); - + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); @@ -189,15 +189,15 @@ ev_password_dialog_got_response (GtkDialog *dialog, EvPasswordView *password_view) { gtk_widget_set_sensitive (GTK_WIDGET (password_view), TRUE); - + if (response_id == GTK_RESPONSE_OK) { g_free (password_view->priv->password); password_view->priv->password = g_strdup (gtk_entry_get_text (GTK_ENTRY (password_view->priv->password_entry))); - + g_signal_emit (password_view, password_view_signals[UNLOCK], 0); } - + gtk_widget_destroy (GTK_WIDGET (dialog)); } @@ -207,7 +207,7 @@ ev_password_dialog_remember_button_toggled (GtkToggleButton *button, { if (gtk_toggle_button_get_active (button)) { gpointer data; - + data = g_object_get_data (G_OBJECT (button), "password-save"); password_view->priv->password_save = GPOINTER_TO_INT (data); } @@ -243,7 +243,7 @@ ev_password_view_ask_password (EvPasswordView *password_view) gchar *text, *markup, *file_name; gtk_widget_set_sensitive (GTK_WIDGET (password_view), FALSE); - + dialog = GTK_DIALOG (gtk_dialog_new ()); content_area = gtk_dialog_get_content_area (dialog); action_area = gtk_dialog_get_action_area (dialog); @@ -267,7 +267,7 @@ ev_password_view_ask_password (EvPasswordView *password_view) gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK); gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); - + /* Build contents */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); @@ -341,7 +341,7 @@ ev_password_view_ask_password (EvPasswordView *password_view) gtk_grid_attach (GTK_GRID (grid), password_view->priv->password_entry, 1, 0, 1, 1); gtk_widget_set_hexpand (password_view->priv->password_entry, TRUE); gtk_widget_show (password_view->priv->password_entry); - + gtk_label_set_mnemonic_widget (GTK_LABEL (label), password_view->priv->password_entry); @@ -394,7 +394,7 @@ ev_password_view_ask_password (EvPasswordView *password_view) g_signal_connect (dialog, "response", G_CALLBACK (ev_password_dialog_got_response), password_view); - + gtk_widget_show (GTK_WIDGET (dialog)); } diff --git a/shell/ev-password-view.h b/shell/ev-password-view.h index 05a4a445..326e8c73 100644 --- a/shell/ev-password-view.h +++ b/shell/ev-password-view.h @@ -35,7 +35,7 @@ typedef struct _EvPasswordViewPrivate EvPasswordViewPrivate; struct _EvPasswordView { GtkViewport parent_instance; - + EvPasswordViewPrivate *priv; }; diff --git a/shell/ev-progress-message-area.c b/shell/ev-progress-message-area.c index 6ac9f245..88a7e333 100644 --- a/shell/ev-progress-message-area.c +++ b/shell/ev-progress-message-area.c @@ -80,13 +80,13 @@ ev_progress_message_area_init (EvProgressMessageArea *area) { GtkWidget *contents; GtkWidget *vbox; - + area->priv = EV_PROGRESS_MESSAGE_AREA_GET_PRIVATE (area); contents = _ev_message_area_get_main_box (EV_MESSAGE_AREA (area)); - + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); - + area->priv->label = gtk_label_new (NULL); gtk_label_set_use_markup (GTK_LABEL (area->priv->label), TRUE); gtk_label_set_ellipsize (GTK_LABEL (area->priv->label), @@ -191,7 +191,7 @@ ev_progress_message_area_set_fraction (EvProgressMessageArea *area, gdouble fraction) { g_return_if_fail (EV_IS_PROGRESS_MESSAGE_AREA (area)); - + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (area->priv->progress_bar), fraction); g_object_notify (G_OBJECT (area), "fraction"); diff --git a/shell/ev-properties-dialog.c b/shell/ev-properties-dialog.c index 4ad1220b..cbb7b0f7 100644 --- a/shell/ev-properties-dialog.c +++ b/shell/ev-properties-dialog.c @@ -66,7 +66,7 @@ ev_properties_dialog_init (EvPropertiesDialog *properties) gtk_dialog_add_button (GTK_DIALOG (properties), "gtk-close", GTK_RESPONSE_CANCEL); - gtk_dialog_set_default_response (GTK_DIALOG (properties), + gtk_dialog_set_default_response (GTK_DIALOG (properties), GTK_RESPONSE_CANCEL); properties->notebook = gtk_notebook_new (); diff --git a/shell/ev-properties-fonts.c b/shell/ev-properties-fonts.c index d62ed6eb..5ee22b8a 100644 --- a/shell/ev-properties-fonts.c +++ b/shell/ev-properties-fonts.c @@ -55,12 +55,12 @@ ev_properties_fonts_dispose (GObject *object) EvPropertiesFonts *properties = EV_PROPERTIES_FONTS (object); if (properties->fonts_job) { - g_signal_handlers_disconnect_by_func (properties->fonts_job, - job_fonts_finished_cb, + g_signal_handlers_disconnect_by_func (properties->fonts_job, + job_fonts_finished_cb, properties); ev_job_cancel (properties->fonts_job); - g_object_unref (properties->fonts_job); + g_object_unref (properties->fonts_job); properties->fonts_job = NULL; } @@ -86,7 +86,7 @@ font_cell_data_func (GtkTreeViewColumn *col, GtkCellRenderer *renderer, gtk_tree_model_get (model, iter, EV_DOCUMENT_FONTS_COLUMN_NAME, &name, EV_DOCUMENT_FONTS_COLUMN_DETAILS, &details, - -1); + -1); if (details) { markup = g_strdup_printf ("%s\n%s", @@ -96,7 +96,7 @@ font_cell_data_func (GtkTreeViewColumn *col, GtkCellRenderer *renderer, } g_object_set (renderer, "markup", markup, NULL); - + g_free (markup); g_free (details); g_free (name); @@ -112,14 +112,14 @@ ev_properties_fonts_init (EvPropertiesFonts *properties) gtk_orientable_set_orientation (GTK_ORIENTABLE (properties), GTK_ORIENTATION_VERTICAL); gtk_container_set_border_width (GTK_CONTAINER (properties), 12); gtk_box_set_spacing (GTK_BOX (properties), 6); - + swindow = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swindow), GTK_SHADOW_IN); - + properties->fonts_treeview = gtk_tree_view_new (); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (properties->fonts_treeview), FALSE); @@ -141,7 +141,7 @@ ev_properties_fonts_init (EvPropertiesFonts *properties) gtk_container_add (GTK_CONTAINER (swindow), properties->fonts_treeview); gtk_widget_show (properties->fonts_treeview); - gtk_box_pack_start (GTK_BOX (properties), swindow, + gtk_box_pack_start (GTK_BOX (properties), swindow, TRUE, TRUE, 0); gtk_widget_show (swindow); diff --git a/shell/ev-sidebar-attachments.c b/shell/ev-sidebar-attachments.c index a7c60f3f..c485c3fc 100644 --- a/shell/ev-sidebar-attachments.c +++ b/shell/ev-sidebar-attachments.c @@ -73,8 +73,8 @@ static void ev_sidebar_attachments_page_iface_init (EvSidebarPageInterface *ifac G_DEFINE_TYPE_EXTENDED (EvSidebarAttachments, ev_sidebar_attachments, GTK_TYPE_BOX, - 0, - G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, + 0, + G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, ev_sidebar_attachments_page_iface_init)) #define EV_SIDEBAR_ATTACHMENTS_GET_PRIVATE(object) \ @@ -92,7 +92,7 @@ ev_sidebar_attachments_icon_cache_add (EvSidebarAttachments *ev_attachbar, g_hash_table_insert (ev_attachbar->priv->icon_cache, (gpointer)g_strdup (mime_type), (gpointer)pixbuf); - + } static GdkPixbuf * @@ -115,12 +115,12 @@ icon_theme_get_pixbuf_from_mime_type (GtkIconTheme *icon_theme, g_string_free (icon_name, TRUE); if (pixbuf) return pixbuf; - + icon_name = g_string_new ("mate-mime-"); g_string_append_len (icon_name, mime_type, separator - mime_type); pixbuf = gtk_icon_theme_load_icon (icon_theme, icon_name->str, 48, 0, NULL); g_string_free (icon_name, TRUE); - + return pixbuf; } @@ -129,7 +129,7 @@ ev_sidebar_attachments_icon_cache_get (EvSidebarAttachments *ev_attachbar, const gchar *mime_type) { GdkPixbuf *pixbuf = NULL; - + g_assert (mime_type != NULL); pixbuf = g_hash_table_lookup (ev_attachbar->priv->icon_cache, @@ -162,7 +162,7 @@ icon_cache_update_icon (gchar *key, ev_sidebar_attachments_icon_cache_add (ev_attachbar, key, pixbuf); - + return FALSE; } @@ -197,7 +197,7 @@ ev_sidebar_attachments_get_attachment_at_pos (EvSidebarAttachments *ev_attachbar gtk_icon_view_select_path (GTK_ICON_VIEW (ev_attachbar->priv->icon_view), path); - + gtk_tree_path_free (path); return attachment; @@ -214,7 +214,7 @@ ev_sidebar_attachments_popup_menu_show (EvSidebarAttachments *ev_attachbar, GList *attach_list = NULL; icon_view = GTK_ICON_VIEW (ev_attachbar->priv->icon_view); - + path = gtk_icon_view_get_path_at_pos (icon_view, x, y); if (!path) return FALSE; @@ -225,7 +225,7 @@ ev_sidebar_attachments_popup_menu_show (EvSidebarAttachments *ev_attachbar, } gtk_tree_path_free (path); - + selected = gtk_icon_view_get_selected_items (icon_view); if (!selected) return FALSE; @@ -277,7 +277,7 @@ ev_sidebar_attachments_button_press (EvSidebarAttachments *ev_attachbar, if (!gtk_widget_has_focus (icon_view)) { gtk_widget_grab_focus (icon_view); } - + if (event->button == 2) return FALSE; @@ -286,29 +286,29 @@ ev_sidebar_attachments_button_press (EvSidebarAttachments *ev_attachbar, if (event->type == GDK_2BUTTON_PRESS) { GError *error = NULL; EvAttachment *attachment; - + attachment = ev_sidebar_attachments_get_attachment_at_pos (ev_attachbar, event->x, event->y); if (!attachment) return FALSE; - + ev_attachment_open (attachment, gtk_widget_get_screen (GTK_WIDGET (ev_attachbar)), event->time, &error); - + if (error) { g_warning ("%s", error->message); g_error_free (error); } - + g_object_unref (attachment); - + return TRUE; } break; - case 3: + case 3: return ev_sidebar_attachments_popup_menu_show (ev_attachbar, event->x, event->y); } @@ -323,7 +323,7 @@ ev_sidebar_attachments_update_icons (EvSidebarAttachments *ev_attachbar, gboolean valid; ev_sidebar_attachments_icon_cache_refresh (ev_attachbar); - + valid = gtk_tree_model_get_iter_first ( GTK_TREE_MODEL (ev_attachbar->priv->model), &iter); @@ -364,7 +364,7 @@ ev_sidebar_attachments_screen_changed (GtkWidget *widget, if (!ev_attachbar->priv->icon_theme) return; - + screen = gtk_widget_get_screen (widget); if (screen == old_screen) return; @@ -405,7 +405,7 @@ ev_sidebar_attachments_drag_data_get (GtkWidget *widget, return; uris = g_ptr_array_new (); - + for (l = selected; l && l->data; l = g_list_next (l)) { EvAttachment *attachment; GtkTreePath *path; @@ -413,7 +413,7 @@ ev_sidebar_attachments_drag_data_get (GtkWidget *widget, GFile *file; gchar *template; GError *error = NULL; - + path = (GtkTreePath *) l->data; gtk_tree_model_get_iter (GTK_TREE_MODEL (ev_attachbar->priv->model), @@ -426,14 +426,14 @@ ev_sidebar_attachments_drag_data_get (GtkWidget *widget, template = g_strdup_printf ("%s.XXXXXX", ev_attachment_get_name (attachment)); file = ev_mkstemp_file (template, &error); g_free (template); - + if (file != NULL && ev_attachment_save (attachment, file, &error)) { gchar *uri; uri = g_file_get_uri (file); g_ptr_array_add (uris, uri); } - + if (error) { g_warning ("%s", error->message); g_error_free (error); @@ -459,7 +459,7 @@ ev_sidebar_attachments_get_property (GObject *object, GParamSpec *pspec) { EvSidebarAttachments *ev_sidebar_attachments; - + ev_sidebar_attachments = EV_SIDEBAR_ATTACHMENTS (object); switch (prop_id) { @@ -479,7 +479,7 @@ ev_sidebar_attachments_dispose (GObject *object) if (ev_attachbar->priv->icon_theme) { g_signal_handlers_disconnect_by_func ( - ev_attachbar->priv->icon_theme, + ev_attachbar->priv->icon_theme, G_CALLBACK (ev_sidebar_attachments_update_icons), ev_attachbar); ev_attachbar->priv->icon_theme = NULL; @@ -534,7 +534,7 @@ static void ev_sidebar_attachments_init (EvSidebarAttachments *ev_attachbar) { GtkWidget *swindow; - + ev_attachbar->priv = EV_SIDEBAR_ATTACHMENTS_GET_PRIVATE (ev_attachbar); gtk_orientable_set_orientation (GTK_ORIENTABLE (ev_attachbar), GTK_ORIENTATION_VERTICAL); @@ -546,8 +546,8 @@ ev_sidebar_attachments_init (EvSidebarAttachments *ev_attachbar) GTK_SHADOW_IN); /* Data Model */ ev_attachbar->priv->model = gtk_list_store_new (N_COLS, - GDK_TYPE_PIXBUF, - G_TYPE_STRING, + GDK_TYPE_PIXBUF, + G_TYPE_STRING, G_TYPE_STRING, EV_TYPE_ATTACHMENT); @@ -593,7 +593,7 @@ ev_sidebar_attachments_init (EvSidebarAttachments *ev_attachbar) g_signal_connect (ev_attachbar->priv->icon_view, "drag-data-get", G_CALLBACK (ev_sidebar_attachments_drag_data_get), - (gpointer) ev_attachbar); + (gpointer) ev_attachbar); } GtkWidget * @@ -611,7 +611,7 @@ job_finished_callback (EvJobAttachments *job, EvSidebarAttachments *ev_attachbar) { GList *l; - + for (l = job->attachments; l && l->data; l = g_list_next (l)) { EvAttachment *attachment; GtkTreeIter iter; @@ -628,7 +628,7 @@ job_finished_callback (EvJobAttachments *job, gtk_list_store_set (ev_attachbar->priv->model, &iter, COLUMN_NAME, ev_attachment_get_name (attachment), COLUMN_ICON, pixbuf, - COLUMN_ATTACHMENT, attachment, + COLUMN_ATTACHMENT, attachment, -1); } @@ -660,7 +660,7 @@ ev_sidebar_attachments_document_changed_cb (EvDocumentModel *model, G_CALLBACK (ev_sidebar_attachments_update_icons), (gpointer) ev_attachbar); } - + gtk_list_store_clear (ev_attachbar->priv->model); job = ev_job_attachments_new (document); diff --git a/shell/ev-sidebar-layers.c b/shell/ev-sidebar-layers.c index 6a723abb..28aad795 100644 --- a/shell/ev-sidebar-layers.c +++ b/shell/ev-sidebar-layers.c @@ -55,8 +55,8 @@ static guint signals[N_SIGNALS] = { 0 }; G_DEFINE_TYPE_EXTENDED (EvSidebarLayers, ev_sidebar_layers, GTK_TYPE_BOX, - 0, - G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, + 0, + G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, ev_sidebar_layers_page_iface_init)) #define EV_SIDEBAR_LAYERS_GET_PRIVATE(object) \ @@ -71,7 +71,7 @@ ev_sidebar_layers_dispose (GObject *object) g_signal_handlers_disconnect_by_func (sidebar->priv->job, job_finished_callback, sidebar); - ev_job_cancel (sidebar->priv->job); + ev_job_cancel (sidebar->priv->job); g_object_unref (sidebar->priv->job); sidebar->priv->job = NULL; } @@ -91,7 +91,7 @@ ev_sidebar_layers_get_property (GObject *object, GParamSpec *pspec) { EvSidebarLayers *ev_sidebar_layers; - + ev_sidebar_layers = EV_SIDEBAR_LAYERS (object); switch (prop_id) { @@ -188,18 +188,18 @@ ev_sidebar_layers_visibility_changed (GtkCellRendererToggle *cell, EvLayer *layer; model = gtk_tree_view_get_model (ev_layers->priv->tree_view); - + path = gtk_tree_path_new_from_string (path_str); gtk_tree_model_get_iter (model, &iter, path); gtk_tree_model_get (model, &iter, EV_DOCUMENT_LAYERS_COLUMN_VISIBLE, &visible, - EV_DOCUMENT_LAYERS_COLUMN_LAYER, &layer, + EV_DOCUMENT_LAYERS_COLUMN_LAYER, &layer, -1); - + visible = !visible; if (visible) { gint rb_group; - + ev_document_layers_show_layer (EV_DOCUMENT_LAYERS (ev_layers->priv->document), layer); @@ -213,7 +213,7 @@ ev_sidebar_layers_visibility_changed (GtkCellRendererToggle *cell, ev_document_layers_hide_layer (EV_DOCUMENT_LAYERS (ev_layers->priv->document), layer); } - + gtk_tree_store_set (GTK_TREE_STORE (model), &iter, EV_DOCUMENT_LAYERS_COLUMN_VISIBLE, visible, -1); @@ -223,7 +223,7 @@ ev_sidebar_layers_visibility_changed (GtkCellRendererToggle *cell, (GtkTreeModelForeachFunc)update_kids, &iter); } - + gtk_tree_path_free (path); g_signal_emit (ev_layers, signals[LAYERS_VISIBILITY_CHANGED], 0); @@ -235,7 +235,7 @@ ev_sidebar_layers_create_tree_view (EvSidebarLayers *ev_layers) GtkTreeView *tree_view; GtkTreeViewColumn *column; GtkCellRenderer *renderer; - + tree_view = GTK_TREE_VIEW (gtk_tree_view_new ()); gtk_tree_view_set_headers_visible (tree_view, FALSE); gtk_tree_selection_set_mode (gtk_tree_view_get_selection (tree_view), @@ -267,7 +267,7 @@ ev_sidebar_layers_create_tree_view (EvSidebarLayers *ev_layers) "sensitive", EV_DOCUMENT_LAYERS_COLUMN_ENABLED, NULL); g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL); - + gtk_tree_view_append_column (tree_view, column); return tree_view; @@ -278,7 +278,7 @@ ev_sidebar_layers_init (EvSidebarLayers *ev_layers) { GtkWidget *swindow; GtkTreeModel *model; - + ev_layers->priv = EV_SIDEBAR_LAYERS_GET_PRIVATE (ev_layers); gtk_orientable_set_orientation (GTK_ORIENTABLE (ev_layers), GTK_ORIENTATION_VERTICAL); @@ -384,7 +384,7 @@ job_finished_callback (EvJobLayers *job, priv = sidebar_layers->priv; gtk_tree_view_set_model (GTK_TREE_VIEW (priv->tree_view), job->model); - + g_object_unref (job); priv->job = NULL; } diff --git a/shell/ev-sidebar-links.c b/shell/ev-sidebar-links.c index a4473504..90a23269 100644 --- a/shell/ev-sidebar-links.c +++ b/shell/ev-sidebar-links.c @@ -80,11 +80,11 @@ static const gchar* ev_sidebar_links_get_label (EvSidebarPage *sidebar_page); static guint signals[N_SIGNALS] = { 0 }; -G_DEFINE_TYPE_EXTENDED (EvSidebarLinks, - ev_sidebar_links, +G_DEFINE_TYPE_EXTENDED (EvSidebarLinks, + ev_sidebar_links, GTK_TYPE_BOX, - 0, - G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, + 0, + G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, ev_sidebar_links_page_iface_init)) @@ -117,7 +117,7 @@ ev_sidebar_links_get_property (GObject *object, GParamSpec *pspec) { EvSidebarLinks *ev_sidebar_links; - + ev_sidebar_links = EV_SIDEBAR_LINKS (object); switch (prop_id) @@ -142,7 +142,7 @@ ev_sidebar_links_dispose (GObject *object) if (sidebar->priv->job) { g_signal_handlers_disconnect_by_func (sidebar->priv->job, job_finished_callback, sidebar); - ev_job_cancel (sidebar->priv->job); + ev_job_cancel (sidebar->priv->job); g_object_unref (sidebar->priv->job); sidebar->priv->job = NULL; } @@ -228,7 +228,7 @@ selection_changed_callback (GtkTreeSelection *selection, gtk_tree_model_get (model, &iter, EV_DOCUMENT_LINKS_COLUMN_LINK, &link, -1); - + if (link == NULL) return; @@ -298,7 +298,7 @@ print_section_cb (GtkWidget *menuitem, EvSidebarLinks *sidebar) g_object_unref (link); return; } - + first_page++; g_object_unref (link); @@ -317,7 +317,7 @@ print_section_cb (GtkWidget *menuitem, EvSidebarLinks *sidebar) if (last_page == -1) last_page = ev_document_get_n_pages (sidebar->priv->document); - + window = gtk_widget_get_toplevel (GTK_WIDGET (sidebar)); if (EV_IS_WINDOW (window)) { ev_window_print_range (EV_WINDOW (window), first_page, last_page); @@ -401,7 +401,7 @@ ev_sidebar_links_construct (EvSidebarLinks *ev_sidebar_links) loading_model = create_loading_model (); priv->tree_view = gtk_tree_view_new_with_model (loading_model); g_object_unref (loading_model); - + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree_view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->tree_view), FALSE); @@ -423,7 +423,7 @@ ev_sidebar_links_construct (EvSidebarLinks *ev_sidebar_links) "markup", EV_DOCUMENT_LINKS_COLUMN_MARKUP, NULL); - + renderer = gtk_cell_renderer_text_new (); gtk_tree_view_column_pack_end (GTK_TREE_VIEW_COLUMN (column), renderer, FALSE); gtk_tree_view_column_set_attributes (GTK_TREE_VIEW_COLUMN (column), renderer, @@ -486,15 +486,15 @@ update_page_callback_foreach (GtkTreeModel *model, dest_page = ev_document_links_get_link_page (document_links, link); g_object_unref (link); - + current_page = ev_document_model_get_page (sidebar_links->priv->doc_model); - + if (dest_page == current_page) { gtk_tree_view_expand_to_path (GTK_TREE_VIEW (sidebar_links->priv->tree_view), path); gtk_tree_view_set_cursor (GTK_TREE_VIEW (sidebar_links->priv->tree_view), path, NULL, FALSE); - + return TRUE; } } @@ -513,7 +513,7 @@ ev_sidebar_links_set_current_page (EvSidebarLinks *sidebar_links, /* Widget is not currently visible */ if (!gtk_widget_get_mapped (GTK_WIDGET (sidebar_links))) return; - + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (sidebar_links->priv->tree_view)); if (gtk_tree_selection_get_selected (selection, &model, &iter)) { @@ -528,11 +528,11 @@ ev_sidebar_links_set_current_page (EvSidebarLinks *sidebar_links, dest_page = ev_document_links_get_link_page (document_links, link); g_object_unref (link); - + if (dest_page == current_page) return; } - } + } /* We go through the tree linearly looking for the first page that * matches. This is pretty inefficient. We can do something neat with @@ -545,7 +545,7 @@ ev_sidebar_links_set_current_page (EvSidebarLinks *sidebar_links, gtk_tree_model_foreach (model, update_page_callback_foreach, sidebar_links); - + g_signal_handler_unblock (selection, sidebar_links->priv->selection_id); g_signal_handler_unblock (sidebar_links->priv->tree_view, sidebar_links->priv->row_activated_id); } @@ -558,7 +558,7 @@ update_page_callback (EvSidebarLinks *sidebar_links, ev_sidebar_links_set_current_page (sidebar_links, new_page); } -static void +static void row_activated_callback (GtkTreeView *treeview, GtkTreePath *arg1, GtkTreeViewColumn *arg2, @@ -584,7 +584,7 @@ expand_open_links (GtkTreeView *tree_view, GtkTreeModel *model, GtkTreeIter *par -1); if (expand) { GtkTreePath *path; - + path = gtk_tree_model_get_path (model, &iter); gtk_tree_view_expand_row (tree_view, path, FALSE); gtk_tree_path_free (path); @@ -621,7 +621,7 @@ job_finished_callback (EvJobLinks *job, ev_sidebar_links_set_links_model (sidebar_links, job->model); gtk_tree_view_set_model (GTK_TREE_VIEW (priv->tree_view), job->model); - + g_object_unref (job); priv->job = NULL; @@ -629,7 +629,7 @@ job_finished_callback (EvJobLinks *job, selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree_view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - + if (priv->selection_id <= 0) { priv->selection_id = g_signal_connect (selection, "changed", diff --git a/shell/ev-sidebar-links.h b/shell/ev-sidebar-links.h index 495a6f07..eb4ae8ff 100644 --- a/shell/ev-sidebar-links.h +++ b/shell/ev-sidebar-links.h @@ -1,6 +1,6 @@ /* ev-sidebar-links.h * this file is part of atril, a mate document viewer - * + * * Copyright (C) 2004 Red Hat, Inc. * * Author: diff --git a/shell/ev-sidebar-page.c b/shell/ev-sidebar-page.c index fdb8d4af..0b216bd8 100644 --- a/shell/ev-sidebar-page.c +++ b/shell/ev-sidebar-page.c @@ -28,7 +28,7 @@ G_DEFINE_INTERFACE (EvSidebarPage, ev_sidebar_page, 0) -gboolean +gboolean ev_sidebar_page_support_document (EvSidebarPage *sidebar_page, EvDocument *document) { @@ -40,8 +40,8 @@ ev_sidebar_page_support_document (EvSidebarPage *sidebar_page, iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page); g_return_val_if_fail (iface->support_document, FALSE); - - return iface->support_document (sidebar_page, document); + + return iface->support_document (sidebar_page, document); } void @@ -70,7 +70,7 @@ ev_sidebar_page_get_label (EvSidebarPage *sidebar_page) iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page); g_assert (iface->get_label); - + return iface->get_label (sidebar_page); } @@ -79,7 +79,7 @@ static void ev_sidebar_page_default_init (EvSidebarPageInterface *iface) { static gboolean initialized = FALSE; - + if (!initialized) { g_object_interface_install_property (iface, g_param_spec_object ("main-widget", diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index 3d17d692..905b95aa 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -99,11 +99,11 @@ static void thumbnail_job_completed_callback (EvJobThumbnail EvSidebarThumbnails *sidebar_thumbnails); static void adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails); -G_DEFINE_TYPE_EXTENDED (EvSidebarThumbnails, - ev_sidebar_thumbnails, +G_DEFINE_TYPE_EXTENDED (EvSidebarThumbnails, + ev_sidebar_thumbnails, GTK_TYPE_BOX, - 0, - G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, + 0, + G_IMPLEMENT_INTERFACE (EV_TYPE_SIDEBAR_PAGE, ev_sidebar_thumbnails_page_iface_init)) #define EV_SIDEBAR_THUMBNAILS_GET_PRIVATE(object) \ @@ -252,12 +252,12 @@ static void ev_sidebar_thumbnails_dispose (GObject *object) { EvSidebarThumbnails *sidebar_thumbnails = EV_SIDEBAR_THUMBNAILS (object); - + if (sidebar_thumbnails->priv->loading_icons) { g_hash_table_destroy (sidebar_thumbnails->priv->loading_icons); sidebar_thumbnails->priv->loading_icons = NULL; } - + if (sidebar_thumbnails->priv->list_store) { ev_sidebar_thumbnails_clear_model (sidebar_thumbnails); g_object_unref (sidebar_thumbnails->priv->list_store); @@ -296,7 +296,7 @@ ev_sidebar_thumbnails_map (GtkWidget *widget) sidebar = EV_SIDEBAR_THUMBNAILS (widget); GTK_WIDGET_CLASS (ev_sidebar_thumbnails_parent_class)->map (widget); - + adjustment_changed_cb (sidebar); } @@ -367,7 +367,7 @@ ev_sidebar_thumbnails_get_loading_icon (EvSidebarThumbnails *sidebar_thumbnails, } else { g_free (key); } - + return icon; } @@ -512,12 +512,12 @@ update_visible_range (EvSidebarThumbnails *sidebar_thumbnails, /* Clear the areas we no longer display */ if (old_start_page >= 0 && old_start_page < start_page) cancel_running_jobs (sidebar_thumbnails, old_start_page, MIN (start_page - 1, old_end_page)); - + if (old_end_page > 0 && old_end_page > end_page) cancel_running_jobs (sidebar_thumbnails, MAX (end_page + 1, old_start_page), old_end_page); add_range (sidebar_thumbnails, start_page, end_page); - + priv->start_page = start_page; priv->end_page = end_page; } @@ -543,7 +543,7 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails) return; value = gtk_adjustment_get_value (priv->vadjustment); - + if (priv->tree_view) { if (! gtk_widget_get_realized (priv->tree_view)) return; @@ -607,7 +607,7 @@ ev_sidebar_thumbnails_fill_model (EvSidebarThumbnails *sidebar_thumbnails) prev_width = width; prev_height = height; - + gtk_list_store_append (priv->list_store, &iter); gtk_list_store_set (priv->list_store, &iter, COLUMN_PAGE_STRING, page_string, @@ -775,7 +775,7 @@ ev_sidebar_thumbnails_init (EvSidebarThumbnails *ev_sidebar_thumbnails) GUINT_TO_POINTER (signal_id)); priv->swindow = gtk_scrolled_window_new (NULL, NULL); - + /* We actually don't want GTK_POLICY_AUTOMATIC for horizontal scrollbar here * it's just a workaround for bug #449462 (GTK2 only) */ @@ -999,29 +999,29 @@ ev_sidebar_thumbnails_set_model (EvSidebarPage *sidebar_page, } static gboolean -ev_sidebar_thumbnails_clear_job (GtkTreeModel *model, +ev_sidebar_thumbnails_clear_job (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) { EvJob *job; - + gtk_tree_model_get (model, iter, COLUMN_JOB, &job, -1); - + if (job != NULL) { ev_job_cancel (job); g_signal_handlers_disconnect_by_func (job, thumbnail_job_completed_callback, data); g_object_unref (job); } - - return FALSE; + + return FALSE; } -static void +static void ev_sidebar_thumbnails_clear_model (EvSidebarThumbnails *sidebar_thumbnails) { EvSidebarThumbnailsPrivate *priv = sidebar_thumbnails->priv; - + gtk_tree_model_foreach (GTK_TREE_MODEL (priv->list_store), ev_sidebar_thumbnails_clear_job, sidebar_thumbnails); gtk_list_store_clear (priv->list_store); } diff --git a/shell/ev-sidebar-thumbnails.h b/shell/ev-sidebar-thumbnails.h index b93d47eb..ed10ac39 100644 --- a/shell/ev-sidebar-thumbnails.h +++ b/shell/ev-sidebar-thumbnails.h @@ -1,6 +1,6 @@ /* ev-sidebar-thumbnails.h * this file is part of atril, a mate document viewer - * + * * Copyright (C) 2004 Red Hat, Inc. * * Author: diff --git a/shell/ev-sidebar.c b/shell/ev-sidebar.c index eb1b59ee..f5c6b83d 100644 --- a/shell/ev-sidebar.c +++ b/shell/ev-sidebar.c @@ -88,7 +88,7 @@ ev_sidebar_select_page (EvSidebar *ev_sidebar, GtkTreeIter *iter) int index; gtk_tree_model_get (ev_sidebar->priv->page_model, iter, - PAGE_COLUMN_TITLE, &title, + PAGE_COLUMN_TITLE, &title, PAGE_COLUMN_NOTEBOOK_INDEX, &index, -1); @@ -106,14 +106,14 @@ ev_sidebar_set_page (EvSidebar *ev_sidebar, gboolean valid; valid = gtk_tree_model_get_iter_first (ev_sidebar->priv->page_model, &iter); - + while (valid) { GtkWidget *widget; gtk_tree_model_get (ev_sidebar->priv->page_model, &iter, PAGE_COLUMN_MAIN_WIDGET, &widget, -1); - + if (widget == main_widget) { ev_sidebar_select_page (ev_sidebar, &iter); valid = FALSE; @@ -137,7 +137,7 @@ ev_sidebar_set_property (GObject *object, switch (prop_id) { case PROP_CURRENT_PAGE: - ev_sidebar_set_page (sidebar, g_value_get_object (value)); + ev_sidebar_set_page (sidebar, g_value_get_object (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -178,7 +178,7 @@ ev_sidebar_class_init (EvSidebarClass *ev_sidebar_class) g_object_class = G_OBJECT_CLASS (ev_sidebar_class); g_type_class_add_private (g_object_class, sizeof (EvSidebarPrivate)); - + g_object_class->dispose = ev_sidebar_dispose; g_object_class->get_property = ev_sidebar_get_property; g_object_class->set_property = ev_sidebar_set_property; @@ -210,9 +210,9 @@ ev_sidebar_select_button_press_cb (GtkWidget *widget, gtk_widget_get_preferred_size (ev_sidebar->priv->menu, &requisition, NULL); gtk_widget_set_size_request (ev_sidebar->priv->menu, MAX (width, requisition.width), -1); - + gtk_widget_grab_focus (widget); - + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); gtk_menu_popup_at_widget (GTK_MENU (ev_sidebar->priv->menu), widget, @@ -232,7 +232,7 @@ ev_sidebar_select_button_key_press_cb (GtkWidget *widget, gpointer user_data) { EvSidebar *ev_sidebar = EV_SIDEBAR (user_data); - + if (event->keyval == GDK_KEY_space || event->keyval == GDK_KEY_KP_Space || event->keyval == GDK_KEY_Return || @@ -265,7 +265,7 @@ ev_sidebar_menu_deactivate_cb (GtkWidget *widget, GtkWidget *menu_button; menu_button = GTK_WIDGET (user_data); - + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (menu_button), FALSE); } @@ -274,7 +274,7 @@ ev_sidebar_menu_detach_cb (GtkWidget *widget, GtkMenu *menu) { EvSidebar *ev_sidebar = EV_SIDEBAR (widget); - + ev_sidebar->priv->menu = NULL; } @@ -289,12 +289,12 @@ ev_sidebar_menu_item_activate_cb (GtkWidget *widget, menu_item = gtk_menu_get_active (GTK_MENU (ev_sidebar->priv->menu)); valid = gtk_tree_model_get_iter_first (ev_sidebar->priv->page_model, &iter); - + while (valid) { gtk_tree_model_get (ev_sidebar->priv->page_model, &iter, PAGE_COLUMN_MENU_ITEM, &item, -1); - + if (item == menu_item) { ev_sidebar_select_page (ev_sidebar, &iter); valid = FALSE; @@ -366,15 +366,15 @@ ev_sidebar_init (EvSidebar *ev_sidebar) g_signal_connect (close_button, "clicked", G_CALLBACK (ev_sidebar_close_clicked_cb), ev_sidebar); - + image = gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_MENU); gtk_container_add (GTK_CONTAINER (close_button), image); gtk_widget_show (image); - + gtk_box_pack_end (GTK_BOX (hbox), close_button, FALSE, FALSE, 0); gtk_widget_show (close_button); - + ev_sidebar->priv->menu = gtk_menu_new (); g_signal_connect (ev_sidebar->priv->menu, "deactivate", G_CALLBACK (ev_sidebar_menu_deactivate_cb), @@ -416,7 +416,7 @@ ev_sidebar_add_page (EvSidebar *ev_sidebar, gchar *label_title; const gchar *title; int index; - + g_return_if_fail (EV_IS_SIDEBAR (ev_sidebar)); g_return_if_fail (EV_IS_SIDEBAR_PAGE (main_widget)); g_return_if_fail (GTK_IS_WIDGET (main_widget)); @@ -424,10 +424,10 @@ ev_sidebar_add_page (EvSidebar *ev_sidebar, ev_sidebar_page_set_model (EV_SIDEBAR_PAGE (main_widget), ev_sidebar->priv->model); title = ev_sidebar_page_get_label (EV_SIDEBAR_PAGE (main_widget)); - + index = gtk_notebook_append_page (GTK_NOTEBOOK (ev_sidebar->priv->notebook), main_widget, NULL); - + menu_item = gtk_image_menu_item_new_with_label (title); g_signal_connect (menu_item, "activate", G_CALLBACK (ev_sidebar_menu_item_activate_cb), diff --git a/shell/ev-sidebar.h b/shell/ev-sidebar.h index 9fc5b39a..11d16632 100644 --- a/shell/ev-sidebar.h +++ b/shell/ev-sidebar.h @@ -1,6 +1,6 @@ /* ev-sidebar.h * this file is part of atril, a mate document viewer - * + * * Copyright (C) 2004 Red Hat, Inc. * * Author: diff --git a/shell/ev-utils.c b/shell/ev-utils.c index ebfca1ec..7c7aa845 100644 --- a/shell/ev-utils.c +++ b/shell/ev-utils.c @@ -26,14 +26,14 @@ #include #include -void +void file_chooser_dialog_add_writable_pixbuf_formats (GtkFileChooser *chooser) { GSList *pixbuf_formats = NULL; GSList *iter; GtkFileFilter *filter; int i; - + filter = gtk_file_filter_new(); gtk_file_filter_set_name (filter, _("By extension")); g_object_set_data (G_OBJECT(filter), "pixbuf-format", NULL); @@ -87,7 +87,7 @@ get_gdk_pixbuf_format_by_extension (gchar *uri) for (iter = pixbuf_formats; iter; iter = iter->next) { gchar **extension_list; GdkPixbufFormat *format = iter->data; - + if (gdk_pixbuf_format_is_disabled (format) || !gdk_pixbuf_format_is_writable (format)) continue; diff --git a/shell/ev-window-title.c b/shell/ev-window-title.c index 7b8c45e8..f200f849 100644 --- a/shell/ev-window-title.c +++ b/shell/ev-window-title.c @@ -74,7 +74,7 @@ get_filename_from_uri (const char *uri) { char *filename; char *basename; - + filename = g_uri_unescape_string (uri, NULL); basename = g_path_get_basename (filename); g_free(filename); @@ -92,7 +92,7 @@ ev_window_title_sanitize_title (EvWindowTitle *window_title, char **title) { backend = ev_backends_manager_get_document_module_name (window_title->document); for (i = 0; i < G_N_ELEMENTS (bad_extensions); i++) { - if (g_ascii_strcasecmp (bad_extensions[i].backend, backend) == 0 && + if (g_ascii_strcasecmp (bad_extensions[i].backend, backend) == 0 && g_str_has_suffix (*title, bad_extensions[i].text)) { char *new_title; char *filename = get_filename_from_uri (window_title->uri); @@ -109,7 +109,7 @@ ev_window_title_sanitize_title (EvWindowTitle *window_title, char **title) { g_str_has_prefix (*title, bad_prefixes[i].text)) { char *new_title; int len = strlen(bad_prefixes[i].text); - + new_title = g_strdup_printf ("%s", (*title) + len); g_free (*title); *title = new_title; diff --git a/shell/ev-window.c b/shell/ev-window.c index 24e84536..b5ecc8a3 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -204,7 +204,7 @@ struct _EvWindowPrivate { gboolean in_reload; EvFileMonitor *monitor; guint setup_document_idle; - + EvDocument *document; EvHistory *history; EvWindowPageMode page_mode; @@ -354,16 +354,16 @@ static void ev_view_popup_cmd_remove_annotation (GtkAction *actio EvWindow *window); static void ev_attachment_popup_cmd_open_attachment (GtkAction *action, EvWindow *window); -static void ev_attachment_popup_cmd_save_attachment_as (GtkAction *action, +static void ev_attachment_popup_cmd_save_attachment_as (GtkAction *action, EvWindow *window); static void ev_window_cmd_view_fit_page (GtkAction *action, EvWindow *ev_window); static void ev_window_cmd_view_fit_width (GtkAction *action, EvWindow *ev_window); -static void ev_window_cmd_view_expand_window (GtkAction *action, +static void ev_window_cmd_view_expand_window (GtkAction *action, EvWindow *ev_window); -static void view_handle_link_cb (EvView *view, - EvLink *link, +static void view_handle_link_cb (EvView *view, + EvLink *link, EvWindow *window); static void ev_window_update_find_status_message (EvWindow *ev_window); static void ev_window_cmd_edit_find (GtkAction *action, @@ -493,7 +493,7 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window) ev_window_set_action_sensitive (ev_window, "EditRotateRight", has_pages && !(document->iswebdocument)); /* View menu */ - /*If it has pages it is a document, so our check for a webdocument won't lead to a crash. We need to switch these view modes off since more than one + /*If it has pages it is a document, so our check for a webdocument won't lead to a crash. We need to switch these view modes off since more than one *webview is hard to manage, and would lead to unexpected behaviour in case the number of webviews gets too large. */ ev_window_set_action_sensitive (ev_window, "ViewContinuous", has_pages && !(document->iswebdocument)); @@ -526,7 +526,7 @@ ev_window_update_actions (EvWindow *ev_window) EvWebView *webview = NULL; #endif EvView *view = NULL; - + int n_pages = 0, page = -1; gboolean has_pages = FALSE; gboolean presentation_mode; @@ -548,7 +548,7 @@ ev_window_update_actions (EvWindow *ev_window) { view = EV_VIEW (ev_window->priv->view); } - + can_find_in_page = (ev_window->priv->find_job && ev_job_find_has_results (EV_JOB_FIND (ev_window->priv->find_job))); if (view) { @@ -575,7 +575,7 @@ ev_window_update_actions (EvWindow *ev_window) has_pages && can_find_in_page); presentation_mode = EV_WINDOW_IS_PRESENTATION (ev_window); - + if (ev_window->priv->document && ev_window->priv->document->iswebdocument == FALSE ) { ev_window_set_action_sensitive (ev_window, "ViewZoomIn", has_pages && @@ -650,7 +650,7 @@ static void set_widget_visibility (GtkWidget *widget, gboolean visible) { g_assert (GTK_IS_WIDGET (widget)); - + if (visible) gtk_widget_show (widget); else @@ -669,18 +669,18 @@ update_chrome_visibility (EvWindow *window) fullscreen_mode = fullscreen || presentation; menubar = (priv->chrome & EV_CHROME_MENUBAR) != 0 && !fullscreen_mode; - toolbar = ((priv->chrome & EV_CHROME_TOOLBAR) != 0 || + toolbar = ((priv->chrome & EV_CHROME_TOOLBAR) != 0 || (priv->chrome & EV_CHROME_RAISE_TOOLBAR) != 0) && !fullscreen_mode; - fullscreen_toolbar = ((priv->chrome & EV_CHROME_FULLSCREEN_TOOLBAR) != 0 || + fullscreen_toolbar = ((priv->chrome & EV_CHROME_FULLSCREEN_TOOLBAR) != 0 || (priv->chrome & EV_CHROME_RAISE_TOOLBAR) != 0) && fullscreen; findbar = (priv->chrome & EV_CHROME_FINDBAR) != 0; sidebar = (priv->chrome & EV_CHROME_SIDEBAR) != 0 && priv->document && !presentation; - set_widget_visibility (priv->menubar, menubar); + set_widget_visibility (priv->menubar, menubar); set_widget_visibility (priv->toolbar, toolbar); set_widget_visibility (priv->find_bar, findbar); set_widget_visibility (priv->sidebar, sidebar); - + ev_window_set_action_sensitive (window, "EditToolbar", toolbar); if (priv->fullscreen_toolbar != NULL) { @@ -692,7 +692,7 @@ static void update_chrome_flag (EvWindow *window, EvChrome flag, gboolean active) { EvWindowPrivate *priv = window->priv; - + if (active) { priv->chrome |= flag; } else { @@ -728,21 +728,21 @@ update_sizing_buttons (EvWindow *window) g_signal_handlers_unblock_by_func (action, G_CALLBACK (ev_window_cmd_view_fit_page), window); - action = gtk_action_group_get_action (action_group, "ViewFitWidth"); + action = gtk_action_group_get_action (action_group, "ViewFitWidth"); g_signal_handlers_block_by_func (action, G_CALLBACK (ev_window_cmd_view_fit_width), window); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), fit_width); g_signal_handlers_unblock_by_func (action, G_CALLBACK (ev_window_cmd_view_fit_width), window); - action = gtk_action_group_get_action (window->priv->action_group, - ZOOM_CONTROL_ACTION); + action = gtk_action_group_get_action (window->priv->action_group, + ZOOM_CONTROL_ACTION); if (fit_page) { - ephy_zoom_action_set_zoom_level (EPHY_ZOOM_ACTION (action), + ephy_zoom_action_set_zoom_level (EPHY_ZOOM_ACTION (action), EPHY_ZOOM_FIT_PAGE); } else if (fit_width) { if (!window->priv->document || (window->priv->document && !window->priv->document->iswebdocument)) { - ephy_zoom_action_set_zoom_level (EPHY_ZOOM_ACTION (action), + ephy_zoom_action_set_zoom_level (EPHY_ZOOM_ACTION (action), EPHY_ZOOM_FIT_WIDTH); } } @@ -779,7 +779,7 @@ ev_window_is_empty (const EvWindow *ev_window) { g_return_val_if_fail (EV_IS_WINDOW (ev_window), FALSE); - return (ev_window->priv->document == NULL) && + return (ev_window->priv->document == NULL) && (ev_window->priv->load_job == NULL); } @@ -830,14 +830,14 @@ ev_window_error_message (EvWindow *window, va_start (args, format); msg = g_strdup_vprintf (format, args); va_end (args); - + area = ev_message_area_new (GTK_MESSAGE_ERROR, msg, "gtk-close", GTK_RESPONSE_CLOSE, NULL); g_free (msg); - + if (error) ev_message_area_set_secondary_text (EV_MESSAGE_AREA (area), error->message); g_signal_connect (area, "response", @@ -869,7 +869,7 @@ ev_window_warning_message (EvWindow *window, GTK_RESPONSE_CLOSE, NULL); g_free (msg); - + g_signal_connect (area, "response", G_CALLBACK (ev_window_message_area_response_cb), window); @@ -918,14 +918,14 @@ ev_window_find_page_title (GtkTreeModel *tree_model, PageTitleData *data) { gchar *page_string; - + gtk_tree_model_get (tree_model, iter, - EV_DOCUMENT_LINKS_COLUMN_PAGE_LABEL, &page_string, + EV_DOCUMENT_LINKS_COLUMN_PAGE_LABEL, &page_string, -1); - + if (!page_string) return FALSE; - + if (!strcmp (page_string, data->page_label)) { gtk_tree_model_get (tree_model, iter, EV_DOCUMENT_LINKS_COLUMN_MARKUP, &data->page_title, @@ -933,7 +933,7 @@ ev_window_find_page_title (GtkTreeModel *tree_model, g_free (page_string); return TRUE; } - + g_free (page_string); return FALSE; } @@ -976,13 +976,13 @@ ev_window_add_history (EvWindow *window, gint page, EvLink *link) EvLink *real_link; EvLinkAction *action; EvLinkDest *dest; - + if (window->priv->history == NULL) return; if (!EV_IS_DOCUMENT_LINKS (window->priv->document)) return; - + if (link) { action = g_object_ref (ev_link_get_action (link)); dest = ev_link_action_get_dest (action); @@ -1005,7 +1005,7 @@ ev_window_add_history (EvWindow *window, gint page, EvLink *link) } real_link = ev_link_new (link_title, action); - + ev_history_add_link (window->priv->history, real_link); g_free (link_title); @@ -1017,7 +1017,7 @@ static void view_handle_link_cb (EvView *view, EvLink *link, EvWindow *window) { int current_page = ev_document_model_get_page (window->priv->model); - + ev_window_add_history (window, 0, link); ev_window_add_history (window, current_page, NULL); } @@ -1530,7 +1530,7 @@ ev_window_clear_thumbnail_job (EvWindow *ev_window) if (ev_window->priv->thumbnail_job != NULL) { if (!ev_job_is_finished (ev_window->priv->thumbnail_job)) ev_job_cancel (ev_window->priv->thumbnail_job); - + g_signal_handlers_disconnect_by_func (ev_window->priv->thumbnail_job, ev_window_set_icon_from_thumbnail, ev_window); @@ -1659,9 +1659,9 @@ ev_window_setup_document (EvWindow *ev_window) ev_window->priv->setup_document_idle = 0; ev_window_refresh_window_thumbnail (ev_window); - + ev_window_set_page_mode (ev_window, PAGE_MODE_DOCUMENT); - + ev_window_title_set_document (ev_window->priv->title, document); ev_window_title_set_uri (ev_window->priv->title, ev_window->priv->uri); @@ -1686,13 +1686,13 @@ ev_window_setup_document (EvWindow *ev_window) ev_window->priv->history = ev_history_new (); action = gtk_action_group_get_action (ev_window->priv->action_group, NAVIGATION_ACTION); ev_navigation_action_set_history (EV_NAVIGATION_ACTION (action), ev_window->priv->history); - + if (ev_window->priv->properties) { ev_properties_dialog_set_document (EV_PROPERTIES_DIALOG (ev_window->priv->properties), ev_window->priv->uri, ev_window->priv->document); } - + info = ev_document_get_info (document); update_document_mode (ev_window, info->mode); @@ -1744,18 +1744,18 @@ ev_window_set_document (EvWindow *ev_window, EvDocument *document) } #if ENABLE_EPUB - if (document->iswebdocument == TRUE && + if (document->iswebdocument == TRUE && ev_window->priv->view != NULL) { /*We have encountered a web document, replace the atril view with a web view, if the web view is not already loaded.*/ gtk_container_remove (GTK_CONTAINER(ev_window->priv->scrolled_window), ev_window->priv->view); ev_view_disconnect_handlers(EV_VIEW(ev_window->priv->view)); - g_object_unref(ev_window->priv->view); + g_object_unref(ev_window->priv->view); ev_window->priv->view = NULL; gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window), ev_window->priv->webview); - gtk_widget_show(ev_window->priv->webview); + gtk_widget_show(ev_window->priv->webview); } else if(ev_window->priv->webview != NULL && document->iswebdocument == FALSE) { /*Since the document is not a webdocument might as well get rid of the webview now*/ @@ -1801,7 +1801,7 @@ static void ev_window_password_view_unlock (EvWindow *ev_window) { const gchar *password; - + g_assert (ev_window->priv->load_job); password = ev_password_view_get_password (EV_PASSWORD_VIEW (ev_window->priv->password_view)); @@ -1815,7 +1815,7 @@ ev_window_clear_load_job (EvWindow *ev_window) if (ev_window->priv->load_job != NULL) { if (!ev_job_is_finished (ev_window->priv->load_job)) ev_job_cancel (ev_window->priv->load_job); - + g_signal_handlers_disconnect_by_func (ev_window->priv->load_job, ev_window_load_job_cb, ev_window); g_object_unref (ev_window->priv->load_job); ev_window->priv->load_job = NULL; @@ -1828,7 +1828,7 @@ ev_window_clear_reload_job (EvWindow *ev_window) if (ev_window->priv->reload_job != NULL) { if (!ev_job_is_finished (ev_window->priv->reload_job)) ev_job_cancel (ev_window->priv->reload_job); - + g_signal_handlers_disconnect_by_func (ev_window->priv->reload_job, ev_window_reload_job_cb, ev_window); g_object_unref (ev_window->priv->reload_job); ev_window->priv->reload_job = NULL; @@ -1883,7 +1883,7 @@ ev_window_load_job_cb (EvJob *job, ev_window_hide_loading_message (ev_window); /* Success! */ - if (!ev_job_is_failed (job)) { + if (!ev_job_is_failed (job)) { ev_document_model_set_document (ev_window->priv->model, document); #ifdef ENABLE_DBUS @@ -1931,16 +1931,16 @@ ev_window_load_job_cb (EvJob *job, g_signal_connect_swapped (ev_window->priv->monitor, "changed", G_CALLBACK (ev_window_document_changed), ev_window); - + ev_window_clear_load_job (ev_window); return; } if (g_error_matches (job->error, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_ENCRYPTED)) { gchar *password; - + setup_view_from_metadata (ev_window); - + /* First look whether password is in keyring */ password = ev_keyring_lookup_password (ev_window->priv->uri); if (password) { @@ -1972,10 +1972,10 @@ ev_window_load_job_cb (EvJob *job, ev_job_load_set_password (job_load, NULL); ev_password_view_ask_password (EV_PASSWORD_VIEW (ev_window->priv->password_view)); } else { - ev_window_error_message (ev_window, job->error, + ev_window_error_message (ev_window, job->error, "%s", _("Unable to open document")); ev_window_clear_load_job (ev_window); - } + } } static void @@ -2012,7 +2012,7 @@ ev_window_reload_job_cb (EvJob *job, find_bar_search_changed_cb (EGG_FIND_BAR (ev_window->priv->find_bar), NULL, ev_window); } - + ev_window_clear_reload_job (ev_window); ev_window->priv->in_reload = FALSE; } @@ -2044,7 +2044,7 @@ ev_window_close_dialogs (EvWindow *ev_window) if (ev_window->priv->print_dialog) gtk_widget_destroy (ev_window->priv->print_dialog); ev_window->priv->print_dialog = NULL; - + if (ev_window->priv->properties) gtk_widget_destroy (ev_window->priv->properties); ev_window->priv->properties = NULL; @@ -2097,13 +2097,13 @@ ev_window_progress_response_cb (EvProgressMessageArea *area, ev_window_set_message_area (ev_window, NULL); } -static gboolean +static gboolean show_loading_progress (EvWindow *ev_window) { GtkWidget *area; gchar *text; gchar *display_name; - + if (ev_window->priv->message_area) return FALSE; @@ -2137,10 +2137,10 @@ ev_window_load_remote_failed (EvWindow *ev_window, GError *error) { if ( !ev_window->priv->view ) return; - + ev_window_hide_loading_message (ev_window); ev_window->priv->in_reload = FALSE; - ev_window_error_message (ev_window, error, + ev_window_error_message (ev_window, error, "%s", _("Unable to open document")); g_free (ev_window->priv->local_uri); ev_window->priv->local_uri = NULL; @@ -2162,7 +2162,7 @@ set_uri_mtime (GFile *source, g_error_free (error); } else { GTimeVal mtime; - + g_file_info_get_modification_time (info, &mtime); ev_window->priv->uri_mtime = mtime.tv_sec; g_object_unref (info); @@ -2229,13 +2229,13 @@ window_open_file_copy_ready_cb (GFile *source, g_free (ev_window->priv->uri); ev_window->priv->uri = NULL; g_object_unref (source); - + ev_window_hide_loading_message (ev_window); } else { ev_window_load_remote_failed (ev_window, error); g_object_unref (source); } - + g_error_free (error); } @@ -2246,7 +2246,7 @@ window_open_file_copy_progress_cb (goffset n_bytes, { gchar *status; gdouble fraction; - + if (!ev_window->priv->message_area) return; @@ -2256,7 +2256,7 @@ window_open_file_copy_progress_cb (goffset n_bytes, fraction = n_bytes / (gdouble)total_bytes; status = g_strdup_printf (_("Downloading document (%d%%)"), (gint)(fraction * 100)); - + ev_progress_message_area_set_status (EV_PROGRESS_MESSAGE_AREA (ev_window->priv->message_area), status); ev_progress_message_area_set_fraction (EV_PROGRESS_MESSAGE_AREA (ev_window->priv->message_area), @@ -2270,7 +2270,7 @@ ev_window_load_file_remote (EvWindow *ev_window, GFile *source_file) { GFile *target_file; - + if (!ev_window->priv->local_uri) { char *base_name, *template; GFile *tmp_file; @@ -2300,14 +2300,14 @@ ev_window_load_file_remote (EvWindow *ev_window, } ev_window_reset_progress_cancellable (ev_window); - + target_file = g_file_new_for_uri (ev_window->priv->local_uri); g_file_copy_async (source_file, target_file, G_FILE_COPY_OVERWRITE, G_PRIORITY_DEFAULT, ev_window->priv->progress_cancellable, (GFileProgressCallback)window_open_file_copy_progress_cb, - ev_window, + ev_window, (GAsyncReadyCallback)window_open_file_copy_ready_cb, ev_window); g_object_unref (target_file); @@ -2326,7 +2326,7 @@ ev_window_open_uri (EvWindow *ev_window, GFile *source_file; ev_window->priv->in_reload = FALSE; - + if (ev_window->priv->uri && g_ascii_strcasecmp (ev_window->priv->uri, uri) == 0) { ev_window_reload_document (ev_window, dest); @@ -2337,7 +2337,7 @@ ev_window_open_uri (EvWindow *ev_window, g_object_unref (ev_window->priv->monitor); ev_window->priv->monitor = NULL; } - + ev_window_close_dialogs (ev_window); ev_window_clear_load_job (ev_window); ev_window_clear_local_uri (ev_window); @@ -2471,7 +2471,7 @@ static void ev_window_reload_local (EvWindow *ev_window) { const gchar *uri; - + uri = ev_window->priv->local_uri ? ev_window->priv->local_uri : ev_window->priv->uri; ev_window->priv->reload_job = ev_job_load_new (uri); g_signal_connect (ev_window->priv->reload_job, "finished", @@ -2480,15 +2480,15 @@ ev_window_reload_local (EvWindow *ev_window) ev_job_scheduler_push_job (ev_window->priv->reload_job, EV_JOB_PRIORITY_NONE); } -static gboolean +static gboolean show_reloading_progress (EvWindow *ev_window) { GtkWidget *area; gchar *text; - + if (ev_window->priv->message_area) return FALSE; - + text = g_strdup_printf (_("Reloading document from %s"), ev_window->priv->uri); area = ev_progress_message_area_new ("gtk-refresh", @@ -2514,9 +2514,9 @@ reload_remote_copy_ready_cb (GFile *remote, EvWindow *ev_window) { GError *error = NULL; - + ev_window_clear_progress_idle (ev_window); - + g_file_copy_finish (remote, async_result, &error); if (error) { if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) @@ -2526,7 +2526,7 @@ reload_remote_copy_ready_cb (GFile *remote, } else { ev_window_reload_local (ev_window); } - + g_object_unref (remote); } @@ -2537,7 +2537,7 @@ reload_remote_copy_progress_cb (goffset n_bytes, { gchar *status; gdouble fraction; - + if (!ev_window->priv->message_area) return; @@ -2547,7 +2547,7 @@ reload_remote_copy_progress_cb (goffset n_bytes, fraction = n_bytes / (gdouble)total_bytes; status = g_strdup_printf (_("Downloading document (%d%%)"), (gint)(fraction * 100)); - + ev_progress_message_area_set_status (EV_PROGRESS_MESSAGE_AREA (ev_window->priv->message_area), status); ev_progress_message_area_set_fraction (EV_PROGRESS_MESSAGE_AREA (ev_window->priv->message_area), @@ -2573,23 +2573,23 @@ query_remote_uri_mtime_cb (GFile *remote, return; } - + g_file_info_get_modification_time (info, &mtime); if (ev_window->priv->uri_mtime != mtime.tv_sec) { GFile *target_file; - + /* Remote file has changed */ ev_window->priv->uri_mtime = mtime.tv_sec; ev_window_reset_progress_cancellable (ev_window); - + target_file = g_file_new_for_uri (ev_window->priv->local_uri); g_file_copy_async (remote, target_file, G_FILE_COPY_OVERWRITE, G_PRIORITY_DEFAULT, ev_window->priv->progress_cancellable, (GFileProgressCallback)reload_remote_copy_progress_cb, - ev_window, + ev_window, (GAsyncReadyCallback)reload_remote_copy_ready_cb, ev_window); g_object_unref (target_file); @@ -2599,7 +2599,7 @@ query_remote_uri_mtime_cb (GFile *remote, g_object_unref (remote); ev_window_reload_local (ev_window); } - + g_object_unref (info); } @@ -2607,7 +2607,7 @@ static void ev_window_reload_remote (EvWindow *ev_window) { GFile *remote; - + remote = g_file_new_for_uri (ev_window->priv->uri); /* Reload the remote uri only if it has changed */ g_file_query_info_async (remote, @@ -2786,9 +2786,9 @@ ev_window_cmd_recent_file_activate (GtkAction *action, info = g_object_get_data (G_OBJECT (action), "gtk-recent-info"); g_assert (info != NULL); - + uri = gtk_recent_info_get_uri (info); - + ev_application_open_uri_at_dest (EV_APP, uri, gtk_window_get_screen (GTK_WINDOW (window)), NULL, 0, NULL, gtk_get_current_event_time ()); @@ -2818,7 +2818,7 @@ compare_recent_items (GtkRecentInfo *a, GtkRecentInfo *b) has_ev_a = gtk_recent_info_has_application (a, atril); has_ev_b = gtk_recent_info_has_application (b, atril); - + if (has_ev_a && has_ev_b) { time_t time_a, time_b; @@ -2838,7 +2838,7 @@ compare_recent_items (GtkRecentInfo *a, GtkRecentInfo *b) /* * Doubles underscore to avoid spurious menu accels. */ -static gchar * +static gchar * ev_window_get_recent_file_label (gint index, const gchar *filename) { GString *str; @@ -2846,22 +2846,22 @@ ev_window_get_recent_file_label (gint index, const gchar *filename) const gchar *p; const gchar *end; gboolean is_rtl; - + is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL); g_return_val_if_fail (filename != NULL, NULL); - + length = strlen (filename); str = g_string_sized_new (length + 10); g_string_printf (str, "%s_%d. ", is_rtl ? "\xE2\x80\x8F" : "", index); p = filename; end = filename + length; - + while (p != end) { const gchar *next; next = g_utf8_next_char (p); - + switch (*p) { case '_': g_string_append (str, "__"); @@ -2870,10 +2870,10 @@ ev_window_get_recent_file_label (gint index, const gchar *filename) g_string_append_len (str, p, next - p); break; } - + p = next; } - + return g_string_free (str, FALSE); } @@ -2961,7 +2961,7 @@ ev_window_setup_recent (EvWindow *ev_window) "gtk-recent-info", gtk_recent_info_ref (info), (GDestroyNotify) gtk_recent_info_unref); - + g_signal_connect (action, "activate", G_CALLBACK (ev_window_cmd_recent_file_activate), (gpointer) ev_window); @@ -2985,12 +2985,12 @@ ev_window_setup_recent (EvWindow *ev_window) if (++n_items == 5) break; } - + g_list_foreach (items, (GFunc) gtk_recent_info_unref, NULL); g_list_free (items); } -static gboolean +static gboolean show_saving_progress (GFile *dst) { EvWindow *ev_window; @@ -3001,7 +3001,7 @@ show_saving_progress (GFile *dst) ev_window = EV_WINDOW (g_object_get_data (G_OBJECT (dst), "ev-window")); ev_window->priv->progress_idle = 0; - + if (ev_window->priv->message_area) return FALSE; @@ -3048,7 +3048,7 @@ window_save_file_copy_ready_cb (GFile *src, ev_window = EV_WINDOW (g_object_get_data (G_OBJECT (dst), "ev-window")); ev_window_clear_progress_idle (ev_window); - + if (g_file_copy_finish (src, async_result, &error)) { ev_tmp_file_unlink (src); return; @@ -3056,7 +3056,7 @@ window_save_file_copy_ready_cb (GFile *src, if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { gchar *name; - + name = g_file_get_basename (dst); ev_window_error_message (ev_window, error, _("The file could not be saved as “%s”."), @@ -3078,7 +3078,7 @@ window_save_file_copy_progress_cb (goffset n_bytes, gdouble fraction; ev_window = EV_WINDOW (g_object_get_data (G_OBJECT (dst), "ev-window")); - + if (!ev_window->priv->message_area) return; @@ -3104,7 +3104,7 @@ window_save_file_copy_progress_cb (goffset n_bytes, default: g_assert_not_reached (); } - + ev_progress_message_area_set_status (EV_PROGRESS_MESSAGE_AREA (ev_window->priv->message_area), status); ev_progress_message_area_set_fraction (EV_PROGRESS_MESSAGE_AREA (ev_window->priv->message_area), @@ -3144,7 +3144,7 @@ ev_window_clear_save_job (EvWindow *ev_window) if (ev_window->priv->save_job != NULL) { if (!ev_job_is_finished (ev_window->priv->save_job)) ev_job_cancel (ev_window->priv->save_job); - + g_signal_handlers_disconnect_by_func (ev_window->priv->save_job, ev_window_save_job_cb, ev_window); @@ -3185,7 +3185,7 @@ file_save_dialog_response_cb (GtkWidget *fc, uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (fc)); - /* FIXME: remote copy should be done here rather than in the save job, + /* FIXME: remote copy should be done here rather than in the save job, * so that we can track progress and cancel the operation */ @@ -3514,7 +3514,7 @@ static void ev_window_print_cancel (EvWindow *ev_window) { EvPrintOperation *op; - + if (!ev_window->priv->print_queue) return; @@ -3528,7 +3528,7 @@ ev_window_print_update_pending_jobs_message (EvWindow *ev_window, gint n_jobs) { gchar *text = NULL; - + if (!EV_IS_PROGRESS_MESSAGE_AREA (ev_window->priv->message_area) || !ev_window->priv->print_queue) return; @@ -3537,7 +3537,7 @@ ev_window_print_update_pending_jobs_message (EvWindow *ev_window, ev_window_set_message_area (ev_window, NULL); return; } - + if (n_jobs > 1) { text = g_strdup_printf (ngettext ("%d pending job in queue", "%d pending jobs in queue", @@ -3553,7 +3553,7 @@ static gboolean destroy_window (GtkWidget *window) { gtk_widget_destroy (window); - + return FALSE; } @@ -3586,7 +3586,7 @@ ev_window_print_operation_done (EvPrintOperation *op, ev_print_operation_get_error (op, &error); - + /* The message area is already used by * the printing progress, so it's better to * use a popup dialog in this case @@ -3602,7 +3602,7 @@ ev_window_print_operation_done (EvPrintOperation *op, G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (dialog); - + g_error_free (error); } break; @@ -3645,7 +3645,7 @@ ev_window_print_operation_status_changed (EvPrintOperation *op, status = ev_print_operation_get_status (op); fraction = ev_print_operation_get_progress (op); - + if (!ev_window->priv->message_area) { GtkWidget *area; const gchar *job_name; @@ -3881,8 +3881,8 @@ print_jobs_confirmation_dialog_response (GtkDialog *dialog, gint response, EvWindow *ev_window) { - gtk_widget_destroy (GTK_WIDGET (dialog)); - + gtk_widget_destroy (GTK_WIDGET (dialog)); + switch (response) { case GTK_RESPONSE_YES: if (!ev_window->priv->print_queue || @@ -4006,11 +4006,11 @@ static void ev_window_cmd_focus_page_selector (GtkAction *act, EvWindow *window) { GtkAction *action; - + update_chrome_flag (window, EV_CHROME_RAISE_TOOLBAR, TRUE); ev_window_set_action_sensitive (window, "ViewToolbar", FALSE); update_chrome_visibility (window); - + action = gtk_action_group_get_action (window->priv->action_group, PAGE_SELECTOR_ACTION); ev_page_action_grab_focus (EV_PAGE_ACTION (action)); @@ -4022,7 +4022,7 @@ ev_window_cmd_scroll_forward (GtkAction *action, EvWindow *window) /* If the webview is occupying the window */ if (window->priv->document && window->priv->document->iswebdocument == TRUE) return; - + g_signal_emit_by_name (window->priv->view, "scroll", GTK_SCROLL_PAGE_FORWARD, GTK_ORIENTATION_VERTICAL); } @@ -4032,7 +4032,7 @@ ev_window_cmd_scroll_backward (GtkAction *action, EvWindow *window) /* If the webview is occupying the window */ if (window->priv->document && window->priv->document->iswebdocument == TRUE) return; - + g_signal_emit_by_name (window->priv->view, "scroll", GTK_SCROLL_PAGE_BACKWARD, GTK_ORIENTATION_VERTICAL); } @@ -4172,7 +4172,7 @@ ev_window_cmd_edit_find_previous (GtkAction *action, EvWindow *ev_window) gtk_widget_grab_focus (ev_window->priv->find_bar); if (ev_window->priv->document->iswebdocument == FALSE) { ev_view_find_previous (EV_VIEW (ev_window->priv->view)); - } + } #if ENABLE_EPUB else { ev_web_view_find_previous(EV_WEB_VIEW(ev_window->priv->webview)); @@ -4184,10 +4184,10 @@ static void ev_window_cmd_edit_copy (GtkAction *action, EvWindow *ev_window) { g_return_if_fail (EV_IS_WINDOW (ev_window)); -#if ENABLE_EPUB +#if ENABLE_EPUB if (ev_window->priv->document->iswebdocument) { ev_web_view_copy(EV_WEB_VIEW(ev_window->priv->webview)); - } else + } else #endif { ev_view_copy (EV_VIEW (ev_window->priv->view)); @@ -4231,7 +4231,7 @@ fullscreen_toolbar_setup_item_properties (GtkUIManager *ui_manager) item = gtk_ui_manager_get_widget (ui_manager, "/FullscreenToolbar/StartPresentation"); g_object_set (item, "is-important", TRUE, NULL); - + item = gtk_ui_manager_get_widget (ui_manager, "/FullscreenToolbar/LeaveFullscreen"); g_object_set (item, "is-important", TRUE, NULL); } @@ -4243,7 +4243,7 @@ ev_window_run_fullscreen (EvWindow *window) if (ev_document_model_get_fullscreen (window->priv->model)) return; - + if (!window->priv->fullscreen_toolbar) { window->priv->fullscreen_toolbar = gtk_ui_manager_get_widget (window->priv->ui_manager, @@ -4405,7 +4405,7 @@ ev_window_run_presentation (EvWindow *window) if (EV_WINDOW_IS_PRESENTATION (window)) return; - + if (window->priv->document->iswebdocument) { ev_window_warning_message(window,_("Presentation mode is not supported for ePub documents")); return; @@ -4480,10 +4480,10 @@ ev_window_stop_presentation (EvWindow *window, update_chrome_visibility (window); if (unfullscreen_window) gtk_window_unfullscreen (GTK_WINDOW (window)); - + if (window->priv->view) { gtk_widget_grab_focus (window->priv->view); - } + } #if ENABLE_EPUB else { gtk_widget_grab_focus (window->priv->webview); @@ -4600,7 +4600,7 @@ ev_window_state_event (GtkWidget *widget, if (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) { if (ev_document_model_get_fullscreen (window->priv->model) || EV_WINDOW_IS_PRESENTATION (window)) return FALSE; - + ev_window_run_fullscreen (window); } else { if (ev_document_model_get_fullscreen (window->priv->model)) @@ -4860,7 +4860,7 @@ ev_window_cmd_go_next_page (GtkAction *action, EvWindow *ev_window) #if ENABLE_EPUB if ( ev_window->priv->document->iswebdocument == TRUE ) { ev_web_view_next_page(EV_WEB_VIEW(ev_window->priv->webview)); - } else + } else #endif { ev_view_next_page (EV_VIEW (ev_window->priv->view)); @@ -4888,12 +4888,12 @@ static void ev_window_cmd_go_forward (GtkAction *action, EvWindow *ev_window) { int n_pages, current_page; - + g_return_if_fail (EV_IS_WINDOW (ev_window)); n_pages = ev_document_get_n_pages (ev_window->priv->document); current_page = ev_document_model_get_page (ev_window->priv->model); - + if (current_page + 10 < n_pages) { ev_document_model_set_page (ev_window->priv->model, current_page + 10); } @@ -4903,11 +4903,11 @@ static void ev_window_cmd_go_backward (GtkAction *action, EvWindow *ev_window) { int current_page; - + g_return_if_fail (EV_IS_WINDOW (ev_window)); current_page = ev_document_model_get_page (ev_window->priv->model); - + if (current_page - 10 >= 0) { ev_document_model_set_page (ev_window->priv->model, current_page - 10); } @@ -5037,7 +5037,7 @@ ev_window_cmd_help_contents (GtkAction *action, EvWindow *ev_window) &error); if (error) { - ev_window_error_message (ev_window, error, + ev_window_error_message (ev_window, error, "%s", _("There was an error displaying help")); g_error_free (error); } @@ -5062,7 +5062,7 @@ ev_window_cmd_escape (GtkAction *action, EvWindow *window) if (window->priv->document && !window->priv->document->iswebdocument && window->priv->view) ev_view_autoscroll_stop (EV_VIEW (window->priv->view)); - + widget = gtk_window_get_focus (GTK_WINDOW (window)); if (widget && gtk_widget_get_ancestor (widget, EGG_TYPE_FIND_BAR)) { update_chrome_flag (window, EV_CHROME_FINDBAR, FALSE); @@ -5386,7 +5386,7 @@ static void ev_window_view_toolbar_cb (GtkAction *action, EvWindow *ev_window) { gboolean active; - + active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); update_chrome_flag (ev_window, EV_CHROME_TOOLBAR, active); update_chrome_visibility (ev_window); @@ -5399,7 +5399,7 @@ ev_window_view_sidebar_cb (GtkAction *action, EvWindow *ev_window) { if (EV_WINDOW_IS_PRESENTATION (ev_window)) return; - + update_chrome_flag (ev_window, EV_CHROME_SIDEBAR, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))); update_chrome_visibility (ev_window); @@ -5448,13 +5448,13 @@ view_menu_link_popup (EvWindow *ev_window, GtkAction *action; if ( ev_window->priv->document->iswebdocument == TRUE ) return ; - + if (ev_window->priv->link) g_object_unref (ev_window->priv->link); - + if (link) ev_window->priv->link = g_object_ref (link); - else + else ev_window->priv->link = NULL; if (ev_window->priv->link) { @@ -5476,7 +5476,7 @@ view_menu_link_popup (EvWindow *ev_window, } } } - + action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group, "OpenLink"); gtk_action_set_visible (action, show_external); @@ -5504,14 +5504,14 @@ view_menu_image_popup (EvWindow *ev_window, if (ev_window->priv->document->iswebdocument == TRUE ) return ; if (ev_window->priv->image) g_object_unref (ev_window->priv->image); - + if (image) ev_window->priv->image = g_object_ref (image); - else + else ev_window->priv->image = NULL; show_image = (ev_window->priv->image != NULL); - + action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group, "SaveImageAs"); gtk_action_set_visible (action, show_image); @@ -5621,9 +5621,9 @@ attachment_bar_menu_popup_cb (EvSidebarAttachments *attachbar, (GFunc) g_object_unref, NULL); g_list_free (ev_window->priv->attach_list); } - + ev_window->priv->attach_list = attach_list; - + popup = ev_window->priv->attachment_popup; gtk_menu_popup_at_pointer (GTK_MENU (popup), @@ -5638,7 +5638,7 @@ ev_window_update_find_status_message (EvWindow *ev_window) if (!ev_window->priv->find_job) return; - + if (ev_job_is_finished (ev_window->priv->find_job)) { EvJobFind *job_find = EV_JOB_FIND (ev_window->priv->find_job); @@ -5664,7 +5664,7 @@ ev_window_update_find_status_message (EvWindow *ev_window) message = g_strdup_printf (_("%3d%% remaining to search"), (gint) ((1.0 - percent) * 100)); } - + egg_find_bar_set_status_text (EGG_FIND_BAR (ev_window->priv->find_bar), message); g_free (message); } @@ -5687,7 +5687,7 @@ ev_window_find_job_updated_cb (EvJobFind *job, ev_web_view_find_changed(EV_WEB_VIEW(ev_window->priv->webview), job->results,job->text, job->case_sensitive); } - else + else #endif { ev_view_find_changed (EV_VIEW (ev_window->priv->view), @@ -5722,7 +5722,7 @@ find_bar_previous_cb (EggFindBar *find_bar, #if ENABLE_EPUB if (ev_window->priv->document->iswebdocument == TRUE ) { ev_web_view_find_previous(EV_WEB_VIEW(ev_window->priv->webview)); - }else + }else #endif { ev_view_find_previous (EV_VIEW (ev_window->priv->view)); @@ -5736,7 +5736,7 @@ find_bar_next_cb (EggFindBar *find_bar, #if ENABLE_EPUB if (ev_window->priv->document->iswebdocument == TRUE ) { ev_web_view_find_next(EV_WEB_VIEW(ev_window->priv->webview)); - } else + } else #endif { ev_view_find_next (EV_VIEW (ev_window->priv->view)); @@ -5748,10 +5748,10 @@ find_bar_close_cb (EggFindBar *find_bar, EvWindow *ev_window) { #if ENABLE_EPUB - if (ev_window->priv->document->iswebdocument == TRUE ) { + if (ev_window->priv->document->iswebdocument == TRUE ) { ev_web_view_find_cancel(EV_WEB_VIEW(ev_window->priv->webview)); } - else + else #endif { ev_view_find_cancel (EV_VIEW (ev_window->priv->view)); @@ -5769,7 +5769,7 @@ ev_window_search_start (EvWindow *ev_window) if (!ev_window->priv->document || !EV_IS_DOCUMENT_FIND (ev_window->priv->document)) return; - + search_string = egg_find_bar_get_search_string (find_bar); ev_window_clear_find_job (ev_window); @@ -5780,7 +5780,7 @@ ev_window_search_start (EvWindow *ev_window) ev_document_get_n_pages (ev_window->priv->document), search_string, egg_find_bar_get_case_sensitive (find_bar)); - + g_signal_connect (ev_window->priv->find_job, "finished", G_CALLBACK (ev_window_find_job_finished_cb), ev_window); @@ -5865,8 +5865,8 @@ zoom_control_changed_cb (EphyZoomAction *action, new_height = (gint)(doc_height * scale); /* - * If the sidebar, menu bar, or tool bars are open, - * we must account for their sizes in calculating + * If the sidebar, menu bar, or tool bars are open, + * we must account for their sizes in calculating * the new expanded window size. */ @@ -6101,7 +6101,7 @@ ev_window_dispose (GObject *object) g_object_unref (priv->monitor); priv->monitor = NULL; } - + if (priv->title) { ev_window_title_free (priv->title); priv->title = NULL; @@ -6169,9 +6169,9 @@ ev_window_dispose (GObject *object) g_object_unref (priv->document); priv->document = NULL; } - + if (priv->view) { - g_object_unref (priv->view); + g_object_unref (priv->view); priv->view = NULL; } @@ -6199,7 +6199,7 @@ ev_window_dispose (GObject *object) if (priv->find_job) { ev_window_clear_find_job (window); } - + if (priv->local_uri) { ev_window_clear_local_uri (window); priv->local_uri = NULL; @@ -6210,7 +6210,7 @@ ev_window_dispose (GObject *object) g_object_unref (priv->progress_cancellable); priv->progress_cancellable = NULL; } - + ev_window_close_dialogs (window); if (priv->link) { @@ -6253,7 +6253,7 @@ ev_window_dispose (GObject *object) g_free (priv->search_string); priv->search_string = NULL; } - + if (priv->dest) { g_object_unref (priv->dest); priv->dest = NULL; @@ -6314,7 +6314,7 @@ ev_window_key_press_event (GtkWidget *widget, /* Handle focus widget key events */ if (gtk_window_propagate_key_event (window, event)) return TRUE; - + /* Handle mnemonics and accelerators */ if (gtk_window_activate_key (window, event)) return TRUE; @@ -6608,7 +6608,7 @@ navigation_action_activate_link_cb (EvNavigationAction *action, EvLink *link, Ev gtk_widget_grab_focus (window->priv->webview); return; } -#endif +#endif ev_view_handle_link (EV_VIEW (window->priv->view), link); gtk_widget_grab_focus (window->priv->view); } @@ -6823,10 +6823,10 @@ sidebar_page_main_widget_update_cb (GObject *ev_sidebar_page, EvWindow *ev_window) { GtkWidget *widget; - + g_object_get (ev_sidebar_page, "main_widget", &widget, NULL); - if (widget != NULL) { + if (widget != NULL) { g_signal_connect_object (widget, "focus_in_event", G_CALLBACK (view_actions_focus_in_cb), ev_window, 0); @@ -6900,7 +6900,7 @@ launch_action (EvWindow *window, EvLinkAction *action) dir = g_path_get_dirname (window->priv->uri); base_file = g_file_new_for_uri (dir); g_free (dir); - + file = g_file_resolve_relative_path (base_file, filename); g_object_unref (base_file); } @@ -6928,7 +6928,7 @@ launch_action (EvWindow *window, EvLinkAction *action) _("Unable to launch external application.")); g_error_free (error); } - + g_object_unref (app_info); g_object_unref (file); /* FIXMEchpe: unref launch context? */ @@ -6996,7 +6996,7 @@ open_remote_link (EvWindow *window, EvLinkAction *action) gchar *dir; dir = g_path_get_dirname (window->priv->uri); - + uri = g_build_filename (dir, ev_link_action_get_filename (action), NULL); g_free (dir); @@ -7005,7 +7005,7 @@ open_remote_link (EvWindow *window, EvLinkAction *action) gtk_window_get_screen (GTK_WINDOW (window)), ev_link_action_get_dest (action), 0, - NULL, + NULL, gtk_get_current_event_time ()); g_free (uri); @@ -7046,7 +7046,7 @@ view_external_link_cb (EvWindow *window, EvLinkAction *action) switch (ev_link_action_get_action_type (action)) { case EV_LINK_ACTION_TYPE_GOTO_DEST: { EvLinkDest *dest; - + dest = ev_link_action_get_dest (action); if (!dest) return; @@ -7147,7 +7147,7 @@ image_save_dialog_response_cb (GtkWidget *fc, gchar *file_format; GdkPixbufFormat *format; GtkFileFilter *filter; - + if (response_id != GTK_RESPONSE_OK) { gtk_widget_destroy (fc); return; @@ -7159,7 +7159,7 @@ image_save_dialog_response_cb (GtkWidget *fc, uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (fc)); filter = gtk_file_chooser_get_filter (GTK_FILE_CHOOSER (fc)); format = g_object_get_data (G_OBJECT (filter), "pixbuf-format"); - + if (format == NULL) { format = get_gdk_pixbuf_format_by_extension (uri); } @@ -7174,7 +7174,7 @@ image_save_dialog_response_cb (GtkWidget *fc, } if (format == NULL) { - ev_window_error_message (ev_window, NULL, + ev_window_error_message (ev_window, NULL, "%s", _("Couldn't find appropriate format to save image")); g_free (uri); @@ -7204,10 +7204,10 @@ image_save_dialog_response_cb (GtkWidget *fc, gdk_pixbuf_save (pixbuf, filename, file_format, &error, NULL); g_free (file_format); g_object_unref (pixbuf); - + has_error: if (error) { - ev_window_error_message (ev_window, error, + ev_window_error_message (ev_window, error, "%s", _("The image could not be saved.")); g_error_free (error); g_free (filename); @@ -7219,14 +7219,14 @@ image_save_dialog_response_cb (GtkWidget *fc, if (!is_native) { GFile *source_file; - + source_file = g_file_new_for_path (filename); - + ev_window_save_remote (ev_window, EV_SAVE_IMAGE, source_file, target_file); g_object_unref (source_file); } - + g_free (filename); g_object_unref (target_file); gtk_widget_destroy (fc); @@ -7252,12 +7252,12 @@ ev_view_popup_cmd_save_image_as (GtkAction *action, EvWindow *window) gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (fc), FALSE); gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (fc), TRUE); - + file_chooser_dialog_add_writable_pixbuf_formats (GTK_FILE_CHOOSER (fc)); ev_window_file_chooser_restore_folder (window, GTK_FILE_CHOOSER (fc), NULL, G_USER_DIRECTORY_PICTURES); - + g_signal_connect (fc, "response", G_CALLBACK (image_save_dialog_response_cb), window); @@ -7273,14 +7273,14 @@ ev_view_popup_cmd_copy_image (GtkAction *action, EvWindow *window) if (!window->priv->image) return; - + clipboard = gtk_widget_get_clipboard (GTK_WIDGET (window), GDK_SELECTION_CLIPBOARD); ev_document_doc_mutex_lock (); pixbuf = ev_document_images_get_image (EV_DOCUMENT_IMAGES (window->priv->document), window->priv->image); ev_document_doc_mutex_unlock (); - + gtk_clipboard_set_image (clipboard, pixbuf); g_object_unref (pixbuf); } @@ -7290,7 +7290,7 @@ ev_view_popup_cmd_annot_properties (GtkAction *action, EvWindow *window) { if (window->priv->document->iswebdocument == TRUE ) return; - + const gchar *author; GdkRGBA rgba; gdouble opacity; @@ -7362,7 +7362,7 @@ ev_attachment_popup_cmd_open_attachment (GtkAction *action, EvWindow *window) { GList *l; GdkScreen *screen; - + if (!window->priv->attach_list) return; @@ -7371,13 +7371,13 @@ ev_attachment_popup_cmd_open_attachment (GtkAction *action, EvWindow *window) for (l = window->priv->attach_list; l && l->data; l = g_list_next (l)) { EvAttachment *attachment; GError *error = NULL; - + attachment = (EvAttachment *) l->data; - + ev_attachment_open (attachment, screen, gtk_get_current_event_time (), &error); if (error) { - ev_window_error_message (window, error, + ev_window_error_message (window, error, "%s", _("Unable to open attachment")); g_error_free (error); } @@ -7395,7 +7395,7 @@ attachment_save_dialog_response_cb (GtkWidget *fc, GtkFileChooserAction fc_action; gboolean is_dir; gboolean is_native; - + if (response_id != GTK_RESPONSE_OK) { gtk_widget_destroy (fc); return; @@ -7409,12 +7409,12 @@ attachment_save_dialog_response_cb (GtkWidget *fc, g_object_get (G_OBJECT (fc), "action", &fc_action, NULL); is_dir = (fc_action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); is_native = g_file_is_native (target_file); - + for (l = ev_window->priv->attach_list; l && l->data; l = g_list_next (l)) { EvAttachment *attachment; GFile *save_to = NULL; GError *error = NULL; - + attachment = (EvAttachment *) l->data; if (is_native) { @@ -7431,9 +7431,9 @@ attachment_save_dialog_response_cb (GtkWidget *fc, if (save_to) ev_attachment_save (attachment, save_to, &error); - + if (error) { - ev_window_error_message (ev_window, error, + ev_window_error_message (ev_window, error, "%s", _("The attachment could not be saved.")); g_error_free (error); g_object_unref (save_to); @@ -7477,7 +7477,7 @@ ev_attachment_popup_cmd_save_attachment_as (GtkAction *action, EvWindow *window) if (g_list_length (window->priv->attach_list) == 1) attachment = (EvAttachment *) window->priv->attach_list->data; - + fc = gtk_file_chooser_dialog_new ( _("Save Attachment"), GTK_WINDOW (window), @@ -7511,9 +7511,9 @@ ev_window_media_player_key_pressed (EvWindow *window, const gchar *key, gpointer user_data) { - if (!gtk_window_is_active (GTK_WINDOW (window))) + if (!gtk_window_is_active (GTK_WINDOW (window))) return; - + /* Note how Previous/Next only go to the * next/previous page despite their icon telling you * they should go to the beginning/end. @@ -7872,12 +7872,12 @@ ev_window_init (EvWindow *ev_window) "notify::position", G_CALLBACK (ev_window_sidebar_position_change_cb), ev_window); - + gtk_paned_set_position (GTK_PANED (ev_window->priv->hpaned), SIDEBAR_DEFAULT_SIZE); gtk_box_pack_start (GTK_BOX (ev_window->priv->main_box), ev_window->priv->hpaned, TRUE, TRUE, 0); gtk_widget_show (ev_window->priv->hpaned); - + ev_window->priv->sidebar = ev_sidebar_new (); ev_sidebar_set_model (EV_SIDEBAR (ev_window->priv->sidebar), ev_window->priv->model); @@ -8051,7 +8051,7 @@ ev_window_init (EvWindow *ev_window) /* We own a ref on these widgets, as we can swap them in and out */ g_object_ref (ev_window->priv->view); g_object_ref (ev_window->priv->password_view); - + gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window), ev_window->priv->view); diff --git a/shell/main.c b/shell/main.c index 6e21f9f2..582ffe2f 100644 --- a/shell/main.c +++ b/shell/main.c @@ -90,7 +90,7 @@ launch_previewer (void) * the first path given */ cmd_str = g_string_new ("atril-previewer"); - + if (print_settings) { gchar *quoted; @@ -104,14 +104,14 @@ launch_previewer (void) if (file_arguments) { gchar *quoted; - + quoted = g_shell_quote (file_arguments[0]); g_string_append_printf (cmd_str, " %s", quoted); g_free (quoted); } cmd = g_string_free (cmd_str, FALSE); - + if (!error) { GAppInfo *app; @@ -255,9 +255,9 @@ main (int argc, char *argv[]) if (preview_mode) { gboolean retval; - + retval = launch_previewer (); - + return retval ? 0 : 1; } -- cgit v1.2.1