Skip to content
Permalink
Browse files

Moved the scan time to populated and get it from settings

  • Loading branch information
elpaso committed Sep 10, 2017
1 parent 1d4c606 commit 9349ae86069d1e615afa013672d7d0d71e8126af
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/qgsdataitem.cpp
@@ -765,7 +765,6 @@ QVector<QgsDataItem *> 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;
}

0 comments on commit 9349ae8

Please sign in to comment.
You can’t perform that action at this time.