Changeset View
Changeset View
Standalone View
Standalone View
src/file/fileindexscheduler.cpp
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | |||||
167 | void FileIndexScheduler::powerManagementStatusChanged(bool isOnBattery) | 167 | void FileIndexScheduler::powerManagementStatusChanged(bool isOnBattery) | ||
168 | { | 168 | { | ||
169 | qDebug() << "Power state changed"; | 169 | qDebug() << "Power state changed"; | ||
170 | if (isOnBattery && m_indexerState == ContentIndexing) { | 170 | if (isOnBattery && m_indexerState == ContentIndexing) { | ||
171 | qDebug() << "On battery stopping content indexer"; | 171 | qDebug() << "On battery stopping content indexer"; | ||
172 | m_contentIndexer->quit(); | 172 | m_contentIndexer->quit(); | ||
173 | //TODO: Maybe we can add a special state for suspended due to being on battery. | 173 | //TODO: Maybe we can add a special state for suspended due to being on battery. | ||
174 | m_indexerState = Idle; | 174 | m_indexerState = Idle; | ||
175 | stateChanged(m_indexerState); | 175 | Q_EMIT stateChanged(m_indexerState); | ||
176 | } else if (!isOnBattery) { | 176 | } else if (!isOnBattery) { | ||
177 | scheduleIndexing(); | 177 | scheduleIndexing(); | ||
178 | } | 178 | } | ||
179 | } | 179 | } | ||
180 | 180 | | |||
181 | void FileIndexScheduler::setSuspend(bool suspend) | 181 | void FileIndexScheduler::setSuspend(bool suspend) | ||
182 | { | 182 | { | ||
183 | if (suspend) { | 183 | if (suspend) { | ||
Show All 32 Lines |