]> www.fi.muni.cz Git - evince.git/commitdiff
Minor cleanups removing some dead code.
authorJonathan Blandford <jrb@redhat.com>
Sat, 16 Apr 2005 22:54:22 +0000 (22:54 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Sat, 16 Apr 2005 22:54:22 +0000 (22:54 +0000)
Sat Apr 16 18:53:47 2005  Jonathan Blandford  <jrb@redhat.com>

        * 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.

ChangeLog
shell/ev-sidebar-links.c
shell/ev-view.c
shell/ev-view.h
shell/ev-window.c
shell/ev-window.h

index b9bde8a7e8c503a6c6a778c0f533071ac7128364..921313bafc6057abc7c00d860d08f17b168db8b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Sat Apr 16 18:53:47 2005  Jonathan Blandford  <jrb@redhat.com>
+
+       * 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  <nshmyrev@yandex.ru>
 
        * backend/ev-page-cache.c: (_ev_page_cache_new):
index e663fc992e5d2d6bca86fb5f0f1ed5ab9d4454bd..1a4312f34928b53f286b2f3b9d7c74ff5c9ae6c3 100644 (file)
@@ -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);
index a052582884482c800bf30706bc9ae7bb7859196a..b51082f24dfde8aada92f9c383fe296bb24cfd49 100644 (file)
@@ -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,
index a0b58063b3e5ec73599728b509afea28c6678696..daa871fc528a68ddf834f00e4813eb4d6050d956 100644 (file)
@@ -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);
index 2a67b891652034be3ede47daee5395e21a9b017a..43a040322b1911b0075c302988edf47ca8f4c203 100644 (file)
@@ -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);
index 99daa36c005cffd1885d06fdae5c2514e79050fa..d6085a8bd2d783ec7bbe35c92c8a85c4e916c4e8 100644 (file)
@@ -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);