| 340 | } |
| 341 | |
| 342 | void RootFSModel::INotifyThreadFunc(int INotifyFD) { |
| 343 | fasio::posix_descriptor INotify {INotifyReactor, INotifyFD}; |
| 344 | |
| 345 | INotify.async_wait([this, INotifyFD](fasio::error ec) { |
| 346 | // Spin through the events, we don't actually care what they are |
| 347 | constexpr size_t DATA_SIZE = (16 * (sizeof(struct inotify_event) + NAME_MAX + 1)); |
| 348 | char buf[DATA_SIZE]; |
| 349 | while (read(INotifyFD, buf, DATA_SIZE) > 0) |
| 350 | ; |
| 351 | |
| 352 | // Queue update to the data model |
| 353 | QMetaObject::invokeMethod(this, "Reload"); |
| 354 | return fasio::post_callback::repeat; |
| 355 | }); |
| 356 | |
| 357 | INotifyReactor.run(); |
| 358 | } |
| 359 | |
| 360 | // Returns true on success |
| 361 | static bool OpenFile(fextl::string Filename) { |
nothing calls this directly
no test coverage detected