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
...@@ -210,7 +210,9 @@ Core::init() { ...@@ -210,7 +210,9 @@ Core::init() {
// Initialize the first object as the root Object for the object tree // Initialize the first object as the root Object for the object tree
objectRoot_ = dynamic_cast< BaseObject* > ( new GroupObject("ObjectRoot") ); objectRoot_ = dynamic_cast< BaseObject* > ( new GroupObject("ObjectRoot") );
PluginFunctions::setDataRoot( 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() ) { if ( OpenFlipper::Options::gui() ) {
......
...@@ -991,7 +991,19 @@ private: ...@@ -991,7 +991,19 @@ private:
void jobCanceled( QString _jobId ); void jobCanceled( QString _jobId );
/** @} */ /** @} */
//===========================================================================
/** @name Object Manager
* @{ */
//===========================================================================
private slots:
/// This slot is called by the object manager when a new object is created
void newObject(int _objectId);
/** @} */
private : private :
/// Id for the next backup /// Id for the next backup
......
...@@ -271,7 +271,13 @@ void Core::backupRequest( int _id , QString _name ) { ...@@ -271,7 +271,13 @@ void Core::backupRequest( int _id , QString _name ) {
++nextBackupId_; ++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 @@ ...@@ -61,6 +61,10 @@
//== TYPEDEFS ================================================================= //== TYPEDEFS =================================================================
//== Variables =================================================================
static ObjectManager objectManager_;
//== CLASS DEFINITION ========================================================= //== CLASS DEFINITION =========================================================
/** This counter is used to provide unique object ids. Every time a object is created /** This counter is used to provide unique object ids. Every time a object is created
...@@ -698,6 +702,23 @@ deleteData() { ...@@ -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 @@ ...@@ -60,6 +60,22 @@
#include <OpenFlipper/common/BaseObject.hh> #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 #endif // BASEOBJECTCORE_HH defined
//============================================================================= //=============================================================================
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment