From b4d147ac825fa9f9cbc6dfb5a0601c4e9143c1bf Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 17 Apr 2013 09:26:40 +0000 Subject: [PATCH] Fix problem that user material database is not watched by resource manager when file is first time created. --- src/Qtx/QtxResourceMgr.cxx | 14 +++++++++++++- src/Qtx/QtxResourceMgr.h | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Qtx/QtxResourceMgr.cxx b/src/Qtx/QtxResourceMgr.cxx index 58a1df362..2e06646ce 100644 --- a/src/Qtx/QtxResourceMgr.cxx +++ b/src/Qtx/QtxResourceMgr.cxx @@ -2289,7 +2289,11 @@ bool QtxResourceMgr::save() if ( myResources.isEmpty() || !myHasUserValues ) return true; - return fmt->save( myResources[0] ); + bool result = fmt->save( myResources[0] ); + + saved(); + + return result; } /*! @@ -2890,6 +2894,14 @@ QString QtxResourceMgr::globalFileName( const QString& appName ) const return QString( "%1.%2" ).arg( appName ).arg( currentFormat() ); } +/*! + \brief This function is called after user configuration file is saved. + Can be redefined in the successor classes, default implementation does nothing. +*/ +void QtxResourceMgr::saved() +{ +} + /*! \brief Perform substitution of the patterns like \%A, \%B, etc by values from the map. diff --git a/src/Qtx/QtxResourceMgr.h b/src/Qtx/QtxResourceMgr.h index 7802e7028..e0ccdd9a0 100644 --- a/src/Qtx/QtxResourceMgr.h +++ b/src/Qtx/QtxResourceMgr.h @@ -180,6 +180,8 @@ protected: virtual QString userFileName( const QString&, const bool = true ) const; virtual QString globalFileName( const QString& ) const; + virtual void saved(); + private: void initialize( const bool = true ) const; QString substMacro( const QString&, const QMap& ) const; -- 2.39.2