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

KDECore

  • sources
  • kde-4.12
  • kdelibs
  • 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 
27 class KDirWatchPrivate;
28 
64 class 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 
250 public 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 
305 Q_DECLARE_OPERATORS_FOR_FLAGS(KDirWatch::WatchModes)
306 
307 #endif
308 
309 // vim: sw=3 et
kdecore_export.h
KAuth::HelperSupport::isStopped
bool isStopped()
Check if the caller asked the helper to stop the execution.
Definition: kauthhelpersupport.cpp:132
KDirWatch::Method
Method
Definition: kdirwatch.h:223
QString
QObject
QDateTime
KDirWatchPrivate
Definition: kdirwatch_p.h:116
KDirWatch::WatchMode
WatchMode
Available watch modes for directory monitoring.
Definition: kdirwatch.h:73
KDirWatch::Stat
Definition: kdirwatch.h:223
KDirWatch
Class for watching directory and file changes.
Definition: kdirwatch.h:64
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:08 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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