Changeset View
Changeset View
Standalone View
Standalone View
src/file/indexerstate.h
Show All 24 Lines | |||||
25 | #include <QString> | 25 | #include <QString> | ||
26 | #include <KLocalizedString> | 26 | #include <KLocalizedString> | ||
27 | 27 | | |||
28 | namespace Baloo { | 28 | namespace Baloo { | ||
29 | enum IndexerState { | 29 | enum IndexerState { | ||
30 | Idle, | 30 | Idle, | ||
31 | Suspended, | 31 | Suspended, | ||
32 | FirstRun, | 32 | FirstRun, | ||
33 | UnindexedFileCheck, | ||||
33 | NewFiles, | 34 | NewFiles, | ||
34 | ModifiedFiles, | 35 | ModifiedFiles, | ||
35 | XAttrFiles, | 36 | XAttrFiles, | ||
36 | ContentIndexing, | 37 | ContentIndexing | ||
37 | UnindexedFileCheck | | |||
38 | }; | 38 | }; | ||
39 | 39 | | |||
40 | inline QString stateString(IndexerState state) | 40 | inline QString stateString(IndexerState state) | ||
41 | { | 41 | { | ||
42 | QString status = i18n("Unknown"); | 42 | QString status = i18n("Unknown"); | ||
43 | switch (state) { | 43 | switch (state) { | ||
44 | case Idle: | 44 | case Idle: | ||
45 | status = i18n("Idle"); | 45 | status = i18n("Idle"); | ||
46 | break; | 46 | break; | ||
47 | case Suspended: | 47 | case Suspended: | ||
48 | status = i18n("Suspended"); | 48 | status = i18n("Suspended"); | ||
49 | break; | 49 | break; | ||
50 | case FirstRun: | 50 | case FirstRun: | ||
51 | status = i18n("Initial Indexing"); | 51 | status = i18n("Initial Indexing"); | ||
52 | break; | 52 | break; | ||
53 | case UnindexedFileCheck: | ||||
54 | status = i18n("Checking for unindexed files"); | ||||
55 | break; | ||||
53 | case NewFiles: | 56 | case NewFiles: | ||
54 | status = i18n("Indexing new files"); | 57 | status = i18n("Indexing new files"); | ||
55 | break; | 58 | break; | ||
56 | case ModifiedFiles: | 59 | case ModifiedFiles: | ||
57 | status = i18n("Indexing modified files"); | 60 | status = i18n("Indexing modified files"); | ||
58 | break; | 61 | break; | ||
59 | case XAttrFiles: | 62 | case XAttrFiles: | ||
60 | status = i18n("Indexing Extended Attributes"); | 63 | status = i18n("Indexing Extended Attributes"); | ||
61 | break; | 64 | break; | ||
62 | case ContentIndexing: | 65 | case ContentIndexing: | ||
63 | status = i18n("Indexing file content"); | 66 | status = i18n("Indexing file content"); | ||
64 | break; | | |||
65 | case UnindexedFileCheck: | | |||
66 | status = i18n("Checking for unindexed files"); | | |||
67 | } | 67 | } | ||
68 | return status; | 68 | return status; | ||
69 | } | 69 | } | ||
70 | 70 | | |||
71 | //TODO: check for implicit conversion | 71 | //TODO: check for implicit conversion | ||
72 | inline QString stateString(int state) | 72 | inline QString stateString(int state) | ||
73 | { | 73 | { | ||
74 | return stateString(static_cast<IndexerState>(state)); | 74 | return stateString(static_cast<IndexerState>(state)); | ||
75 | } | 75 | } | ||
76 | 76 | | |||
77 | } | 77 | } | ||
78 | #endif //BALOO_INDEXER_STATE_H | 78 | #endif //BALOO_INDEXER_STATE_H |