OpendTect  6.3
i_qfilesystemwatcher.h
Go to the documentation of this file.
1 #pragma once
2 /*+
3  * (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
4  * AUTHOR : Bert
5  * DATE : Oct 2016
6 -*/
7 
8 
9 #ifdef OD_NO_QT
10 
13 
14 #else
15 
16 # include "filemonitor.h"
17 # include <QString>
18 # include <QStringList>
19 # include <QFileSystemWatcher>
20 
21 QT_BEGIN_NAMESPACE
22 
23 class i_QFileSystemWatcher : public QFileSystemWatcher
24 {
25  Q_OBJECT
26  friend class File::Monitor;
27 
28 protected:
29 
31  : fm_(fm)
32 {
33  connect( this, SIGNAL(directoryChanged(const QString&)),
34  this, SLOT(dirChg(const QString&)) );
35  connect( this, SIGNAL(fileChanged(const QString&)),
36  this, SLOT(fileChg(const QString&)) );
37 }
38 
39 public:
40 
42 void deactivate() {}
43 
44 private slots:
45 
46 void dirChg( const QString& qstr )
47 {
48  const BufferString dirnm( qstr );
49  fm_.dirChanged.trigger( dirnm );
50 }
51 
52 void fileChg( const QString& qstr )
53 {
54  const BufferString filenm( qstr );
55  fm_.watch( filenm );
56  fm_.fileChanged.trigger( filenm );
57 }
58 
59 private:
60 
62 
63 };
64 
65 QT_END_NAMESPACE
66 
67 #endif
i_QFileSystemWatcher(File::Monitor &fm)
Definition: i_qfilesystemwatcher.h:30
void fileChg(const QString &qstr)
Definition: i_qfilesystemwatcher.h:52
void watch(const char *)
CNotifier< Monitor, BufferString > fileChanged
Definition: filemonitor.h:37
~i_QFileSystemWatcher()
Definition: i_qfilesystemwatcher.h:41
Monitors files and directories for changes.
Definition: filemonitor.h:25
Definition: i_qfilesystemwatcher.h:23
CNotifier< Monitor, BufferString > dirChanged
Definition: filemonitor.h:36
void dirChg(const QString &qstr)
Definition: i_qfilesystemwatcher.h:46
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
void deactivate()
Definition: i_qfilesystemwatcher.h:42
File::Monitor & fm_
Definition: i_qfilesystemwatcher.h:61

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017