13,11 → 13,10 |
|
FileWatcher::FileWatcher( QWidget* parent) : QObject(parent) |
{ |
m_timeOut=10000; |
watchedFiles.clear(); |
watchTimer = new QTimer(this); |
connect(watchTimer, SIGNAL(timeout()), this, SLOT(checkFiles())); |
watchTimer->start(m_timeOut, true); |
watchTimer->start(10000, true); |
blockAddRemove = false; |
} |
|
29,16 → 28,6 |
delete watchTimer; |
} |
|
void FileWatcher::setTimeOut(const int newTimeOut) |
{ |
m_timeOut=newTimeOut; |
} |
|
const int FileWatcher::timeOut() |
{ |
return m_timeOut; |
} |
|
void FileWatcher::addFile(QString fileName) |
{ |
watchTimer->stop(); |
49,7 → 38,7 |
fi.timeInfo = fi.info.lastModified(); |
watchedFiles.insert(fileName, fi); |
} |
watchTimer->start(m_timeOut, true); |
watchTimer->start(10000, true); |
} |
|
void FileWatcher::removeFile(QString fileName) |
56,7 → 45,7 |
{ |
watchTimer->stop(); |
watchedFiles.remove(fileName); |
watchTimer->start(m_timeOut, true); |
watchTimer->start(10000, true); |
} |
|
void FileWatcher::addDir(QString fileName) |
72,7 → 61,7 |
void FileWatcher::start() |
{ |
watchTimer->stop(); |
watchTimer->start(m_timeOut, true); |
watchTimer->start(10000, true); |
} |
|
void FileWatcher::stop() |
145,6 → 134,6 |
} |
} |
blockAddRemove = false; |
watchTimer->start(m_timeOut, true); |
watchTimer->start(10000, true); |
} |
|