+2005-01-03 Marco Pesenti Gritti <marco@gnome.org>
+
+ * backend/ev-document.c: (ev_document_class_init):
+ * pdf/xpdf/pdf-document.cc:
+ * shell/ev-window.c: (ev_window_open):
+
+ Fix document title bugs and fallback to
+ filename when not available.
+
2005-01-03 Marco Pesenti Gritti <marco@gnome.org>
* backend/ev-document.c: (ev_document_get_type),
if (info.isDict ()) {
title = pdf_info_dict_get_string (info.getDict(), "Title");
}
+
+ return title;
}
static void
switch (prop_id)
{
case PROP_TITLE:
- title = pdf_document_get_title (pdf_document);
+ title = pdf_document_get_title (pdf_document);
g_value_set_string (value, title);
g_free (title);
break;
GtkWidget *statusbar;
guint help_message_cid;
GtkWidget *exit_fullscreen_popup;
+ char *uri;
EvDocument *document;
{
char *title = NULL;
- if (document) {
+ if (document == NULL) {
+ title = g_strdup (_("Document Viewer"));
+ } else {
title = ev_document_get_title (document);
- }
- if (title == NULL) {
- title = g_strdup (_("Document Viewer"));
+ if (title == NULL) {
+ title = g_path_get_basename (ev_window->priv->uri);
+ }
}
gtk_window_set_title (GTK_WINDOW (ev_window), title);
{
EvDocument *document = NULL;
char *mime_type;
+
+ g_free (ev_window->priv->uri);
+ ev_window->priv->uri = g_strdup (uri);
mime_type = gnome_vfs_get_mime_type (uri);
if (document) {
GError *error = NULL;
+ g_signal_connect_object (G_OBJECT (document),
+ "notify::title",
+ G_CALLBACK (update_window_title),
+ ev_window, 0);
+
if (ev_document_load (document, uri, &error)) {
if (ev_window->priv->document)
g_object_unref (ev_window->priv->document);
ev_sidebar_set_document (EV_SIDEBAR (ev_window->priv->sidebar),
document);
- g_signal_connect_object (G_OBJECT (document),
- "notify::title",
- G_CALLBACK (update_window_title),
- ev_window, 0);
-
update_action_sensitivity (ev_window);
} else {