Skip to content
Snippets Groups Projects
Commit a731b7cd authored by Jan Möbius's avatar Jan Möbius
Browse files

Added ObjectManager

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7783 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4e5b3285
No related branches found
No related tags found
No related merge requests found
......@@ -211,6 +211,8 @@ Core::init() {
objectRoot_ = dynamic_cast< BaseObject* > ( new GroupObject("ObjectRoot") );
PluginFunctions::setDataRoot( objectRoot_ );
// Bring up the object manager ( has to be done after the rootobject is created)
connect(getObjectManager(),SIGNAL(newObject(int)), this ,SLOT(newObject(int)));
if ( OpenFlipper::Options::gui() ) {
......
......@@ -992,6 +992,18 @@ private:
/** @} */
//===========================================================================
/** @name Object Manager
* @{ */
//===========================================================================
private slots:
/// This slot is called by the object manager when a new object is created
void newObject(int _objectId);
/** @} */
private :
/// Id for the next backup
......
......@@ -271,7 +271,13 @@ void Core::backupRequest( int _id , QString _name ) {
++nextBackupId_;
}
//========================================================================================
// === Object Manager ============================
//========================================================================================
/// This slot is called by the object manager when a new object is created
void Core::newObject(int _objectId) {
}
......
......@@ -61,6 +61,10 @@
//== TYPEDEFS =================================================================
//== Variables =================================================================
static ObjectManager objectManager_;
//== CLASS DEFINITION =========================================================
/** This counter is used to provide unique object ids. Every time a object is created
......@@ -698,6 +702,23 @@ deleteData() {
ObjectManager::ObjectManager() {
}
ObjectManager::~ObjectManager() {
}
void ObjectManager::objectCreated(int _objectId)
{
emit newObject(_objectId);
}
ObjectManager* getObjectManager() {
return &objectManager_;
}
//=============================================================================
......@@ -60,6 +60,22 @@
#include <OpenFlipper/common/BaseObject.hh>
class ObjectManager : public QObject {
Q_OBJECT
signals:
void newObject( int _objectId );
public:
ObjectManager();
~ObjectManager();
void objectCreated( int _objectId );
};
ObjectManager* getObjectManager();
//=============================================================================
#endif // BASEOBJECTCORE_HH defined
//=============================================================================
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment