diff --git a/state.cc b/state.cc index 111b890..b4e3410 100644 --- a/state.cc +++ b/state.cc @@ -24,7 +24,7 @@ int source; std::string local_dir; -int root_scope; +root_scope_holder root_scope; int root_menu; int root_desktop; diff --git a/state.h b/state.h index b211de3..c561ea5 100644 --- a/state.h +++ b/state.h @@ -32,6 +32,7 @@ */ #include +#include "LogSingleton.h" enum attend_mode { attended = 0, unattended, chooseronly }; extern enum attend_mode unattended_mode; @@ -42,7 +43,22 @@ extern int source; extern std::string local_dir; extern int root_text; -extern int root_scope; + +class root_scope_holder +{ +public: + void operator=(int v) { + int old = val; + val = v; + Log(LOG_TIMESTAMP) << "root_scope: " << old << " -> " << v << endLog; + } + operator int() const { return val; } +private: + int val = 0; +}; + +extern root_scope_holder root_scope; + extern int root_menu; extern int root_desktop;