# HG changeset patch # User Teemu Piippo # Date 1485735522 -7200 # Node ID 5903cfa6b4d9c72b740d7a0f575b7928f2e6e6a1 # Parent 1738bdaf36d6a8ca55389e81ec1df61724312de2 Removed LDDocument::getObjectCount (superceded by Model::size) diff -r 1738bdaf36d6 -r 5903cfa6b4d9 src/glRenderer.cpp --- a/src/glRenderer.cpp Mon Jan 30 00:59:06 2017 +0200 +++ b/src/glRenderer.cpp Mon Jan 30 02:18:42 2017 +0200 @@ -1468,7 +1468,7 @@ int lastOverlayPosition = -1; bool found = false; - for (i = 0; i < document()->getObjectCount(); ++i) + for (i = 0; i < document()->size(); ++i) { LDObject* object = document()->getObject (i); diff -r 1738bdaf36d6 -r 5903cfa6b4d9 src/ldDocument.cpp --- a/src/ldDocument.cpp Mon Jan 30 00:59:06 2017 +0200 +++ b/src/ldDocument.cpp Mon Jan 30 02:18:42 2017 +0200 @@ -387,13 +387,6 @@ // ============================================================================= // -int LDDocument::getObjectCount() const -{ - return countof(objects()); -} - -// ============================================================================= -// bool LDDocument::hasUnsavedChanges() const { return not isCache() and history()->position() != savePosition(); diff -r 1738bdaf36d6 -r 5903cfa6b4d9 src/ldDocument.h --- a/src/ldDocument.h Mon Jan 30 00:59:06 2017 +0200 +++ b/src/ldDocument.h Mon Jan 30 02:18:42 2017 +0200 @@ -70,7 +70,6 @@ void forgetObject (LDObject* obj); QString fullPath(); QString getDisplayName(); - int getObjectCount() const; const QSet& getSelection() const; LDGLData* glData(); bool hasUnsavedChanges() const; diff -r 1738bdaf36d6 -r 5903cfa6b4d9 src/mainwindow.cpp --- a/src/mainwindow.cpp Mon Jan 30 00:59:06 2017 +0200 +++ b/src/mainwindow.cpp Mon Jan 30 02:18:42 2017 +0200 @@ -326,8 +326,8 @@ title += ": "; title += m_currentDocument->getDisplayName(); - if (m_currentDocument->getObjectCount() > 0 and - m_currentDocument->getObject (0)->type() == OBJ_Comment) + if (m_currentDocument->size() > 0 and + m_currentDocument->getObject(0)->type() == OBJ_Comment) { // Append title LDComment* comm = static_cast (m_currentDocument->getObject (0)); @@ -600,7 +600,7 @@ return (*(selectedObjects().end() - 1))->lineNumber() + 1; // Otherwise place the object at the end. - return m_currentDocument->getObjectCount(); + return m_currentDocument->size(); } // --------------------------------------------------------------------------------------------------------------------- diff -r 1738bdaf36d6 -r 5903cfa6b4d9 src/toolsets/viewtoolset.cpp --- a/src/toolsets/viewtoolset.cpp Mon Jan 30 00:59:06 2017 +0200 +++ b/src/toolsets/viewtoolset.cpp Mon Jan 30 02:18:42 2017 +0200 @@ -255,7 +255,7 @@ { bool ok; int defaultValue = (countof(selectedObjects()) == 1) ? (*selectedObjects().begin())->lineNumber() : 0; - int index = QInputDialog::getInt (nullptr, "Go to line", "Go to line:", defaultValue, 1, currentDocument()->getObjectCount(), 1, &ok); + int index = QInputDialog::getInt (nullptr, "Go to line", "Go to line:", defaultValue, 1, currentDocument()->size(), 1, &ok); if (ok) {