Changeset View
Changeset View
Standalone View
Standalone View
src/kitemviews/private/kdirectorycontentscounter.cpp
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 88 | { | |||
---|---|---|---|---|---|
89 | if (!m_dirWatcher->contains(path)) { | 89 | if (!m_dirWatcher->contains(path)) { | ||
90 | m_dirWatcher->addDir(path); | 90 | m_dirWatcher->addDir(path); | ||
91 | m_watchedDirs.insert(path); | 91 | m_watchedDirs.insert(path); | ||
92 | } | 92 | } | ||
93 | 93 | | |||
94 | KDirectoryContentsCounterWorker::Options options; | 94 | KDirectoryContentsCounterWorker::Options options; | ||
95 | 95 | | |||
96 | if (m_model->showHiddenFiles()) { | 96 | if (m_model->showHiddenFiles()) { | ||
97 | options |= KDirectoryContentsCounterWorker::CountHiddenFiles; | 97 | options |= KDirectoryContentsCounterWorker::Option::CountHiddenFiles; | ||
98 | } | 98 | } | ||
99 | 99 | | |||
100 | if (m_model->showDirectoriesOnly()) { | 100 | if (m_model->showDirectoriesOnly()) { | ||
101 | options |= KDirectoryContentsCounterWorker::CountDirectoriesOnly; | 101 | options |= KDirectoryContentsCounterWorker::Option::CountDirectoriesOnly; | ||
102 | } | 102 | } | ||
103 | 103 | | |||
104 | return KDirectoryContentsCounterWorker::subItemsCount(path, options); | 104 | return KDirectoryContentsCounterWorker::subItemsCount(path, options); | ||
105 | } | 105 | } | ||
106 | 106 | | |||
107 | void KDirectoryContentsCounter::slotResult(const QString& path, int count) | 107 | void KDirectoryContentsCounter::slotResult(const QString& path, int count) | ||
108 | { | 108 | { | ||
109 | m_workerIsBusy = false; | 109 | m_workerIsBusy = false; | ||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
163 | void KDirectoryContentsCounter::startWorker(const QString& path) | 163 | void KDirectoryContentsCounter::startWorker(const QString& path) | ||
164 | { | 164 | { | ||
165 | if (m_workerIsBusy) { | 165 | if (m_workerIsBusy) { | ||
166 | m_queue.enqueue(path); | 166 | m_queue.enqueue(path); | ||
167 | } else { | 167 | } else { | ||
168 | KDirectoryContentsCounterWorker::Options options; | 168 | KDirectoryContentsCounterWorker::Options options; | ||
169 | 169 | | |||
170 | if (m_model->showHiddenFiles()) { | 170 | if (m_model->showHiddenFiles()) { | ||
171 | options |= KDirectoryContentsCounterWorker::CountHiddenFiles; | 171 | options |= KDirectoryContentsCounterWorker::Option::CountHiddenFiles; | ||
172 | } | 172 | } | ||
173 | 173 | | |||
174 | if (m_model->showDirectoriesOnly()) { | 174 | if (m_model->showDirectoriesOnly()) { | ||
175 | options |= KDirectoryContentsCounterWorker::CountDirectoriesOnly; | 175 | options |= KDirectoryContentsCounterWorker::Option::CountDirectoriesOnly; | ||
176 | } | 176 | } | ||
177 | 177 | | |||
178 | emit requestDirectoryContentsCount(path, options); | 178 | emit requestDirectoryContentsCount(path, options); | ||
179 | m_workerIsBusy = true; | 179 | m_workerIsBusy = true; | ||
180 | } | 180 | } | ||
181 | } | 181 | } | ||
182 | 182 | | |||
183 | QThread* KDirectoryContentsCounter::m_workerThread = nullptr; | 183 | QThread* KDirectoryContentsCounter::m_workerThread = nullptr; | ||
184 | int KDirectoryContentsCounter::m_workersCount = 0; | 184 | int KDirectoryContentsCounter::m_workersCount = 0; |