mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Moved the scan time to populated and get it from settings
This commit is contained in:
parent
1d4c6061a8
commit
9349ae8606
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user