# HG changeset patch # User Santeri Piippo # Date 1393983571 -7200 # Node ID d4dda62c660059445e6e4b2d9dedd55473658d0a # Parent 851634b8589308057fbaf3caae9bfae96bdaab61 - renamed LDObject::deleteSelf to LDObject::destroy diff -r 851634b85893 -r d4dda62c6600 src/AddObjectDialog.cc --- a/src/AddObjectDialog.cc Wed Mar 05 02:33:58 2014 +0200 +++ b/src/AddObjectDialog.cc Wed Mar 05 03:39:31 2014 +0200 @@ -264,7 +264,7 @@ setWindowTitle (fmt (tr ("Edit %1"), typeName)); setWindowIcon (icon); - defaults->deleteSelf(); + defaults->destroy(); } // ============================================================================= diff -r 851634b85893 -r d4dda62c6600 src/Document.cc --- a/src/Document.cc Wed Mar 05 02:33:58 2014 +0200 +++ b/src/Document.cc Wed Mar 05 03:39:31 2014 +0200 @@ -142,11 +142,11 @@ // Clear everything from the model for (LDObject* obj : getObjects()) - obj->deleteSelf(); + obj->destroy(); // Clear the cache as well for (LDObject* obj : getCache()) - obj->deleteSelf(); + obj->destroy(); delete m_History; delete m_gldata; @@ -357,7 +357,7 @@ if (isAborted()) { for (LDObject* obj : m_Objects) - obj->deleteSelf(); + obj->destroy(); m_Objects.clear(); setDone (true); diff -r 851634b85893 -r d4dda62c6600 src/EditHistory.cc --- a/src/EditHistory.cc Wed Mar 05 02:33:58 2014 +0200 +++ b/src/EditHistory.cc Wed Mar 05 03:39:31 2014 +0200 @@ -131,7 +131,7 @@ void AddHistory::undo() const { LDObject* obj = getParent()->getDocument()->getObject (getIndex()); - obj->deleteSelf(); + obj->destroy(); } // ============================================================================= @@ -164,7 +164,7 @@ void DelHistory::redo() const { LDObject* obj = getParent()->getDocument()->getObject (getIndex()); - obj->deleteSelf(); + obj->destroy(); } // ============================================================================= diff -r 851634b85893 -r d4dda62c6600 src/ExternalPrograms.cc --- a/src/ExternalPrograms.cc Wed Mar 05 02:33:58 2014 +0200 +++ b/src/ExternalPrograms.cc Wed Mar 05 03:39:31 2014 +0200 @@ -178,7 +178,7 @@ writeObjects (objs, f); for (LDObject* obj : objs) - obj->deleteSelf(); + obj->destroy(); } else f.write ((obj->asText() + "\r\n").toUtf8()); @@ -319,7 +319,7 @@ { if (!obj->isScemantic()) { - obj->deleteSelf(); + obj->destroy(); continue; } diff -r 851634b85893 -r d4dda62c6600 src/GLRenderer.cc --- a/src/GLRenderer.cc Wed Mar 05 02:33:58 2014 +0200 +++ b/src/GLRenderer.cc Wed Mar 05 03:39:31 2014 +0200 @@ -1001,7 +1001,7 @@ for (LDObject* obj : objs) { compileList (obj, list); - obj->deleteSelf(); + obj->destroy(); } g_glInvert = oldinvert; @@ -1734,7 +1734,7 @@ for (LDObject* obj : objs) { verts << getVertices (obj); - obj->deleteSelf(); + obj->destroy(); } } @@ -2163,11 +2163,11 @@ LDObject* nextobj = ovlobj->next(); if (nextobj && nextobj->type() == LDObject::EEmpty) - nextobj->deleteSelf(); + nextobj->destroy(); // If the overlay object was there and the overlay itself is // not, remove the object. - ovlobj->deleteSelf(); + ovlobj->destroy(); } elif (meta.img && !ovlobj) { // Inverse case: image is there but the overlay object is diff -r 851634b85893 -r d4dda62c6600 src/LDObject.cc --- a/src/LDObject.cc Wed Mar 05 02:33:58 2014 +0200 +++ b/src/LDObject.cc Wed Mar 05 03:39:31 2014 +0200 @@ -219,7 +219,7 @@ getFile()->setObject (idx, other); // Remove the old object - deleteSelf(); + destroy(); } // ============================================================================= @@ -258,7 +258,7 @@ // ============================================================================= // -void LDObject::deleteSelf() +void LDObject::destroy() { // If this object was selected, unselect it now if (isSelected()) @@ -397,7 +397,7 @@ { LDObject* obj = LDObject::getDefault (type); QString name = obj->typeName(); - obj->deleteSelf(); + obj->destroy(); return name; } @@ -576,7 +576,7 @@ if (bfc && bfc->m_statement == LDBFC::InvertNext) { // This is prefixed with an invertnext, thus remove it. - bfc->deleteSelf(); + bfc->destroy(); return; } } diff -r 851634b85893 -r d4dda62c6600 src/LDObject.h --- a/src/LDObject.h Wed Mar 05 02:33:58 2014 +0200 +++ b/src/LDObject.h Wed Mar 05 03:39:31 2014 +0200 @@ -100,7 +100,7 @@ LDObject* createCopy() const; // Deletes this object - void deleteSelf(); + void destroy(); // Index (i.e. line number) of this object long lineNumber() const; diff -r 851634b85893 -r d4dda62c6600 src/MainWindow.cc --- a/src/MainWindow.cc Wed Mar 05 02:33:58 2014 +0200 +++ b/src/MainWindow.cc Wed Mar 05 03:39:31 2014 +0200 @@ -303,7 +303,7 @@ // Delete the objects that were being selected for (LDObject* obj : selCopy) - obj->deleteSelf(); + obj->destroy(); refresh(); return selCopy.size(); @@ -700,7 +700,7 @@ void MainWindow::deleteObjects (LDObjectList objs) { for (LDObject* obj : objs) - obj->deleteSelf(); + obj->destroy(); } // ============================================================================= diff -r 851634b85893 -r d4dda62c6600 src/Types.cc --- a/src/Types.cc Wed Mar 05 02:33:58 2014 +0200 +++ b/src/Types.cc Wed Mar 05 03:39:31 2014 +0200 @@ -334,7 +334,7 @@ for (LDObject * obj : objs) { calcObject (obj); - obj->deleteSelf(); + obj->destroy(); } } break; diff -r 851634b85893 -r d4dda62c6600 src/actions/EditActions.cc --- a/src/actions/EditActions.cc Wed Mar 05 02:33:58 2014 +0200 +++ b/src/actions/EditActions.cc Wed Mar 05 03:39:31 2014 +0200 @@ -129,19 +129,18 @@ LDObjectList objs; if (obj->type() == LDObject::ESubfile) - objs = static_cast (obj)->inlineContents ( - (LDSubfile::InlineFlags) - ( (deep) ? LDSubfile::DeepInline : 0) | - LDSubfile::CacheInline - ); + { + LDSubfile::InlineFlags flags = deep ? LDSubfile::DeepCacheInline : LDSubfile::CacheInline; + objs = static_cast (obj)->inlineContents (flags); + } else continue; // Merge in the inlined objects - for (LDObject * inlineobj : objs) + for (LDObject* inlineobj : objs) { QString line = inlineobj->asText(); - inlineobj->deleteSelf(); + inlineobj->destroy(); LDObject* newobj = parseLine (line); getCurrentDocument()->insertObj (idx++, newobj); newobj->select(); @@ -149,7 +148,7 @@ } // Delete the subfile now as it's been inlined. - obj->deleteSelf(); + obj->destroy(); } g_win->refresh(); @@ -194,7 +193,7 @@ R()->compileObject (t); // Delete this quad now, it has been split. - obj->deleteSelf(); + obj->destroy(); num++; } diff -r 851634b85893 -r d4dda62c6600 src/actions/MainActions.cc --- a/src/actions/MainActions.cc Wed Mar 05 02:33:58 2014 +0200 +++ b/src/actions/MainActions.cc Wed Mar 05 03:39:31 2014 +0200 @@ -844,7 +844,7 @@ { // Remove the selection now for (LDObject* obj : selection()) - obj->deleteSelf(); + obj->destroy(); // Compile all objects in the new subfile for (LDObject* obj : doc->getObjects())