- fixed stability problems

Mon, 01 Dec 2014 05:10:22 +0200

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Mon, 01 Dec 2014 05:10:22 +0200
changeset 920
147497785496
parent 909
f025ab5e57ac
child 921
e2e9f594de66
child 926
e1ae2dbcae8e
child 943
af81220741d9

- fixed stability problems

src/basics.h file | annotate | diff | comparison | revisions
src/glCompiler.cc file | annotate | diff | comparison | revisions
src/ldDocument.cc file | annotate | diff | comparison | revisions
src/ldDocument.h file | annotate | diff | comparison | revisions
src/ldObject.cc file | annotate | diff | comparison | revisions
--- a/src/basics.h	Wed Nov 05 23:41:58 2014 +0200
+++ b/src/basics.h	Mon Dec 01 05:10:22 2014 +0200
@@ -23,6 +23,7 @@
 #include <QMetaType>
 #include <QVector3D>
 #include <QSharedPointer>
+#include <functional>
 #include "macros.h"
 
 class LDObject;
--- a/src/glCompiler.cc	Wed Nov 05 23:41:58 2014 +0200
+++ b/src/glCompiler.cc	Mon Dec 01 05:10:22 2014 +0200
@@ -262,8 +262,13 @@
 {
 	RemoveDuplicates (m_staged);
 
-	for (LDObjectPtr obj : m_staged)
-		compileObject (obj);
+	for (auto it = m_staged.begin(); it != m_staged.end(); ++it)
+	{
+		if (*it == null)
+			continue;
+
+		compileObject (*it);
+	}
 
 	m_staged.clear();
 }
--- a/src/ldDocument.cc	Wed Nov 05 23:41:58 2014 +0200
+++ b/src/ldDocument.cc	Mon Dec 01 05:10:22 2014 +0200
@@ -582,9 +582,9 @@
 	// If we have unsaved changes, warn and give the option of saving.
 	if (hasUnsavedChanges())
 	{
-		QString message = format (tr ("There are unsaved changes to %1. Should it be saved?"), getDisplayName());
+		QString message = format (QObject::tr ("There are unsaved changes to %1. Should it be saved?"), getDisplayName());
 
-		int button = msgbox::question (g_win, tr ("Unsaved Changes"), message,
+		int button = msgbox::question (g_win, QObject::tr ("Unsaved Changes"), message,
 			(msgbox::Yes | msgbox::No | msgbox::Cancel), msgbox::Cancel);
 
 		switch (button)
@@ -594,8 +594,8 @@
 				// If we don't have a file path yet, we have to ask the user for one.
 				if (name().length() == 0)
 				{
-					QString newpath = QFileDialog::getSaveFileName (g_win, tr ("Save As"),
-						CurrentDocument()->name(), tr ("LDraw files (*.dat *.ldr)"));
+					QString newpath = QFileDialog::getSaveFileName (g_win, QObject::tr ("Save As"),
+						CurrentDocument()->name(), QObject::tr ("LDraw files (*.dat *.ldr)"));
 
 					if (newpath.length() == 0)
 						return false;
@@ -605,10 +605,10 @@
 
 				if (not save())
 				{
-					message = format (tr ("Failed to save %1 (%2)\nDo you still want to close?"),
+					message = format (QObject::tr ("Failed to save %1 (%2)\nDo you still want to close?"),
 						name(), strerror (errno));
 
-					if (msgbox::critical (g_win, tr ("Save Failure"), message,
+					if (msgbox::critical (g_win, QObject::tr ("Save Failure"), message,
 						(msgbox::Yes | msgbox::No), msgbox::No) == msgbox::No)
 					{
 						return false;
@@ -1285,7 +1285,7 @@
 	if (not defaultName().isEmpty())
 		return "[" + defaultName() + "]";
 
-	return tr ("untitled");
+	return QObject::tr ("untitled");
 }
 
 // =============================================================================
@@ -1461,7 +1461,7 @@
 	g_loadingLogoedStuds = true;
 	g_logoedStud = OpenDocument ("stud-logo.dat", true, true);
 	g_logoedStud2 = OpenDocument ("stud2-logo.dat", true, true);
-	print (LDDocument::tr ("Logoed studs loaded.\n"));
+	print (QObject::tr ("Logoed studs loaded.\n"));
 	g_loadingLogoedStuds = false;
 }
 
--- a/src/ldDocument.h	Wed Nov 05 23:41:58 2014 +0200
+++ b/src/ldDocument.h	Mon Dec 01 05:10:22 2014 +0200
@@ -60,7 +60,7 @@
 // The default name is a placeholder, initially suggested name for a file. The
 // primitive generator uses this to give initial names to primitives.
 //
-class LDDocument : public QObject
+class LDDocument
 {
 public:
 	PROPERTY (public,	QString,				name,			setName,			STOCK_WRITE)
--- a/src/ldObject.cc	Wed Nov 05 23:41:58 2014 +0200
+++ b/src/ldObject.cc	Mon Dec 01 05:10:22 2014 +0200
@@ -392,7 +392,7 @@
 	// Transform the objects
 	for (LDObjectPtr obj : objs)
 	{
-		assert (obj->type() != OBJ_Subfile);
+		// assert (obj->type() != OBJ_Subfile);
 		// Set the parent now so we know what inlined the object.
 		obj->setParent (self());
 		TransformObject (obj, transform(), position(), color());

mercurial