kdirwatch.h
/* This file is part of the KDE libraries
Copyright (C) 1998 Sven Radej <sven@lisa.exp.univie.ac.at>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _KDIRWATCH_H
#define _KDIRWATCH_H
#include <qtimer.h>
#include <qdatetime.h>
#include <qmap.h>
#include <kdelibs_export.h>
#define kdirwatch KDirWatch::self()
class KDirWatchPrivate;
class KIO_EXPORT KDirWatch : public QObject
{
Q_OBJECT
public:
KDirWatch (QObject* parent = 0, const char* name = 0);
~KDirWatch();
void addDir(const QString& path,
bool watchFiles = false, bool recursive = false);
void addFile(const QString& file);
QDateTime ctime(const QString& path);
void removeDir(const QString& path);
void removeFile(const QString& file);
bool stopDirScan(const QString& path);
bool restartDirScan(const QString& path);
void startScan( bool notify=false, bool skippedToo=false );
void stopScan();
bool isStopped() { return _isStopped; }
bool contains( const QString& path ) const;
static void statistics();
void setCreated( const QString &path );
void setDirty( const QString &path );
void setDeleted( const QString &path );
enum Method { FAM, DNotify, Stat, INotify };
Method internalMethod();
static KDirWatch* self();
static bool exists();
signals:
void dirty (const QString &path);
void created (const QString &path );
void deleted (const QString &path );
private:
bool _isStopped;
KDirWatchPrivate *d;
static KDirWatch* s_pSelf;
};
#endif
// vim: sw=3 et
KDirWatch
Watch directories and files for changes.
Definition: kdirwatch.h:63
KDirWatch::isStopped
bool isStopped()
Is scanning stopped? After creation of a KDirWatch instance, this is false.
Definition: kdirwatch.h:190

KDE Home | KDE Accessibility Home | Description of Access Keys