]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-sidebar-attachments.c
Move ev_page_cache_check_dimensions() to EvDocument
[evince.git] / shell / ev-sidebar-attachments.c
index 47549f6c73ed466bcb9bdc979c52440697a21e8a..b63c5efc1d165c33e4a7ddc4015a6f29f3aa95d6 100644 (file)
@@ -31,6 +31,7 @@
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 
+#include "ev-document-attachments.h"
 #include "ev-jobs.h"
 #include "ev-job-scheduler.h"
 #include "ev-file-helpers.h"
@@ -567,7 +568,7 @@ ev_sidebar_attachments_init (EvSidebarAttachments *ev_attachbar)
                      "text-column", COLUMN_NAME,
                      "pixbuf-column", COLUMN_ICON,
                      NULL);
-       g_signal_connect_swapped (G_OBJECT (ev_attachbar->priv->icon_view),
+       g_signal_connect_swapped (ev_attachbar->priv->icon_view,
                                  "button-press-event",
                                  G_CALLBACK (ev_sidebar_attachments_button_press),
                                  (gpointer) ev_attachbar);
@@ -605,7 +606,7 @@ ev_sidebar_attachments_init (EvSidebarAttachments *ev_attachbar)
                GDK_ACTION_COPY);
 #endif
 
-       g_signal_connect (G_OBJECT (ev_attachbar->priv->icon_view),
+       g_signal_connect (ev_attachbar->priv->icon_view,
                          "drag-data-get",
                          G_CALLBACK (ev_sidebar_attachments_drag_data_get),
                          (gpointer) ev_attachbar);     
@@ -656,16 +657,13 @@ ev_sidebar_attachments_set_document (EvSidebarPage   *page,
 {
        EvSidebarAttachments *ev_attachbar = EV_SIDEBAR_ATTACHMENTS (page);
        EvJob *job;
-       
-       if (!ev_document_has_attachments (document))
-               return;
 
        if (!ev_attachbar->priv->icon_theme) {
                GdkScreen *screen;
 
                screen = gtk_widget_get_screen (GTK_WIDGET (ev_attachbar));
                ev_attachbar->priv->icon_theme = gtk_icon_theme_get_for_screen (screen);
-               g_signal_connect_swapped (G_OBJECT (ev_attachbar->priv->icon_theme),
+               g_signal_connect_swapped (ev_attachbar->priv->icon_theme,
                                          "changed",
                                          G_CALLBACK (ev_sidebar_attachments_update_icons),
                                          (gpointer) ev_attachbar);
@@ -688,7 +686,8 @@ static gboolean
 ev_sidebar_attachments_support_document (EvSidebarPage   *sidebar_page,
                                         EvDocument      *document)
 {
-       return ev_document_has_attachments (document);
+       return (EV_IS_DOCUMENT_ATTACHMENTS (document) &&
+               ev_document_attachments_has_attachments (EV_DOCUMENT_ATTACHMENTS (document)));
 }
 
 static const gchar*