• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • io
kdirwatch.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 1998 Sven Radej <sven@lisa.exp.univie.ac.at>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18#ifndef _KDIRWATCH_H
19#define _KDIRWATCH_H
20
21#include <QtCore/QDateTime>
22#include <QtCore/QObject>
23#include <QtCore/QString>
24
25#include <kdecore_export.h>
26
27class KDirWatchPrivate;
28
64class KDECORE_EXPORT KDirWatch : public QObject
65{
66 Q_OBJECT
67
68 public:
69
73 enum WatchMode {
74 WatchDirOnly = 0,
75 WatchFiles = 0x01,
76 WatchSubDirs = 0x02
77 };
78 Q_DECLARE_FLAGS(WatchModes, WatchMode)
79
80
87 KDirWatch(QObject* parent = 0);
88
94 ~KDirWatch();
95
115 void addDir(const QString& path, WatchModes watchModes = WatchDirOnly);
116
122 void addFile(const QString& file);
123
129 QDateTime ctime(const QString& path) const;
130
137 void removeDir(const QString& path);
138
145 void removeFile(const QString& file);
146
159 bool stopDirScan(const QString& path);
160
174 bool restartDirScan(const QString& path);
175
192 void startScan( bool notify=false, bool skippedToo=false );
193
199 void stopScan();
200
206 bool isStopped();
207
213 bool contains( const QString& path ) const;
214
215 void deleteQFSWatcher();
216
221 static void statistics(); // TODO implement a QDebug operator for KDirWatch instead.
222
223 enum Method { FAM, INotify, DNotify /*now unused*/, Stat, QFSWatch };
228 Method internalMethod(); // TODO KDE5: make const
229
242 static KDirWatch* self();
248 static bool exists();
249
250public Q_SLOTS:
251
256 void setCreated( const QString &path );
257
262 void setDirty( const QString &path );
263
268 void setDeleted( const QString &path );
269
270 Q_SIGNALS:
271
285 void dirty(const QString &path);
286
291 void created(const QString &path);
292
299 void deleted(const QString &path);
300
301 private:
302 KDirWatchPrivate *const d;
303};
304
305Q_DECLARE_OPERATORS_FOR_FLAGS(KDirWatch::WatchModes)
306
307#endif
308
309// vim: sw=3 et
KDirWatchPrivate
Definition: kdirwatch_p.h:117
KDirWatch
Class for watching directory and file changes.
Definition: kdirwatch.h:65
KDirWatch::Method
Method
Definition: kdirwatch.h:223
KDirWatch::deleted
void deleted(const QString &path)
Emitted when a file or directory is deleted.
KDirWatch::WatchMode
WatchMode
Available watch modes for directory monitoring.
Definition: kdirwatch.h:73
KDirWatch::dirty
void dirty(const QString &path)
Emitted when a watched object is changed.
KDirWatch::created
void created(const QString &path)
Emitted when a file or directory is created.
QDateTime
QObject
QString
kdecore_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal