diff --git a/bootstrap/socInstaller.py b/bootstrap/socInstaller.py index 7a3ac072..6149ce25 100755 --- a/bootstrap/socInstaller.py +++ b/bootstrap/socInstaller.py @@ -155,8 +155,8 @@ class Command ( object ): class GitRepository ( object ): @staticmethod - def getLocalRepository ( gitRepository ): - localRepo = gitRepository.split( '/' )[-1] + def getLocalRepository ( url ): + localRepo = url.split( '/' )[-1] if localRepo.endswith('.git'): localRepo = localRepo[:-4] return localRepo @@ -421,8 +421,8 @@ try: for gitSupport in gitSupports: if conf.rmSource: gitSupport.removeLocalRepo() gitSupport.clone() - if gitSupport.url.endswith('rapidjson'): - gitSupport.checkout( 'a1c4f32' ) + #if gitSupport.url.endswith('rapidjson'): + # gitSupport.checkout( 'a1c4f32' ) if conf.rmSource: gitCoriolis.removeLocalRepo() gitCoriolis.clone () diff --git a/hurricane/src/hurricane/Cell.cpp b/hurricane/src/hurricane/Cell.cpp index 997d36d4..08c4b6b5 100644 --- a/hurricane/src/hurricane/Cell.cpp +++ b/hurricane/src/hurricane/Cell.cpp @@ -930,6 +930,8 @@ void Cell::_postCreate() void Cell::_preDestroy() // ******************** { + notify( Flags::CellDestroyed ); + while ( _slaveEntityMap.size() ) { _slaveEntityMap.begin()->second->destroy(); } diff --git a/hurricane/src/hurricane/hurricane/Cell.h b/hurricane/src/hurricane/hurricane/Cell.h index b7390ba9..9eb42919 100644 --- a/hurricane/src/hurricane/hurricane/Cell.h +++ b/hurricane/src/hurricane/hurricane/Cell.h @@ -84,6 +84,7 @@ class Cell : public Entity { // Flags set for Observers. , CellAboutToChange = 0x00000100 , CellChanged = 0x00000200 + , CellDestroyed = 0x00000400 // Cell states , Terminal = 0x00001000 , FlattenLeaf = 0x00002000 diff --git a/hurricane/src/hurricane/hurricane/FileWriteGzStream.h b/hurricane/src/hurricane/hurricane/FileWriteGzStream.h index 8a688bcc..45fd78c0 100644 --- a/hurricane/src/hurricane/hurricane/FileWriteGzStream.h +++ b/hurricane/src/hurricane/hurricane/FileWriteGzStream.h @@ -18,6 +18,7 @@ #define HURRICANE_FILEWRITEGZSTREAM_H #include "rapidjson/rapidjson.h" +#include "rapidjson/filewritestream.h" namespace Hurricane { diff --git a/hurricane/src/viewer/CellViewer.cpp b/hurricane/src/viewer/CellViewer.cpp index 5d904650..b1a83889 100644 --- a/hurricane/src/viewer/CellViewer.cpp +++ b/hurricane/src/viewer/CellViewer.cpp @@ -65,13 +65,21 @@ namespace Hurricane { void CellObserver::notify ( unsigned int flags ) { CellViewer* viewer = getOwner(); - switch ( flags & (Cell::Flags::CellAboutToChange|Cell::Flags::CellChanged) ) { + switch ( flags & (Cell::Flags::CellAboutToChange + |Cell::Flags::CellChanged + |Cell::Flags::CellDestroyed) ) { case Cell::Flags::CellAboutToChange: viewer->emitCellAboutToChange(); break; case Cell::Flags::CellChanged: viewer->emitCellChanged(); break; + case Cell::Flags::CellDestroyed: + viewer->emitCellAboutToChange(); + viewer->removeHistory( viewer->getCell() ); + viewer->setCell( NULL ); + viewer->emitCellChanged(); + break; } } @@ -567,6 +575,12 @@ namespace Hurricane { _cellHistory.pop_front (); _cellHistory.push_back ( activeState ); + rebuildHistory (); + } + + + void CellViewer::rebuildHistory () + { list< shared_ptr >::iterator istate = _cellHistory.begin(); for ( size_t i=0 ; igetName() : "empty"; + + list< shared_ptr >::iterator istate + = find_if( _cellHistory.begin(), _cellHistory.end(), CellWidget::FindStateName(cellName) ); + + if (istate != _cellHistory.end()) { + _cellHistory.remove ( *istate ); + rebuildHistory (); + } + } + + void CellViewer::setState ( shared_ptr& state ) { static bool isEmitter = false; @@ -616,12 +644,14 @@ namespace Hurricane { = find_if( _cellHistory.begin(), _cellHistory.end(), CellWidget::FindStateName(cellName) ); if (istate != _cellHistory.end()) { + cerr << "CellViewer::setCell() " << (*istate)->getCell() << endl; + (*istate)->getCell()->addObserver( getCellObserver() ); emit stateChanged ( *istate ); return; } - cell->addObserver( getCellObserver() ); + if (cell) cell->addObserver( getCellObserver() ); _cellWidget->setCell( cell ); } diff --git a/hurricane/src/viewer/hurricane/viewer/CellViewer.h b/hurricane/src/viewer/hurricane/viewer/CellViewer.h index 31f3702a..291d8966 100644 --- a/hurricane/src/viewer/hurricane/viewer/CellViewer.h +++ b/hurricane/src/viewer/hurricane/viewer/CellViewer.h @@ -135,6 +135,7 @@ namespace Hurricane { void changeSelectionMode (); void setShowSelection ( bool ); void setState ( shared_ptr& ); + void removeHistory ( Cell* ); void openHistoryCell (); void openDesignBlob (); void saveDesignBlob (); @@ -160,6 +161,7 @@ namespace Hurricane { void createMenus (); void refreshTitle (); void refreshHistory (); + void rebuildHistory (); private: QString _getAbsWidgetPath ( const QString& relPath ) const; QMenu* _getParentMenu ( const QString& ) const;