From cb99c69f4b913f7e6ac6a4a02215124afd21bd58 Mon Sep 17 00:00:00 2001 From: asl Date: Thu, 14 Feb 2008 13:00:12 +0000 Subject: [PATCH] the modification time is updated on model update --- src/SUIT/SUIT_DataBrowser.cxx | 15 ++++++++++++++- src/SUIT/SUIT_DataBrowser.h | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/SUIT/SUIT_DataBrowser.cxx b/src/SUIT/SUIT_DataBrowser.cxx index 32c92c013..43680d59b 100644 --- a/src/SUIT/SUIT_DataBrowser.cxx +++ b/src/SUIT/SUIT_DataBrowser.cxx @@ -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( 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(); +} diff --git a/src/SUIT/SUIT_DataBrowser.h b/src/SUIT/SUIT_DataBrowser.h index 25794a685..604574dd9 100644 --- a/src/SUIT/SUIT_DataBrowser.h +++ b/src/SUIT/SUIT_DataBrowser.h @@ -69,6 +69,9 @@ private: signals: void requestUpdate(); +private slots: + void onModelUpdated(); + private: QShortcut* myShortcut; }; -- 2.39.2