]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-window.c
Use a const to return title so that we dont double free it. Small cleanup
[evince.git] / shell / ev-window.c
index 2404001ef4862262c01bbb05543b5798619943ee..c7f0fadc46b7dcc1b586723aa071242456710fcc 100644 (file)
@@ -520,13 +520,12 @@ update_window_title (EvDocument *document, GParamSpec *pspec, EvWindow *ev_windo
 
        password_needed = (ev_window->priv->password_document != NULL);
        if (document && ev_window->priv->page_cache) {
 
        password_needed = (ev_window->priv->password_document != NULL);
        if (document && ev_window->priv->page_cache) {
-               doc_title = ev_page_cache_get_title (ev_window->priv->page_cache);
+               doc_title = g_strdup (ev_page_cache_get_title (ev_window->priv->page_cache));
 
                /* Make sure we get a valid title back */
                if (doc_title) {
                        if (doc_title[0] == '\000' ||
                            !g_utf8_validate (doc_title, -1, NULL)) {
 
                /* Make sure we get a valid title back */
                if (doc_title) {
                        if (doc_title[0] == '\000' ||
                            !g_utf8_validate (doc_title, -1, NULL)) {
-                               g_free (doc_title);
                                doc_title = NULL;
                        }
                }
                                doc_title = NULL;
                        }
                }
@@ -1202,6 +1201,7 @@ ev_window_cmd_file_properties (GtkAction *action, EvWindow *ev_window)
 
        info = ev_document_get_info (document);
        dialog = ev_properties_new (info, fonts);
 
        info = ev_document_get_info (document);
        dialog = ev_properties_new (info, fonts);
+       gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (ev_window));
        gtk_dialog_run (dialog);
        gtk_widget_destroy (GTK_WIDGET (dialog));
        ev_document_info_free (info);
        gtk_dialog_run (dialog);
        gtk_widget_destroy (GTK_WIDGET (dialog));
        ev_document_info_free (info);
@@ -2499,10 +2499,10 @@ static const GtkToggleActionEntry toggle_entries[] = {
         { "ViewSidebar", NULL, N_("Side _pane"), "F9",
          N_("Show or hide the side pane"),
          G_CALLBACK (ev_window_view_sidebar_cb), TRUE },
         { "ViewSidebar", NULL, N_("Side _pane"), "F9",
          N_("Show or hide the side pane"),
          G_CALLBACK (ev_window_view_sidebar_cb), TRUE },
-        { "ViewContinuous", NULL, N_("_Continuous"), NULL,
+        { "ViewContinuous", EV_STOCK_VIEW_CONTINUOUS, N_("_Continuous"), NULL,
          N_("Show the entire document"),
          G_CALLBACK (ev_window_cmd_continuous), TRUE },
          N_("Show the entire document"),
          G_CALLBACK (ev_window_cmd_continuous), TRUE },
-        { "ViewDual", NULL, N_("_Dual"), NULL,
+        { "ViewDual", EV_STOCK_VIEW_DUAL, N_("_Dual"), NULL,
          N_("Show two pages at once"),
          G_CALLBACK (ev_window_cmd_dual), FALSE },
         { "ViewFullscreen", NULL, N_("_Fullscreen"), "F11",
          N_("Show two pages at once"),
          G_CALLBACK (ev_window_cmd_dual), FALSE },
         { "ViewFullscreen", NULL, N_("_Fullscreen"), "F11",