X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FModuleList.h;h=c9a6f1f4d7effbf8068206bd2fd281b02621de60;hb=aee4e7ba34d87f609ea50327449b3eb67731561a;hp=7ff5e19b88aceefdadd56b994d0cdea29cf78cd1;hpb=2a25d7039f6fbfd1d5bae87fd9fd91fdf316459a;p=lyx.git diff --git a/src/ModuleList.h b/src/ModuleList.h index 7ff5e19b88..c9a6f1f4d7 100644 --- a/src/ModuleList.h +++ b/src/ModuleList.h @@ -57,7 +57,7 @@ public: std::vector const & excludes, std::string const & catgy); /// whether the required packages are available - bool isAvailable(); + bool isAvailable() const; /// std::string const & getName() const { return name_; } /// @@ -102,10 +102,12 @@ private: std::vector excluded_modules_; /// Category, also used in the UI std::string category_; + // these are mutable because they are used to cache the results + // or an otherwise const operation. /// - bool checked_; + mutable bool checked_; /// - bool available_; + mutable bool available_; }; typedef std::vector LyXModuleList; @@ -132,8 +134,10 @@ public: bool empty() const { return modlist_.empty(); } /// Returns a pointer to the LyXModule with filename str. /// Returns a null pointer if no such module is found. + LyXModule const * operator[](std::string const & str) const; + /// LyXModule * operator[](std::string const & str); -private: + private: /// noncopyable ModuleList(ModuleList const &); /// @@ -147,6 +151,6 @@ private: std::vector modlist_; }; -extern ModuleList moduleList; +extern ModuleList theModuleList; } #endif