Changeset View
Changeset View
Standalone View
Standalone View
src/file/timeestimator.h
Show All 34 Lines | |||||
35 | * 5 most recent batches. The more recent the batch is, higher the weight | 35 | * 5 most recent batches. The more recent the batch is, higher the weight | ||
36 | * it will be assigned. | 36 | * it will be assigned. | ||
37 | */ | 37 | */ | ||
38 | 38 | | |||
39 | class TimeEstimator : public QObject | 39 | class TimeEstimator : public QObject | ||
40 | { | 40 | { | ||
41 | Q_OBJECT | 41 | Q_OBJECT | ||
42 | public: | 42 | public: | ||
43 | explicit TimeEstimator(FileIndexerConfig* config, QObject* parent = nullptr); | 43 | explicit TimeEstimator(QObject* parent = nullptr); | ||
44 | uint calculateTimeLeft(int filesLeft); | 44 | uint calculateTimeLeft(int filesLeft); | ||
45 | 45 | | |||
46 | public Q_SLOTS: | 46 | public Q_SLOTS: | ||
47 | void handleNewBatchTime(uint time); | 47 | void handleNewBatchTime(uint time, uint batchSize); | ||
48 | 48 | | |||
49 | private: | 49 | private: | ||
50 | uint m_batchTimeBuffer[BUFFER_SIZE]; | 50 | float m_batchTimeBuffer[BUFFER_SIZE]; | ||
51 | 51 | | |||
52 | int m_bufferIndex; | 52 | int m_bufferIndex; | ||
53 | bool m_estimateReady; | 53 | bool m_estimateReady; | ||
54 | | ||||
55 | FileIndexerConfig* m_config; | | |||
56 | uint m_batchSize; | | |||
57 | }; | 54 | }; | ||
58 | 55 | | |||
59 | } | 56 | } | ||
60 | 57 | | |||
61 | #endif //BALOO_TIMEESTIMATOR_H | 58 | #endif //BALOO_TIMEESTIMATOR_H |