src/file.cpp

changeset 500
cad8cdc42a64
parent 498
791c831c8020
child 503
bebe09014dd6
--- a/src/file.cpp	Sun Oct 06 21:37:05 2013 +0300
+++ b/src/file.cpp	Wed Oct 16 15:32:38 2013 +0300
@@ -619,7 +619,7 @@
 
 	// File is open, now save the model to it. Note that LDraw requires files to
 	// have DOS line endings, so we terminate the lines with \r\n.
-for (LDObject * obj : objects())
+	for (LDObject* obj : objects())
 		f.write (obj->raw() + "\r\n");
 
 	// File is saved, now clean up.
@@ -1015,9 +1015,12 @@
 // =============================================================================
 // -----------------------------------------------------------------------------
 str LDFile::getShortName()
-{	if (name().length() > 0)
+{	if (!name().isEmpty())
 		return basename (name());
 
+	if (!defaultName().isEmpty())
+		return defaultName();
+
 	return tr ("<anonymous>");
 }
 

mercurial