]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-page-action.c
Use rotation rather than orientation. It's easier and enough for our
[evince.git] / shell / ev-page-action.c
index 076dff162fdecec1b9086399f77e0df6c94833e5..4bb63b2f1bc7c7f660e56e7403a1f86f5b58b551 100644 (file)
@@ -181,12 +181,13 @@ page_changed_cb (EvPageCache        *page_cache,
        g_assert (proxy);
        
        if (page_cache != NULL && page >= 0) {
-       
+               gchar *page_label;
+
                gtk_entry_set_width_chars (GTK_ENTRY (proxy->entry), 
                                           CLAMP (ev_page_cache_get_max_label_chars (page_cache), 
                                           4, 12));     
                
-               gchar *page_label = ev_page_cache_get_page_label (page_cache, page);
+               page_label = ev_page_cache_get_page_label (page_cache, page);
                gtk_entry_set_text (GTK_ENTRY (proxy->entry), page_label);
                gtk_editable_set_position (GTK_EDITABLE (proxy->entry), -1);
                g_free (page_label);
@@ -306,6 +307,9 @@ build_new_tree_cb (GtkTreeModel *model,
                                    -1);
        }
        
+       if (link)
+               g_object_unref (link);
+       
        return FALSE;
 }
 
@@ -344,7 +348,12 @@ match_selected_cb (GtkEntryCompletion *completion,
                            EV_DOCUMENT_LINKS_COLUMN_LINK, &link,
                            -1);
 
-       g_signal_emit (proxy, signals[ACTIVATE_LINK], 0, link);
+       g_signal_emit (proxy, widget_signals[WIDGET_ACTIVATE_LINK], 0, link);
+
+       if (link)
+               g_object_unref (link);
+
+       gtk_tree_iter_free (iter);
        
        return TRUE;
 }
@@ -368,6 +377,11 @@ display_completion_text (GtkCellLayout      *cell_layout,
                            -1);
 
        g_object_set (renderer, "text", ev_link_get_title (link), NULL);
+
+       if (link)
+               g_object_unref (link);
+       
+       gtk_tree_iter_free (iter);
 }
 
 static gboolean
@@ -389,8 +403,12 @@ match_completion (GtkEntryCompletion *completion,
                            -1);
 
 
-       if (link)
+       if (link) {
                text = ev_link_get_title (link);
+               g_object_unref (link);
+       }
+
+       gtk_tree_iter_free (iter);
 
        if (text && key ) {
                gchar *normalized_text;
@@ -461,6 +479,9 @@ update_model (EvPageAction *page, GParamSpec *pspec, EvPageActionWidget *proxy)
                                                    (GtkCellLayoutDataFunc) display_completion_text,
                                                    proxy, NULL);
                gtk_entry_set_completion (GTK_ENTRY (proxy->entry), completion);
+               
+               g_object_unref (completion);
+               g_object_unref (model);
        }
 }