diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-27 12:45:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-27 12:45:55 -0500 |
| commit | 892a19bfc613bbc6d157eced8356314026febbac (patch) | |
| tree | 90a9a40896a08e064cf0f5cfd27ace47b50ce65f /src/env.h | |
| parent | 146360542d4ba186ca38002f618e974ed1b1766a (diff) | |
| parent | 21cddd0ad3cef165c3860c2031b4cd00802c499d (diff) | |
Merge pull request #906 from isanae/various-fixes
Collection of small fixes
Diffstat (limited to 'src/env.h')
| -rw-r--r-- | src/env.h | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -119,6 +119,29 @@ private: }; +class ModuleNotification +{ +public: + ModuleNotification(QObject* o, std::function<void (Module)> f); + ~ModuleNotification(); + + ModuleNotification(const ModuleNotification&) = delete; + ModuleNotification& operator=(const ModuleNotification&) = delete; + + ModuleNotification(ModuleNotification&&) = default; + ModuleNotification& operator=(ModuleNotification&&) = default; + + void setCookie(void* c); + void fire(QString path, std::size_t fileSize); + +private: + void* m_cookie; + QObject* m_object; + std::set<QString> m_loaded; + std::function<void (Module)> m_f; +}; + + // represents the process's environment // class Environment @@ -147,6 +170,16 @@ public: // const Metrics& metrics() const; + // timezone + // + QString timezone() const; + + // will call `f` on the same thread `o` is running on every time a module + // is loaded in the process + // + std::unique_ptr<ModuleNotification> onModuleLoaded( + QObject* o, std::function<void (Module)> f); + // logs the environment // void dump(const Settings& s) const; |
