Qt 4.8
Signals | Public Functions | Public Variables | List of all members
QFileSystemWatcherPrivate Class Reference

#include <qfilesystemwatcher_p.h>

Inheritance diagram for QFileSystemWatcherPrivate:
QObjectPrivate QObjectData

Signals

static QFileSystemWatcherEnginecreateNativeEngine ()
 

Public Functions

void _q_directoryChanged (const QString &path, bool removed)
 
void _q_fileChanged (const QString &path, bool removed)
 
void init ()
 
void initForcedEngine (const QString &)
 
void initPollerEngine ()
 
 QFileSystemWatcherPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Public Variables

QStringList directories
 
QStringList files
 
QFileSystemWatcherEngineforced
 
QFileSystemWatcherEnginenative
 
QFileSystemWatcherEnginepoller
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Detailed Description

Definition at line 98 of file qfilesystemwatcher_p.h.

Constructors and Destructors

◆ QFileSystemWatcherPrivate()

QFileSystemWatcherPrivate::QFileSystemWatcherPrivate ( )

Definition at line 274 of file qfilesystemwatcher.cpp.

275  : native(0), poller(0), forced(0)
276 {
277 }
QFileSystemWatcherEngine * native
QFileSystemWatcherEngine * poller
QFileSystemWatcherEngine * forced

Functions

◆ _q_directoryChanged()

void QFileSystemWatcherPrivate::_q_directoryChanged ( const QString path,
bool  removed 
)

Definition at line 353 of file qfilesystemwatcher.cpp.

Referenced by init(), initForcedEngine(), and initPollerEngine().

354 {
356  if (!directories.contains(path)) {
357  // perhaps the path was removed after a change was detected, but before we delivered the signal
358  return;
359  }
360  if (removed)
361  directories.removeAll(path);
362  emit q->directoryChanged(path);
363 }
The QFileSystemWatcher class provides an interface for monitoring files and directories for modificat...
#define Q_Q(Class)
Definition: qglobal.h:2483
#define emit
Definition: qobjectdefs.h:76
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ _q_fileChanged()

void QFileSystemWatcherPrivate::_q_fileChanged ( const QString path,
bool  removed 
)

Definition at line 341 of file qfilesystemwatcher.cpp.

Referenced by init(), initForcedEngine(), and initPollerEngine().

342 {
344  if (!files.contains(path)) {
345  // the path was removed after a change was detected, but before we delivered the signal
346  return;
347  }
348  if (removed)
349  files.removeAll(path);
350  emit q->fileChanged(path);
351 }
The QFileSystemWatcher class provides an interface for monitoring files and directories for modificat...
#define Q_Q(Class)
Definition: qglobal.h:2483
#define emit
Definition: qobjectdefs.h:76
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ createNativeEngine

QFileSystemWatcherEngine * QFileSystemWatcherPrivate::createNativeEngine ( )
staticprivatesignal

Definition at line 249 of file qfilesystemwatcher.cpp.

Referenced by init().

250 {
251 #if defined(Q_OS_WIN)
253 #elif defined(Q_OS_QNX) && !defined(QT_NO_INOTIFY)
255 #elif defined(Q_OS_LINUX)
257  if(!eng)
259  return eng;
260 #elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
261 # if 0 && defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
264  else
265 # endif
267 #elif defined(Q_OS_SYMBIAN)
268  return new QSymbianFileSystemWatcherEngine;
269 #else
270  return 0;
271 #endif
272 }
static QFSEventsFileSystemWatcherEngine * create()
static QInotifyFileSystemWatcherEngine * create()
static QDnotifyFileSystemWatcherEngine * create()
static QKqueueFileSystemWatcherEngine * create()
static const MacVersion MacintoshVersion
the version of the Macintosh operating system on which the application is run (Mac only)...
Definition: qglobal.h:1646

◆ init()

void QFileSystemWatcherPrivate::init ( )

Definition at line 279 of file qfilesystemwatcher.cpp.

