diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-01-05 01:00:21 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-01-05 01:00:21 +0000 |
| commit | 22a1f899925b9bf0632563caf7da95fcba021ceb (patch) | |
| tree | e16ac8136561114d526e96e21ba7098dc61b0927 | |
| parent | 513ac2cefb0ca8ebe6762cc1313ea9be813c646f (diff) | |
Small and somewhat untested optimisation.
| -rw-r--r-- | src/lib/image_content.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index 191359ff3..5262064af 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -105,11 +105,15 @@ ImageContent::examine (shared_ptr<Job> job) { if (_path_to_scan) { job->sub (_("Scanning image files")); + int n = 0; for (boost::filesystem::directory_iterator i(*_path_to_scan); i != boost::filesystem::directory_iterator(); ++i) { if (boost::filesystem::is_regular_file (i->path()) && valid_image_file (i->path())) { _paths.push_back (i->path ()); } - job->set_progress_unknown (); + ++n; + if ((n % 1000) == 0) { + job->set_progress_unknown (); + } } if (_paths.empty()) { |
