Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evince/ChangeLog,v
retrieving revision 1.600
diff -u -r1.600 ChangeLog
--- ChangeLog	7 Aug 2005 17:23:27 -0000	1.600
+++ ChangeLog	8 Aug 2005 14:22:30 -0000
@@ -1,3 +1,9 @@
+2005-08-08  Dan Winship  <danw@novell.com>
+
+	* ps/ps-document.c (ps_document_get_info): Ignore the DSC %%Title
+	if it ends in ".dvi", since it would be better to just show the ps
+	file's filename in that case. Bug 312847.
+
 2005-08-07  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
 	* shell/ev-view.c: (view_update_range_and_current_page):
Index: ps/ps-document.c
===================================================================
RCS file: /cvs/gnome/evince/ps/ps-document.c,v
retrieving revision 1.55
diff -u -r1.55 ps-document.c
--- ps/ps-document.c	5 Aug 2005 07:28:22 -0000	1.55
+++ ps/ps-document.c	8 Aug 2005 14:22:32 -0000
@@ -1228,15 +1228,21 @@
 	PSDocument *ps = PS_DOCUMENT (document);
 
 	info = g_new0 (EvDocumentInfo, 1);
-	info->fields_mask = EV_DOCUMENT_INFO_TITLE |
-	                    EV_DOCUMENT_INFO_FORMAT |
+	info->fields_mask = EV_DOCUMENT_INFO_FORMAT |
 			    EV_DOCUMENT_INFO_CREATOR |
 			    EV_DOCUMENT_INFO_N_PAGES;
-	info->title = g_strdup (ps->doc->title);
 	info->format = ps->doc->epsf ? g_strdup (_("Encapsulated PostScript"))
 		                     : g_strdup (_("PostScript"));
 	info->creator = g_strdup (ps->doc->creator);
 	info->n_pages = ev_document_get_n_pages (document);
+
+	if (ps->doc->title) {
+		const char *ext = strrchr (ps->doc->title, '.');
+		if (!ext || strcmp (ext, ".dvi") != 0) {
+			info->title = g_strdup (ps->doc->title);
+			info->fields_mask |= EV_DOCUMENT_INFO_TITLE;
+		}
+	}
 
 	return info;
 }
