Linux folderwatcher: Get full path of changed file. #2297

This commit is contained in:
Christian Kamm 2014-11-07 10:14:09 +01:00
parent d04eedeb8d
commit 1ada20ac7b

View file

@ -166,16 +166,16 @@ void FolderWatcherPrivate::slotReceivedNotification(int fd)
continue; continue;
} }
// fire event // Fire event for the path that was changed.
// Note: The name of the changed file and stuff could be taken from
// the event data structure. That does not happen yet.
if (event->len > 0 && event->wd > -1) { if (event->len > 0 && event->wd > -1) {
QByteArray fileName(event->name);
// qDebug() << Q_FUNC_INFO << event->name; // qDebug() << Q_FUNC_INFO << event->name;
if (QByteArray(event->name).startsWith(".csync") || if (fileName.startsWith(".csync_journal.db") ||
QByteArray(event->name).startsWith(".owncloudsync.log")) { fileName.startsWith(".owncloudsync.log")) {
// qDebug() << "ignore journal"; // qDebug() << "ignore journal";
} else { } else {
const QString p = _watches[event->wd]; const QString p = _watches[event->wd] + '/' + fileName;
//qDebug() << "found a change in " << p;
_parent->changeDetected(p); _parent->changeDetected(p);
} }
} }