Skip to content

Commit

Permalink
Moved the scan time to populated and get it from settings
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Sep 12, 2017
1 parent 1d4c606 commit 9349ae8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsdataitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,6 @@ QVector<QgsDataItem *> QgsDirectoryItem::createChildren()
}

}
mLastScan = QDateTime::currentDateTime();
return children;
}

Expand All @@ -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 )
{
Expand All @@ -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;
}
Expand Down

0 comments on commit 9349ae8

Please sign in to comment.