]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
the modification time is updated on model update
authorasl <asl@opencascade.com>
Thu, 14 Feb 2008 13:00:12 +0000 (13:00 +0000)
committerasl <asl@opencascade.com>
Thu, 14 Feb 2008 13:00:12 +0000 (13:00 +0000)
src/SUIT/SUIT_DataBrowser.cxx
src/SUIT/SUIT_DataBrowser.h

index 32c92c013b89c49db58eff8d04ca94375a2f02da..43680d59b362223a4f933cfc58777fc11dd693be 100644 (file)
@@ -255,7 +255,10 @@ void SUIT_DataBrowser::contextMenuEvent( QContextMenuEvent* e )
 */
 void SUIT_DataBrowser::init( SUIT_DataObject* root )
 {
-  setModel( new SUIT_ProxyModel( root, this ) );
+  SUIT_ProxyModel* m = new SUIT_ProxyModel( root, this );
+  connect( m, SIGNAL( modelUpdated() ), this, SLOT( onModelUpdated() ) );
+  
+  setModel( m );
   setItemDelegate( qobject_cast<SUIT_ProxyModel*>( model() )->delegate() );
   connect( treeView(), SIGNAL( sortingEnabled(bool ) ), 
           model(), SLOT( setSortingEnabled( bool ) ) );
@@ -272,3 +275,13 @@ void SUIT_DataBrowser::init( SUIT_DataObject* root )
 
   \sa updateKey(), setUpdateKey()
 */
+
+
+
+/*!
+  \brief Update internal modification time just after data model update
+*/
+void SUIT_DataBrowser::onModelUpdated()
+{
+  setModified();
+}
index 25794a685360789595480c64dc165728aead7aa4..604574dd9e70ea13ff1faa51e1a18c98e17efa1c 100644 (file)
@@ -69,6 +69,9 @@ private:
 signals:
   void             requestUpdate();
 
+private slots:
+  void             onModelUpdated();
+
 private:
   QShortcut*       myShortcut;
 };