From: vsr Date: Wed, 15 Oct 2014 16:16:51 +0000 (+0400) Subject: Minor change: setWorkingMode() method of QtxResourceMgr returns previous working... X-Git-Tag: V7_5_0b1~20^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f4f5c5e0dc3f809ea934d6b1d5501bcc96ee6558;p=modules%2Fgui.git Minor change: setWorkingMode() method of QtxResourceMgr returns previous working mode now --- diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index a63720714..62bc2441e 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -3286,14 +3286,13 @@ void LightApp_Application::loadDockWindowsState() else if ( activeStudy() ) modName = "nomodule"; - QtxResourceMgr::WorkingMode prevMode = aResMgr->workingMode(); - aResMgr->setWorkingMode( QtxResourceMgr::IgnoreUserValues ); + QtxResourceMgr::WorkingMode prevMode = aResMgr->setWorkingMode( QtxResourceMgr::IgnoreUserValues ); QByteArray aDefaultState; aResMgr->value( "windows_geometry", modName, aDefaultState ); QByteArray aDefaultVisibility; aResMgr->value( "windows_visibility", modName, aDefaultVisibility ); bool hasDefaultVisibility = !aDefaultVisibility.isEmpty(); - aResMgr->setWorkingMode(prevMode); + aResMgr->setWorkingMode( prevMode ); if( !storeWin && !storeTb && aDefaultState.isEmpty() && !hasDefaultVisibility) return; diff --git a/src/LightApp/LightApp_PreferencesDlg.cxx b/src/LightApp/LightApp_PreferencesDlg.cxx index e2d29ec6f..991cf2723 100644 --- a/src/LightApp/LightApp_PreferencesDlg.cxx +++ b/src/LightApp/LightApp_PreferencesDlg.cxx @@ -146,8 +146,7 @@ void LightApp_PreferencesDlg::onDefault() { if ( myPrefs && myPrefs->resourceMgr() ) { - QtxResourceMgr::WorkingMode prev = myPrefs->resourceMgr()->workingMode(); - myPrefs->resourceMgr()->setWorkingMode( QtxResourceMgr::IgnoreUserValues ); + QtxResourceMgr::WorkingMode prev = myPrefs->resourceMgr()->setWorkingMode( QtxResourceMgr::IgnoreUserValues ); myPrefs->retrieve(); myPrefs->resourceMgr()->setWorkingMode( prev ); } diff --git a/src/Qtx/QtxResourceMgr.cxx b/src/Qtx/QtxResourceMgr.cxx index d3c2aa098..7b2688844 100644 --- a/src/Qtx/QtxResourceMgr.cxx +++ b/src/Qtx/QtxResourceMgr.cxx @@ -1409,11 +1409,14 @@ QtxResourceMgr::WorkingMode QtxResourceMgr::workingMode() const Note, that setValue() method always put the value to the user settings file. \param mode new working mode + \return previous working mode \sa workingMode(), value(), hasValue(), hasSection(), setValue() */ -void QtxResourceMgr::setWorkingMode( WorkingMode mode ) +QtxResourceMgr::WorkingMode QtxResourceMgr::setWorkingMode( WorkingMode mode ) { + WorkingMode m = myWorkingMode; myWorkingMode = mode; + return m; } /*! diff --git a/src/Qtx/QtxResourceMgr.h b/src/Qtx/QtxResourceMgr.h index 6abab3010..991019660 100644 --- a/src/Qtx/QtxResourceMgr.h +++ b/src/Qtx/QtxResourceMgr.h @@ -86,7 +86,7 @@ public: void clear(); WorkingMode workingMode() const; - void setWorkingMode( WorkingMode ); + WorkingMode setWorkingMode( WorkingMode ); bool value( const QString&, const QString&, int& ) const; bool value( const QString&, const QString&, double& ) const;