Changeset View
Changeset View
Standalone View
Standalone View
src/file/pendingfilequeue.cpp
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 65 | if (file.shouldRemoveIndex() && file.path().endsWith('/')) { | |||
---|---|---|---|---|---|
71 | const auto droppedFilesBegin = std::partition(m_cache.begin(), end, keepFile); | 71 | const auto droppedFilesBegin = std::partition(m_cache.begin(), end, keepFile); | ||
72 | for (auto it = droppedFilesBegin; it != end; it++) { | 72 | for (auto it = droppedFilesBegin; it != end; it++) { | ||
73 | m_pendingFiles.remove(it->path()); | 73 | m_pendingFiles.remove(it->path()); | ||
74 | m_recentlyEmitted.remove(it->path()); | 74 | m_recentlyEmitted.remove(it->path()); | ||
75 | } | 75 | } | ||
76 | m_cache.erase(droppedFilesBegin, end); | 76 | m_cache.erase(droppedFilesBegin, end); | ||
77 | } | 77 | } | ||
78 | 78 | | |||
79 | if (file.shouldRemoveIndex()) { | ||||
80 | m_cache.removeOne(file); | ||||
81 | m_pendingFiles.remove(file.path()); | ||||
82 | Q_EMIT removeFileIndex(file.path()); | ||||
83 | return; | ||||
84 | } | ||||
85 | | ||||
79 | int i = m_cache.indexOf(file); | 86 | int i = m_cache.indexOf(file); | ||
80 | if (i == -1) { | 87 | if (i == -1) { | ||
81 | m_cache << file; | 88 | m_cache << file; | ||
82 | } else { | 89 | } else { | ||
83 | m_cache[i].merge(file); | 90 | m_cache[i].merge(file); | ||
84 | } | 91 | } | ||
85 | 92 | | |||
86 | m_cacheTimer.start(); | 93 | m_cacheTimer.start(); | ||
87 | } | 94 | } | ||
88 | 95 | | |||
89 | void PendingFileQueue::processCache(const QTime& currentTime) | 96 | void PendingFileQueue::processCache(const QTime& currentTime) | ||
90 | { | 97 | { | ||
91 | for (const PendingFile& file : qAsConst(m_cache)) { | 98 | for (const PendingFile& file : qAsConst(m_cache)) { | ||
92 | if (file.shouldRemoveIndex()) { | 99 | if (file.shouldIndexXAttrOnly()) { | ||
93 | Q_EMIT removeFileIndex(file.path()); | | |||
94 | | ||||
95 | m_recentlyEmitted.remove(file.path()); | | |||
96 | m_pendingFiles.remove(file.path()); | | |||
97 | } | | |||
98 | else if (file.shouldIndexXAttrOnly()) { | | |||
99 | Q_EMIT indexXAttr(file.path()); | 100 | Q_EMIT indexXAttr(file.path()); | ||
100 | } | 101 | } | ||
101 | else if (file.shouldIndexContents()) { | 102 | else if (file.shouldIndexContents()) { | ||
102 | if (m_pendingFiles.contains(file.path())) { | 103 | if (m_pendingFiles.contains(file.path())) { | ||
103 | QTime time = m_pendingFiles[file.path()]; | 104 | QTime time = m_pendingFiles[file.path()]; | ||
104 | 105 | | |||
105 | int msecondsLeft = currentTime.msecsTo(time); | 106 | int msecondsLeft = currentTime.msecsTo(time); | ||
106 | msecondsLeft = qBound(m_minTimeout, msecondsLeft * 2, m_maxTimeout); | 107 | msecondsLeft = qBound(m_minTimeout, msecondsLeft * 2, m_maxTimeout); | ||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |