From 9cfdb6b1088a7425c610b5a29e44e69dbbe6ef1a Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 9 Jun 2020 22:13:02 +0300 Subject: [PATCH] Use a global property instead of local variable --- src/CAM/CAM_Application.cxx | 5 +++-- src/CAM/CAM_Application.h | 3 --- src/LightApp/LightApp_Application.cxx | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/CAM/CAM_Application.cxx b/src/CAM/CAM_Application.cxx index aeabb7a47..fd2b0b948 100644 --- a/src/CAM/CAM_Application.cxx +++ b/src/CAM/CAM_Application.cxx @@ -101,6 +101,7 @@ CAM_Application::CAM_Application( const bool autoLoad ) myAutoLoad( autoLoad ), myBlocked( false ) { + setProperty("activateModule", false); readModuleList(); } @@ -417,7 +418,7 @@ bool CAM_Application::activateModule( const QString& modName ) bool res = false; if ( !modName.isEmpty() ) { - myActvatingModule = modName; + setProperty("activateModule", true); CAM_Module* mod = module( modName ); if ( !mod ) mod = loadModule( modName ); @@ -425,7 +426,7 @@ bool CAM_Application::activateModule( const QString& modName ) if ( mod ) res = activateModule( mod ); - myActvatingModule = QString(); + setProperty("activateModule", false); } else res = activateModule( 0 ); diff --git a/src/CAM/CAM_Application.h b/src/CAM/CAM_Application.h index 0dae7d11f..b0b69d3f6 100644 --- a/src/CAM/CAM_Application.h +++ b/src/CAM/CAM_Application.h @@ -94,8 +94,6 @@ protected: virtual bool abortAllOperations(); - QString actvatingModule() const { return myActvatingModule; } - private: void readModuleList(); @@ -113,7 +111,6 @@ private: static ModuleInfoList myInfoList; //!< modules info list bool myAutoLoad; //!< auto loading flag bool myBlocked; //!< "blocked" flag, internal usage - QString myActvatingModule; //!< Name of currently activating module. }; #ifdef WIN32 diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 14a63145c..6440bbf1f 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -4960,7 +4960,7 @@ void LightApp_Application::onDesktopMessage( const QString& message ) QString moduleName = message.split( sectionSeparator ).last(); // Check name of current activating module name in order to avoid ciclik // call because of messages - if (actvatingModule().isNull()) { + if (!property("activateModule").toBool()) { CAM_Module* mod = module(moduleName); if (!mod) mod = module(moduleTitle(moduleName)); -- 2.39.2