]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-navigation-action.c
More #include cleanups. Again: reordering, single gtk.h includes and other
[evince.git] / shell / ev-navigation-action.c
index 9da89f993c10149f9248799ecdecc8cbb51ef35a..a2dc6364088159c91a2337aa9bb779eee92d872f 100644 (file)
 
 #include "config.h"
 
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
 #include "ev-navigation-action.h"
 #include "ev-navigation-action-widget.h"
 
-#include <gtk/gtklabel.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkimagemenuitem.h>
-#include <gtk/gtkmenushell.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkmenutoolbutton.h>
-#include <glib/gi18n.h>
 
 enum
 {
@@ -60,9 +55,8 @@ ev_navigation_action_history_changed (EvHistory *history,
 {
        EvNavigationAction *action = EV_NAVIGATION_ACTION (data);
        
-       gtk_action_set_sensitive (action, ev_history_get_n_links (history) > 0);
-       
-       return;
+       gtk_action_set_sensitive (GTK_ACTION (action),
+                                 ev_history_get_n_links (history) > 0);
 }
 
 void
@@ -75,7 +69,7 @@ ev_navigation_action_set_history (EvNavigationAction *action,
                                   (gpointer) &action->priv->history);
        
        g_signal_connect_object (history, "changed",
-                                ev_navigation_action_history_changed,
+                                G_CALLBACK (ev_navigation_action_history_changed),
                                 action, 0);
 }
 
@@ -134,12 +128,12 @@ build_menu (EvNavigationAction *action)
        EvHistory *history = action->priv->history;
        int start, end, i;
 
-       menu = GTK_MENU_SHELL (gtk_menu_new ());
-
-       if (history == NULL) {
-               return GTK_WIDGET (menu);
+       if (history == NULL || ev_history_get_n_links (history) <= 0) {
+               return NULL;
        }
 
+       menu = GTK_MENU_SHELL (gtk_menu_new ());
+
        start = 0;
        end = ev_history_get_n_links (history);