1 /* 2 SPDX-FileCopyrightText: 2010 Mario Bensi <mbensi@ipsquad.net> 3 4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 5 */ 6 7 #ifndef SOLID_BACKENDS_FSTAB_WATCHER_H 8 #define SOLID_BACKENDS_FSTAB_WATCHER_H 9 10 #include <QObject> 11 12 class QFileSystemWatcher; 13 class QFile; 14 class QSocketNotifier; 15 16 namespace Solid 17 { 18 namespace Backends 19 { 20 namespace Fstab 21 { 22 class FstabWatcher : public QObject 23 { 24 Q_OBJECT 25 public: 26 FstabWatcher(); 27 ~FstabWatcher() override; 28 29 static FstabWatcher *instance(); 30 31 Q_SIGNALS: 32 void mtabChanged(); 33 void fstabChanged(); 34 35 private Q_SLOTS: 36 void onFileChanged(const QString &path); 37 void orphanFileSystemWatcher(); 38 39 private: 40 bool m_isRoutineInstalled; 41 QFileSystemWatcher *m_fileSystemWatcher; 42 QSocketNotifier *m_mtabSocketNotifier; 43 QFile *m_mtabFile; 44 bool m_isFstabWatched; 45 }; 46 } 47 } 48 } 49 #endif // SOLID_BACKENDS_FSTAB_WATCHER_H 50