mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-27 06:45:49 +03:00
SyncEngine: Save a bit of memory by not keeping a set of all filename
This is only used for conflict files, so only save conflict files. (The _seenFile was used for other things in 2.5, but not anymore)
This commit is contained in:
parent
83d743b66b
commit
115a53134c
2 changed files with 8 additions and 12 deletions
|
@ -285,9 +285,8 @@ void SyncEngine::conflictRecordMaintenance()
|
|||
//
|
||||
// This happens when the conflicts table is new or when conflict files
|
||||
// are downlaoded but the server doesn't send conflict headers.
|
||||
for (const auto &path : qAsConst(_seenFiles)) {
|
||||
if (!Utility::isConflictFile(path))
|
||||
continue;
|
||||
for (const auto &path : qAsConst(_seenConflictFiles)) {
|
||||
ASSERT(Utility::isConflictFile(path));
|
||||
|
||||
auto bapath = path.toUtf8();
|
||||
if (!conflictRecordPaths.contains(bapath)) {
|
||||
|
@ -310,11 +309,8 @@ void SyncEngine::conflictRecordMaintenance()
|
|||
|
||||
void OCC::SyncEngine::slotItemDiscovered(const OCC::SyncFileItemPtr &item)
|
||||
{
|
||||
_seenFiles.insert(item->_file);
|
||||
if (!item->_renameTarget.isEmpty()) {
|
||||
// Yes, this records both the rename renameTarget and the original so we keep both in case of a rename
|
||||
_seenFiles.insert(item->_renameTarget);
|
||||
}
|
||||
if (Utility::isConflictFile(item->_file))
|
||||
_seenConflictFiles.insert(item->_file);
|
||||
if (item->_instruction == CSYNC_INSTRUCTION_UPDATE_METADATA && !item->isDirectory()) {
|
||||
// For directories, metadata-only updates will be done after all their files are propagated.
|
||||
|
||||
|
@ -441,7 +437,7 @@ void SyncEngine::startSync()
|
|||
|
||||
_hasNoneFiles = false;
|
||||
_hasRemoveFile = false;
|
||||
_seenFiles.clear();
|
||||
_seenConflictFiles.clear();
|
||||
|
||||
_progressInfo->reset();
|
||||
|
||||
|
@ -881,7 +877,7 @@ void SyncEngine::finalize(bool success)
|
|||
|
||||
// Delete the propagator only after emitting the signal.
|
||||
_propagator.clear();
|
||||
_seenFiles.clear();
|
||||
_seenConflictFiles.clear();
|
||||
_uniqueErrors.clear();
|
||||
_localDiscoveryPaths.clear();
|
||||
_localDiscoveryStyle = LocalDiscoveryStyle::FilesystemOnly;
|
||||
|
|
|
@ -240,8 +240,8 @@ private:
|
|||
QScopedPointer<DiscoveryPhase> _discoveryPhase;
|
||||
QSharedPointer<OwncloudPropagator> _propagator;
|
||||
|
||||
// List of all files we seen
|
||||
QSet<QString> _seenFiles;
|
||||
// List of all files with conflicts
|
||||
QSet<QString> _seenConflictFiles;
|
||||
|
||||
QScopedPointer<ProgressInfo> _progressInfo;
|
||||
|
||||
|
|
Loading…
Reference in a new issue