From 2bd3f1b794ba71b2b4890045ba82c898581d9244 Mon Sep 17 00:00:00 2001 From: Dirk Wilden Date: Wed, 13 May 2009 14:29:42 +0000 Subject: [PATCH] clearAll / deleteAllObjects changed git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6061 383ad7c9-94d9-4d36-a494-682f7c89f535 --- Core/Core.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Core/Core.cc b/Core/Core.cc index 3cf26952..532c9e86 100644 --- a/Core/Core.cc +++ b/Core/Core.cc @@ -760,9 +760,10 @@ void Core::setMaxFrameRate( int _rate ) { void Core::clearAll() { - objectRoot_->deleteSubtree(); + + slotDeleteAllObjects(); + emit allCleared(); - emit signalObjectUpdated(-1); slotScriptInfo( "core" , "clearAll()" ); } @@ -1245,9 +1246,12 @@ void Core::slotDeleteAllObjects( ){ // Remember ids std::vector< int > ids; - for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS) ; - o_it != PluginFunctions::objectsEnd(); ++o_it) { - ids.push_back( o_it->id() ); + + BaseObject* current = objectRoot_->next(); + + while( current != objectRoot_ ){ + ids.push_back( current->id() ); + current = current->next(); } // remove the whole subtree below the root -- GitLab