# HG changeset patch # User Teemu Piippo # Date 1417403422 -7200 # Node ID 147497785496fce7edfb4818772e4ada23e97766 # Parent f025ab5e57ac33d32d8e1b10c3ec7b28c5d4c570 - fixed stability problems diff -r f025ab5e57ac -r 147497785496 src/basics.h --- 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 #include #include +#include #include "macros.h" class LDObject; diff -r f025ab5e57ac -r 147497785496 src/glCompiler.cc --- 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(); } diff -r f025ab5e57ac -r 147497785496 src/ldDocument.cc --- 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; } diff -r f025ab5e57ac -r 147497785496 src/ldDocument.h --- 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) diff -r f025ab5e57ac -r 147497785496 src/ldObject.cc --- 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());