From 9349ae86069d1e615afa013672d7d0d71e8126af Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Sun, 10 Sep 2017 10:54:00 +0200 Subject: [PATCH] Moved the scan time to populated and get it from settings --- src/core/qgsdataitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/qgsdataitem.cpp b/src/core/qgsdataitem.cpp index 9dbba3599e6..1e92bc7498b 100644 --- a/src/core/qgsdataitem.cpp +++ b/src/core/qgsdataitem.cpp @@ -765,7 +765,6 @@ QVector QgsDirectoryItem::createChildren() } } - mLastScan = QDateTime::currentDateTime(); return children; } @@ -781,6 +780,7 @@ void QgsDirectoryItem::setState( State state ) mFileSystemWatcher->addPath( mDirPath ); connect( mFileSystemWatcher, &QFileSystemWatcher::directoryChanged, this, &QgsDirectoryItem::directoryChanged ); } + mLastScan = QDateTime::currentDateTime(); } else if ( state == NotPopulated ) { @@ -795,7 +795,7 @@ void QgsDirectoryItem::setState( State state ) void QgsDirectoryItem::directoryChanged() { // If the last scan was less than 10 seconds ago, skip this - if ( mLastScan.msecsTo( QDateTime::currentDateTime() ) < 10000 ) + if ( mLastScan.msecsTo( QDateTime::currentDateTime() ) < QgsSettings().value( QStringLiteral( "browser/minscaninterval" ), 10000 ).toInt() ) { return; }