MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / fire

Method fire

src/env.cpp:104–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void ModuleNotification::fire(QString path, std::size_t fileSize)
105{
106 if (m_loaded.contains(path)) {
107 // don't notify if it's been loaded before
108 return;
109 }
110
111 m_loaded.insert(path);
112
113 // constructing a Module will query the version info of the file, which seems
114 // to generate an access violation for at least plugin_python.dll on Windows 7
115 //
116 // it's not clear what the problem is, but making sure this is deferred until
117 // _after_ the dll is loaded seems to fix it
118 //
119 // so this queues the callback in the main thread
120
121 if (m_f) {
122 QMetaObject::invokeMethod(
123 m_object,
124 [path, fileSize, f = m_f] {
125 f(Module(path, fileSize));
126 },
127 Qt::QueuedConnection);
128 }
129}
130
131Environment::Environment() {}
132

Callers 1

onModuleLoadedMethod · 0.80

Calls 2

ModuleClass · 0.70
insertMethod · 0.45

Tested by

no test coverage detected