From 8424d441aa1a5c1e2400dc0148252972b924f4cb Mon Sep 17 00:00:00 2001 From: caremoli Date: Tue, 22 Jun 2010 09:40:50 +0000 Subject: [PATCH] CCAR: optimization for autoupdate --- src/SUIT/SUIT_DataObject.cxx | 1 + src/SUIT/SUIT_TreeModel.cxx | 7 ++++--- src/SalomeApp/SalomeApp_Application.cxx | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/SUIT/SUIT_DataObject.cxx b/src/SUIT/SUIT_DataObject.cxx index 93afce809..8ca7fe141 100755 --- a/src/SUIT/SUIT_DataObject.cxx +++ b/src/SUIT/SUIT_DataObject.cxx @@ -887,6 +887,7 @@ void SUIT_DataObject::Signal::deleteLater( SUIT_DataObject* object ) void SUIT_DataObject::updateItem() { + if(modified())return; setModified(true); signal()->emitUpdated(this); } diff --git a/src/SUIT/SUIT_TreeModel.cxx b/src/SUIT/SUIT_TreeModel.cxx index 6d318774f..8eab45e8c 100755 --- a/src/SUIT/SUIT_TreeModel.cxx +++ b/src/SUIT/SUIT_TreeModel.cxx @@ -673,6 +673,7 @@ QVariant SUIT_TreeModel::data( const QModelIndex& index, int role ) const return QVariant(); SUIT_DataObject* obj = object( index ); + obj->setModified(false); QColor c; QVariant val; @@ -1222,7 +1223,7 @@ SUIT_TreeModel::TreeItem* SUIT_TreeModel::createItem( SUIT_DataObject* obj, endInsertRows(); - obj->setModified(false); + //obj->setModified(false); return myItems[ obj ]; } @@ -1253,7 +1254,7 @@ void SUIT_TreeModel::updateItem( SUIT_TreeModel::TreeItem* item ) QModelIndex firstIdx = index( obj, 0 ); QModelIndex lastIdx = index( obj, columnCount() - 1 ); emit dataChanged( firstIdx, lastIdx ); - obj->setModified(false); + //obj->setModified(false); } /*! @@ -1270,7 +1271,7 @@ void SUIT_TreeModel::updateItem( SUIT_DataObject* obj) QModelIndex firstIdx = index( obj, 0 ); QModelIndex lastIdx = index( obj, columnCount() - 1 ); emit dataChanged( firstIdx, lastIdx ); - obj->setModified(false); + //obj->setModified(false); } diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 215abb344..63c1df391 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -832,7 +832,7 @@ QWidget* SalomeApp_Application::createWindow( const int flag ) // temporary commented //ob->setUpdater( new SalomeApp_Updater() ); - ob->setAutoUpdate(false); + ob->setAutoUpdate(true); connect( ob, SIGNAL( doubleClicked( SUIT_DataObject* ) ), this, SLOT( onDblClick( SUIT_DataObject* ) ) ); -- 2.39.2