summaryrefslogtreecommitdiff
path: root/src/env.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-11-27 12:45:55 -0500
committerGitHub <noreply@github.com>2019-11-27 12:45:55 -0500
commit892a19bfc613bbc6d157eced8356314026febbac (patch)
tree90a9a40896a08e064cf0f5cfd27ace47b50ce65f /src/env.h
parent146360542d4ba186ca38002f618e974ed1b1766a (diff)
parent21cddd0ad3cef165c3860c2031b4cd00802c499d (diff)
Merge pull request #906 from isanae/various-fixes
Collection of small fixes
Diffstat (limited to 'src/env.h')
-rw-r--r--src/env.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/env.h b/src/env.h
index f95d1013..dc0fd864 100644
--- a/src/env.h
+++ b/src/env.h
@@ -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;