Changeset View
Changeset View
Standalone View
Standalone View
src/file/fileindexscheduler.h
Show All 23 Lines | |||||
24 | #include <QStringList> | 24 | #include <QStringList> | ||
25 | #include <QThreadPool> | 25 | #include <QThreadPool> | ||
26 | #include <QTimer> | 26 | #include <QTimer> | ||
27 | 27 | | |||
28 | #include "filecontentindexerprovider.h" | 28 | #include "filecontentindexerprovider.h" | ||
29 | #include "powerstatemonitor.h" | 29 | #include "powerstatemonitor.h" | ||
30 | #include "indexerstate.h" | 30 | #include "indexerstate.h" | ||
31 | #include "timeestimator.h" | 31 | #include "timeestimator.h" | ||
32 | #include "storagedevices.h" | ||||
32 | 33 | | |||
33 | namespace Baloo { | 34 | namespace Baloo { | ||
34 | 35 | | |||
35 | class Database; | 36 | class Database; | ||
36 | class FileIndexerConfig; | 37 | class FileIndexerConfig; | ||
37 | class FileContentIndexer; | 38 | class FileContentIndexer; | ||
38 | 39 | | |||
39 | class FileIndexScheduler : public QObject | 40 | class FileIndexScheduler : public QObject | ||
Show All 35 Lines | 54 | public Q_SLOTS: | |||
75 | void handleFileRemoved(const QString& file); | 76 | void handleFileRemoved(const QString& file); | ||
76 | 77 | | |||
77 | void scheduleIndexing(); | 78 | void scheduleIndexing(); | ||
78 | 79 | | |||
79 | Q_SCRIPTABLE void suspend() { setSuspend(true); } | 80 | Q_SCRIPTABLE void suspend() { setSuspend(true); } | ||
80 | Q_SCRIPTABLE void resume() { setSuspend(false); } | 81 | Q_SCRIPTABLE void resume() { setSuspend(false); } | ||
81 | Q_SCRIPTABLE uint getRemainingTime(); | 82 | Q_SCRIPTABLE uint getRemainingTime(); | ||
82 | Q_SCRIPTABLE void checkUnindexedFiles(); | 83 | Q_SCRIPTABLE void checkUnindexedFiles(); | ||
84 | Q_SCRIPTABLE void purgeDeindexableFiles(); | ||||
michaelh: Nitpick: We're removing db entries not files. Also every file is deindexable. Maybe… | |||||
This is doing the opposite of indexing new files, which is removing unfound files from the index. I think deindex is an appropriate term for this. smithjd: This is doing the opposite of indexing new files, which is removing unfound files from the… | |||||
83 | Q_SCRIPTABLE uint getBatchSize(); | 85 | Q_SCRIPTABLE uint getBatchSize(); | ||
84 | 86 | | |||
85 | private Q_SLOTS: | 87 | private Q_SLOTS: | ||
86 | void powerManagementStatusChanged(bool isOnBattery); | 88 | void powerManagementStatusChanged(bool isOnBattery); | ||
87 | 89 | | |||
88 | private: | 90 | private: | ||
89 | void setSuspend(bool suspend); | 91 | void setSuspend(bool suspend); | ||
90 | 92 | | |||
91 | Database* m_db; | 93 | Database* m_db; | ||
92 | FileIndexerConfig* m_config; | 94 | FileIndexerConfig* m_config; | ||
95 | StorageDevices* m_devices; | ||||
93 | 96 | | |||
94 | QStringList m_newFiles; | 97 | QStringList m_newFiles; | ||
95 | QStringList m_modifiedFiles; | 98 | QStringList m_modifiedFiles; | ||
96 | QStringList m_xattrFiles; | 99 | QStringList m_xattrFiles; | ||
97 | 100 | | |||
98 | QThreadPool m_threadPool; | 101 | QThreadPool m_threadPool; | ||
99 | 102 | | |||
100 | FileContentIndexerProvider m_provider; | 103 | FileContentIndexerProvider m_provider; | ||
101 | FileContentIndexer* m_contentIndexer; | 104 | FileContentIndexer* m_contentIndexer; | ||
102 | 105 | | |||
103 | PowerStateMonitor m_powerMonitor; | 106 | PowerStateMonitor m_powerMonitor; | ||
104 | 107 | | |||
105 | IndexerState m_indexerState; | 108 | IndexerState m_indexerState; | ||
106 | TimeEstimator m_timeEstimator; | 109 | TimeEstimator m_timeEstimator; | ||
107 | 110 | | |||
108 | bool m_checkUnindexedFiles; | 111 | bool m_checkUnindexedFiles; | ||
112 | bool m_purgeDeindexableFiles; | ||||
michaelh: Same as above | |||||
109 | }; | 113 | }; | ||
110 | 114 | | |||
111 | } | 115 | } | ||
112 | 116 | | |||
113 | #endif // BALOO_FILEINDEXSCHEDULER_H | 117 | #endif // BALOO_FILEINDEXSCHEDULER_H |
Nitpick: We're removing db entries not files. Also every file is deindexable. Maybe 'purgeStaleEntries', 'removeLostEntries' or so would be a better name to describe what's going on.