MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / RootFSModel

Method RootFSModel

Source/Tools/FEXConfig/Main.cpp:270–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270RootFSModel::RootFSModel() {
271 auto INotifyFD = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
272
273 fextl::string RootFS = FEXCore::Config::GetDataDirectory(false) + "RootFS/";
274 int LocalFolderWD = inotify_add_watch(INotifyFD, RootFS.c_str(), IN_CREATE | IN_DELETE);
275
276 RootFS = FEXCore::Config::GetDataDirectory(true) + "RootFS/";
277 int GlobalFolderWD = inotify_add_watch(INotifyFD, RootFS.c_str(), IN_CREATE | IN_DELETE);
278 if (INotifyFD != -1 && (LocalFolderWD != -1 || GlobalFolderWD != -1)) {
279 INotifyReactor.enable_async_stop();
280 Thread = std::thread {&RootFSModel::INotifyThreadFunc, this, INotifyFD};
281 } else {
282 qWarning() << "Could not set up inotify. RootFS folder won't be monitored for changes.";
283 }
284
285 // Load initial data
286 Reload();
287}
288
289RootFSModel::~RootFSModel() {
290 INotifyReactor.stop_async();

Callers

nothing calls this directly

Calls 2

GetDataDirectoryFunction · 0.85
enable_async_stopMethod · 0.80

Tested by

no test coverage detected