Solid

fstabwatcher.h
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#ifdef Q_OS_LINUX
12#include <libmount.h>
13#endif
14
16class QFile;
17class QSocketNotifier;
18
19namespace Solid
20{
21namespace Backends
22{
23namespace Fstab
24{
25class FstabWatcher : public QObject
26{
28public:
29 FstabWatcher();
30 ~FstabWatcher() override;
31
32 static FstabWatcher *instance();
33
35 void mtabChanged();
36 void fstabChanged();
37
38private Q_SLOTS:
39#ifdef Q_OS_LINUX
40 void onMountChanged();
41#else
42 void onFileChanged(const QString &path);
43#endif
44
45 void onQuit();
46
47private:
48 QSocketNotifier *m_socketNotifier;
49#ifdef Q_OS_LINUX
50 libmnt_monitor *m_mountMonitor;
51#else
52 bool m_isRoutineInstalled;
53 QFileSystemWatcher *m_fileSystemWatcher;
54 QFile *m_mtabFile;
55 bool m_isFstabWatched;
56#endif
57};
58}
59}
60}
61#endif // SOLID_BACKENDS_FSTAB_WATCHER_H
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:23 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.