From kde-commits Fri Feb 13 21:33:40 2009 From: Allen Winter Date: Fri, 13 Feb 2009 21:33:40 +0000 To: kde-commits Subject: branches/KDE/4.2/kdelibs/kio/kio Message-Id: <1234560820.197600.10562.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=123456083213935 SVN commit 925692 by winterz: backport SVN commit 925654 by tilladam: When using the QFileSystemWatcher backend of KDirWatch, trust it to correctly notify us when a file or diretory changes, instead of second guessing it based on mtime. Adding a file to a directory does not always update the directory mtime, for example, which makes this check fail in some situations. M +8 -1 kdirwatch.cpp --- branches/KDE/4.2/kdelibs/kio/kio/kdirwatch.cpp #925691:925692 @@ -1081,7 +1081,14 @@ #endif if ( (e->m_ctime != invalid_ctime) && ((stat_buf.st_ctime != e->m_ctime) || - (stat_buf.st_nlink != (nlink_t) e->m_nlink)) ) { + (stat_buf.st_nlink != (nlink_t) e->m_nlink)) +#if defined( HAVE_QFILESYSTEMWATCHER ) + // we trust QFSW to get it right, the ctime comparisons above + // fail for example when adding files to directories on Windows + // which doesn't change the mtime of the directory + ||(e->m_mode == QFSWatchMode ) +#endif + ) { e->m_ctime = stat_buf.st_ctime; e->m_nlink = stat_buf.st_nlink; return Changed;