From: Jonathan Blandford Date: Sat, 16 Apr 2005 22:54:22 +0000 (+0000) Subject: Minor cleanups removing some dead code. X-Git-Tag: EVINCE_0_2_1~39 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=fc98aa5263c7bcf5bd7ba39397673c20f34f6fa7;p=evince.git Minor cleanups removing some dead code. Sat Apr 16 18:53:47 2005 Jonathan Blandford * shell/ev-sidebar-links.c: (selection_changed_cb): * shell/ev-view.c: (ev_view_finalize), (go_to_link), (ev_view_button_release_event), (ev_view_set_document): * shell/ev-view.h: * shell/ev-window.c: (find_bar_search_changed_cb): * shell/ev-window.h: Minor cleanups removing some dead code. --- diff --git a/ChangeLog b/ChangeLog index b9bde8a7..921313ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sat Apr 16 18:53:47 2005 Jonathan Blandford + + * shell/ev-sidebar-links.c: (selection_changed_cb): + * shell/ev-view.c: (ev_view_finalize), (go_to_link), + (ev_view_button_release_event), (ev_view_set_document): + * shell/ev-view.h: + * shell/ev-window.c: (find_bar_search_changed_cb): + * shell/ev-window.h: Minor cleanups removing some dead code. + 2005-04-16 Nickolay V. Shmyrev * backend/ev-page-cache.c: (_ev_page_cache_new): diff --git a/shell/ev-sidebar-links.c b/shell/ev-sidebar-links.c index e663fc99..1a4312f3 100644 --- a/shell/ev-sidebar-links.c +++ b/shell/ev-sidebar-links.c @@ -173,6 +173,7 @@ selection_changed_cb (GtkTreeSelection *selection, g_signal_handler_block (ev_sidebar_links->priv->page_cache, ev_sidebar_links->priv->page_changed_id); + /* FIXME: we should handle this better. This breaks w/ URLs */ ev_page_cache_set_link (ev_sidebar_links->priv->page_cache, link); g_signal_handler_unblock (ev_sidebar_links->priv->page_cache, ev_sidebar_links->priv->page_changed_id); diff --git a/shell/ev-view.c b/shell/ev-view.c index a0525828..b51082f2 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -210,8 +210,8 @@ ev_view_finalize (GObject *object) LOG ("Finalize"); - - ev_view_set_scroll_adjustments (view, NULL, NULL); + g_free (view->status); + g_free (view->find_status); G_OBJECT_CLASS (ev_view_parent_class)->finalize (object); } @@ -975,6 +975,31 @@ ev_view_motion_notify_event (GtkWidget *widget, return TRUE; } +/* FIXME: standardize this sometime */ +static void +go_to_link (EvView *view, EvLink *link) +{ + EvLinkType type; + const char *uri; + int page; + + type = ev_link_get_link_type (link); + + switch (type) { + case EV_LINK_TYPE_TITLE: + break; + case EV_LINK_TYPE_PAGE: + page = ev_link_get_page (link); + ev_page_cache_set_current_page (view->page_cache, page); + break; + case EV_LINK_TYPE_EXTERNAL_URI: + uri = ev_link_get_uri (link); + gnome_vfs_url_show (uri); + break; + } +} + + static gboolean ev_view_button_release_event (GtkWidget *widget, GdkEventButton *event) @@ -990,7 +1015,7 @@ ev_view_button_release_event (GtkWidget *widget, link = get_link_at_location (view, event->x, event->y); if (link) { - ev_view_go_to_link (view, link); + go_to_link (view, link); } } @@ -1553,41 +1578,6 @@ ev_view_set_document (EvView *view, } } -int -ev_view_get_page (EvView *view) -{ - return view->current_page; -} - -static void -go_to_link (EvView *view, EvLink *link) -{ - EvLinkType type; - const char *uri; - int page; - - type = ev_link_get_link_type (link); - - switch (type) { - case EV_LINK_TYPE_TITLE: - break; - case EV_LINK_TYPE_PAGE: - page = ev_link_get_page (link); - ev_page_cache_set_current_page (view->page_cache, page); - break; - case EV_LINK_TYPE_EXTERNAL_URI: - uri = ev_link_get_uri (link); - gnome_vfs_url_show (uri); - break; - } -} - -void -ev_view_go_to_link (EvView *view, EvLink *link) -{ - go_to_link (view, link); -} - static void ev_view_zoom (EvView *view, double factor, diff --git a/shell/ev-view.h b/shell/ev-view.h index a0b58063..daa871fc 100644 --- a/shell/ev-view.h +++ b/shell/ev-view.h @@ -38,16 +38,11 @@ GType ev_view_get_type (void) G_GNUC_CONST; GtkWidget* ev_view_new (void); void ev_view_set_document (EvView *view, EvDocument *document); -int ev_view_get_page (EvView *view); /* Clipboard */ void ev_view_copy (EvView *view); void ev_view_select_all (EvView *view); -/* Navigation */ -void ev_view_go_to_link (EvView *view, - EvLink *link); - /* Page size */ void ev_view_zoom_in (EvView *view); void ev_view_zoom_out (EvView *view); diff --git a/shell/ev-window.c b/shell/ev-window.c index 2a67b891..43a04032 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -373,12 +373,6 @@ ev_window_open_page (EvWindow *ev_window, int page) } } -void -ev_window_open_link (EvWindow *ev_window, EvLink *link) -{ - ev_view_go_to_link (EV_VIEW (ev_window->priv->view), link); -} - gboolean ev_window_is_empty (const EvWindow *ev_window) { @@ -2012,7 +2006,7 @@ find_bar_search_changed_cb (EggFindBar *find_bar, if (visible && search_string && search_string[0]) { g_mutex_lock (EV_DOC_MUTEX); ev_document_find_begin (EV_DOCUMENT_FIND (ev_window->priv->document), - ev_view_get_page (EV_VIEW (ev_window->priv->view)), + ev_page_cache_get_current_page (ev_window->priv->page_cache), search_string, case_sensitive); g_mutex_unlock (EV_DOC_MUTEX); diff --git a/shell/ev-window.h b/shell/ev-window.h index 99daa36c..d6085a8b 100644 --- a/shell/ev-window.h +++ b/shell/ev-window.h @@ -53,8 +53,6 @@ struct _EvWindowClass { GType ev_window_get_type (void); void ev_window_open (EvWindow *ev_window, const char *uri); -void ev_window_open_link (EvWindow *ev_window, - EvLink *link); void ev_window_open_page (EvWindow *ev_window, int page); gboolean ev_window_is_empty (const EvWindow *ev_window);