| 268 | } |
| 269 | |
| 270 | RootFSModel::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 | |
| 289 | RootFSModel::~RootFSModel() { |
| 290 | INotifyReactor.stop_async(); |
nothing calls this directly
no test coverage detected