- removed rest of the uses of <anonymous>

Mon, 28 Apr 2014 17:34:10 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Mon, 28 Apr 2014 17:34:10 +0300
changeset 744
bbe0e1834065
parent 743
f82ca7b704f7
child 745
ab8adddc0f5c

- removed rest of the uses of <anonymous>

src/ldDocument.cc file | annotate | diff | comparison | revisions
src/mainWindow.cc file | annotate | diff | comparison | revisions
--- a/src/ldDocument.cc	Mon Apr 28 17:30:20 2014 +0300
+++ b/src/ldDocument.cc	Mon Apr 28 17:34:10 2014 +0300
@@ -543,8 +543,7 @@
 	// If we have unsaved changes, warn and give the option of saving.
 	if (hasUnsavedChanges())
 	{
-		String message = format (tr ("There are unsaved changes to %1. Should it be saved?"),
-			(name().length() > 0) ? name() : tr ("<anonymous>"));
+		String message = format (tr ("There are unsaved changes to %1. Should it be saved?"), getDisplayName());
 
 		int button = msgbox::question (g_win, tr ("Unsaved Changes"), message,
 			(msgbox::Yes | msgbox::No | msgbox::Cancel), msgbox::Cancel);
@@ -576,7 +575,8 @@
 						return false;
 					}
 				}
-			} break;
+				break;
+			}
 
 			case msgbox::Cancel:
 				return false;
--- a/src/mainWindow.cc	Mon Apr 28 17:30:20 2014 +0300
+++ b/src/mainWindow.cc	Mon Apr 28 17:34:10 2014 +0300
@@ -260,13 +260,11 @@
 	// Append our current file if we have one
 	if (getCurrentDocument())
 	{
-		if (getCurrentDocument()->name().length() > 0)
-			title += format (": %1", basename (getCurrentDocument()->name()));
-		else
-			title += format (": <anonymous>");
+		title += ": ";
+		title += getCurrentDocument()->getDisplayName();
 
 		if (getCurrentDocument()->getObjectCount() > 0 &&
-				getCurrentDocument()->getObject (0)->type() == LDObject::EComment)
+			getCurrentDocument()->getObject (0)->type() == LDObject::EComment)
 		{
 			// Append title
 			LDComment* comm = static_cast<LDComment*> (getCurrentDocument()->getObject (0));

mercurial