MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / ScheduleReload

Method ScheduleReload

TranslucentTB/managers/configmanager.cpp:216–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216bool ConfigManager::ScheduleReload()
217{
218 if (m_ReloadTimer)
219 {
220 LARGE_INTEGER waitTime{};
221 // 200 ms, relative to current time. arbitrarily chosen to get a balance
222 // between feeling snappy and not triggering errors due to the various weird
223 // ways editors save files.
224 waitTime.QuadPart = -2000000;
225 if (SetWaitableTimer(m_ReloadTimer.get(), &waitTime, 0, TimerCallback, this, false))
226 {
227 return true;
228 }
229 else
230 {
231 LastErrorHandle(spdlog::level::warn, L"Failed to set waitable timer");
232 }
233 }
234
235 return false;
236}
237
238ConfigManager::ConfigManager(const std::optional<std::filesystem::path> &storageFolder, bool &fileExists, callback_t callback, void *context) :
239 m_ConfigPath(DetermineConfigPath(storageFolder)),

Callers 1

WatcherCallbackMethod · 0.80

Calls 1

getMethod · 0.80

Tested by

no test coverage detected