]> www.fi.muni.cz Git - evince.git/commitdiff
at Jul 30 19:09:34 2005 Jonathan Blandford <jrb@redhat.com>
authorJonathan Blandford <jrb@src.gnome.org>
Sat, 30 Jul 2005 23:11:25 +0000 (23:11 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Sat, 30 Jul 2005 23:11:25 +0000 (23:11 +0000)
        * shell/ev-pixbuf-cache.c: (ev_pixbuf_cache_clear):
        * shell/ev-pixbuf-cache.h:
        * shell/ev-sidebar-thumbnails.c:
        (ev_sidebar_thumbnails_get_property), (add_range),
        (adjustment_changed_cb):
        * shell/ev-view.c: (ev_view_set_rotation): Fix rotation and the
        pixbuf cache.  Make thumbnailing work again.  Also, fix bug where
        we were thumbnailing the entire docment on startup, slowing us
        down hugely.

ChangeLog
shell/ev-pixbuf-cache.c
shell/ev-pixbuf-cache.h
shell/ev-sidebar-thumbnails.c
shell/ev-view.c

index 7e28e94b92805574d504fb48bea07b9852978140..af97fe7e2fa5ef0df52b5c094080ac898086e7cc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,20 @@
-2005-07-29  set REAL_NAME environment variable  <set EMAIL_ADDRESS environment variable>
+Sat Jul 30 19:09:34 2005  Jonathan Blandford  <jrb@redhat.com>
 
-       reviewed by: <delete if not using a buddy>
+       * shell/ev-pixbuf-cache.c: (ev_pixbuf_cache_clear):
+       * shell/ev-pixbuf-cache.h:
+       * shell/ev-sidebar-thumbnails.c:
+       (ev_sidebar_thumbnails_get_property), (add_range),
+       (adjustment_changed_cb):
+       * shell/ev-view.c: (ev_view_set_rotation): Fix rotation and the
+       pixbuf cache.  Make thumbnailing work again.  Also, fix bug where
+       we were thumbnailing the entire docment on startup, slowing us
+       down hugely. 
+
+Fri Jul 29 23:14:28 2005  Jonathan Blandford  <jrb@redhat.com>
 
        * shell/ev-page-cache.c: (ev_page_cache_new):
-       * shell/ev-window.c: (update_action_sensitivity):
+       * shell/ev-window.c: (update_action_sensitivity): Handle n_pages
+       == 0, fixes #310306.
 
 2005-07-29  Marco Pesenti Gritti  <mpg@redhat.com>
 
index 7ada246a656a799279b6af4780145174065d10a8..36eca68a679c9032be498146981db55eca4402b6 100644 (file)
@@ -700,6 +700,24 @@ ev_pixbuf_cache_get_text_mapping      (EvPixbufCache *pixbuf_cache,
        return job_info->text_mapping;
 }
 
+/* Clears the cache of jobs and pixbufs.
+ */
+void
+ev_pixbuf_cache_clear (EvPixbufCache *pixbuf_cache)
+{
+       int i;
+
+       for (i = 0; i < pixbuf_cache->preload_cache_size; i++) {
+               dispose_cache_job_info (pixbuf_cache->prev_job + i, pixbuf_cache);
+               dispose_cache_job_info (pixbuf_cache->next_job + i, pixbuf_cache);
+       }
+
+       for (i = 0; i < PAGE_CACHE_LEN (pixbuf_cache); i++) {
+               dispose_cache_job_info (pixbuf_cache->job_list + i, pixbuf_cache);
+       }
+}
+
+
 GdkPixbuf *
 ev_pixbuf_cache_get_selection_pixbuf (EvPixbufCache *pixbuf_cache,
                                      gint           page,
index 0021f62d42349afd1a430e4c71d13476fd82b3bc..443e94d31942379a905921632bb67a627c691154 100644 (file)
@@ -61,6 +61,8 @@ GList         *ev_pixbuf_cache_get_link_mapping     (EvPixbufCache *pixbuf_cache
                                                     gint           page);
 GdkRegion     *ev_pixbuf_cache_get_text_mapping     (EvPixbufCache *pixbuf_cache,
                                                     gint           page);
+void           ev_pixbuf_cache_clear                (EvPixbufCache *pixbuf_cache);
+
 /* Selection */
 GdkPixbuf     *ev_pixbuf_cache_get_selection_pixbuf (EvPixbufCache *pixbuf_cache,
                                                     gint           page,
index 46dc9cef2a06820dddda1049105913f487766a44..362ef48028d53ccf669ee6232b8f7259aa69dd0f 100644 (file)
@@ -116,9 +116,9 @@ ev_sidebar_thumbnails_dispose (GObject *object)
 
 static void
 ev_sidebar_thumbnails_get_property (GObject    *object,
-                                        guint       prop_id,
-                                        GValue     *value,
-                                        GParamSpec *pspec)
+                                   guint       prop_id,
+                                   GValue     *value,
+                                   GParamSpec *pspec)
 {
        EvSidebarThumbnails *sidebar = EV_SIDEBAR_THUMBNAILS (object);
 
@@ -229,7 +229,8 @@ add_range (EvSidebarThumbnails *sidebar_thumbnails,
                                    -1);
 
                if (job == NULL && !thumbnail_set) {
-                       job = (EvJobThumbnail *)ev_job_thumbnail_new (priv->document, page, THUMBNAIL_WIDTH, 0);
+                       /* FIXME: Need rotation */
+                       job = (EvJobThumbnail *)ev_job_thumbnail_new (priv->document, page, 0, THUMBNAIL_WIDTH);
                        ev_job_queue_add_job (EV_JOB (job), EV_JOB_PRIORITY_HIGH);
                        g_object_set_data_full (G_OBJECT (job), "tree_iter",
                                                gtk_tree_iter_copy (&iter),
@@ -307,7 +308,8 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails)
 #ifdef HAVE_GTK_ICON_VIEW_GET_VISIBLE_RANGE
                if (! GTK_WIDGET_REALIZED (priv->icon_view))
                        return;
-               gtk_icon_view_get_visible_range (GTK_ICON_VIEW (priv->icon_view), &path, &path2);
+               if (! gtk_icon_view_get_visible_range (GTK_ICON_VIEW (priv->icon_view), &path, &path2))
+                       return;
 #else
                g_assert_not_reached ();
 #endif
index 6bc088b43a4013751db3018c8b10c5cf972bc495..31705ab5143d118b07543d578ca272073af7a4bd 100644 (file)
@@ -2331,6 +2331,7 @@ ev_view_set_rotation (EvView *view, int rotation)
 {
        view->rotation = rotation;
 
+       ev_pixbuf_cache_clear (view->pixbuf_cache);
        gtk_widget_queue_resize (GTK_WIDGET (view));
 }