280 {
283  if (native) {
285  SIGNAL(fileChanged(QString,bool)),
286  q,
287  SLOT(_q_fileChanged(QString,bool)));
289  SIGNAL(directoryChanged(QString,bool)),
290  q,
292  }
293 }
The QFileSystemWatcher class provides an interface for monitoring files and directories for modificat...
#define SLOT(a)
Definition: qobjectdefs.h:226
The QString class provides a Unicode character string.
Definition: qstring.h:83
QFileSystemWatcherEngine * native
#define Q_Q(Class)
Definition: qglobal.h:2483
#define SIGNAL(a)
Definition: qobjectdefs.h:227
void _q_fileChanged(const QString &path, bool removed)
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
void _q_directoryChanged(const QString &path, bool removed)
static QFileSystemWatcherEngine * createNativeEngine()

◆ initForcedEngine()

void QFileSystemWatcherPrivate::initForcedEngine ( const QString forceName)

Definition at line 295 of file qfilesystemwatcher.cpp.

296 {
297  if(forced)
298  return;
299 
301 
302 #if defined(Q_OS_LINUX)
303  if(forceName == QLatin1String("inotify")) {
305  } else if(forceName == QLatin1String("dnotify")) {
307  }
308 #else
309  Q_UNUSED(forceName);
310 #endif
311 
312  if(forced) {
314  SIGNAL(fileChanged(QString,bool)),
315  q,
316  SLOT(_q_fileChanged(QString,bool)));
318  SIGNAL(directoryChanged(QString,bool)),
319  q,
321  }
322 }
The QFileSystemWatcher class provides an interface for monitoring files and directories for modificat...
#define SLOT(a)
Definition: qobjectdefs.h:226
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static QInotifyFileSystemWatcherEngine * create()
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_Q(Class)
Definition: qglobal.h:2483
#define SIGNAL(a)
Definition: qobjectdefs.h:227
void _q_fileChanged(const QString &path, bool removed)
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
void _q_directoryChanged(const QString &path, bool removed)
QFileSystemWatcherEngine * forced
static QDnotifyFileSystemWatcherEngine * create()
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ initPollerEngine()

void QFileSystemWatcherPrivate::initPollerEngine ( )

Definition at line 324 of file qfilesystemwatcher.cpp.

325 {
326  if(poller)
327  return;
328 
330  poller = new QPollingFileSystemWatcherEngine; // that was a mouthful
332  SIGNAL(fileChanged(QString,bool)),
333  q,
334  SLOT(_q_fileChanged(QString,bool)));
336  SIGNAL(directoryChanged(QString,bool)),
337  q,
339 }
The QFileSystemWatcher class provides an interface for monitoring files and directories for modificat...
#define SLOT(a)
Definition: qobjectdefs.h:226
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_Q(Class)
Definition: qglobal.h:2483
#define SIGNAL(a)
Definition: qobjectdefs.h:227
void _q_fileChanged(const QString &path, bool removed)
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
void _q_directoryChanged(const QString &path, bool removed)
QFileSystemWatcherEngine * poller

Properties

◆ directories

QStringList QFileSystemWatcherPrivate::directories

Definition at line 111 of file qfilesystemwatcher_p.h.

Referenced by _q_directoryChanged().

◆ files

QStringList QFileSystemWatcherPrivate::files

Definition at line 111 of file qfilesystemwatcher_p.h.

Referenced by _q_fileChanged().

◆ forced

QFileSystemWatcherEngine * QFileSystemWatcherPrivate::forced

Definition at line 110 of file qfilesystemwatcher_p.h.

Referenced by initForcedEngine().

◆ native

QFileSystemWatcherEngine* QFileSystemWatcherPrivate::native

Definition at line 110 of file qfilesystemwatcher_p.h.

Referenced by init().

◆ poller

QFileSystemWatcherEngine * QFileSystemWatcherPrivate::poller

Definition at line 110 of file qfilesystemwatcher_p.h.

Referenced by initPollerEngine().


The documentation for this class was generated from the following files: