diff options
Diffstat (limited to 'freefilesync')
-rw-r--r-- | freefilesync/ffs_no_eraseif.patch | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/freefilesync/ffs_no_eraseif.patch b/freefilesync/ffs_no_eraseif.patch index d20fd81..f4a7b46 100644 --- a/freefilesync/ffs_no_eraseif.patch +++ b/freefilesync/ffs_no_eraseif.patch @@ -11,73 +11,73 @@ diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source //get or create mutex std::weak_ptr<std::mutex>& weakPtr = pathLocks[nativePath]; -diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-0/FreeFileSync/Source/afs/gdrive.cpp 10.19-1/FreeFileSync/Source/afs/gdrive.cpp +diff -x '*.swp' -x '*.git*' -x '*.orig' -x '*.rej' -Naur 10.24-0/FreeFileSync/Source/afs/gdrive.cpp 10.24-1/FreeFileSync/Source/afs/gdrive.cpp --- 10.18-0/FreeFileSync/Source/afs/gdrive.cpp 2019-11-20 16:15:55.828668123 -0500 -+++ 10.19-1/FreeFileSync/Source/afs/gdrive.cpp 2019-12-27 11:17:35.793612360 -0500 -@@ -1788,7 +1788,7 @@ - if (auto it = itemDetails_.find(itemId); it != itemDetails_.end()) - { - GoogleItemDetails detailsNew = it->second; -- std::erase_if(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdOld; }); -+ eraseIf(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdOld; }); - notifyItemUpdate(stateDelta, itemId, detailsNew); - } - else //conflict!!! -@@ -1802,7 +1802,7 @@ - GoogleItemDetails detailsNew = it->second; - detailsNew.itemName = utfTo<std::string>(newName); - -- std::erase_if(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdFrom || id == parentIdTo; }); // -+ eraseIf(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdFrom || id == parentIdTo; }); // - detailsNew.parentIds.push_back(parentIdTo); //not a duplicate - - notifyItemUpdate(stateDelta, itemId, detailsNew); -@@ -1911,7 +1911,7 @@ - return; //=> avoid misleading changeLog_ entries after Google Drive sync!!! - - //update change logs (and clean up obsolete entries) -- std::erase_if(changeLog_, [&](std::weak_ptr<ItemIdDelta>& weakPtr) -+ eraseIf(changeLog_, [&](std::weak_ptr<ItemIdDelta>& weakPtr) - { - if (std::shared_ptr<ItemIdDelta> iid = weakPtr.lock()) ++++ 10.24-1/FreeFileSync/Source/afs/gdrive.cpp 2020-05-18 10:30:32.420537123 -0400 +@@ -1578,7 +1578,7 @@ + if (auto it = itemDetails_.find(itemId); it != itemDetails_.end()) { -@@ -1932,15 +1932,15 @@ - - std::vector<std::string> parentIdsNew = details->parentIds; - std::vector<std::string> parentIdsRemoved = it->second.parentIds; -- std::erase_if(parentIdsNew, [&](const std::string& id) { return std::find(it->second.parentIds.begin(), it->second.parentIds.end(), id) != it->second.parentIds.end(); }); -- std::erase_if(parentIdsRemoved, [&](const std::string& id) { return std::find(details->parentIds.begin(), details->parentIds.end(), id) != details->parentIds.end(); }); -+ eraseIf(parentIdsNew, [&](const std::string& id) { return std::find(it->second.parentIds.begin(), it->second.parentIds.end(), id) != it->second.parentIds.end(); }); -+ eraseIf(parentIdsRemoved, [&](const std::string& id) { return std::find(details->parentIds.begin(), details->parentIds.end(), id) != details->parentIds.end(); }); - - for (const std::string& parentId : parentIdsNew) - folderContents_[parentId].childItems.push_back(it); //new insert => no need for duplicate check - - for (const std::string& parentId : parentIdsRemoved) - if (auto itP = folderContents_.find(parentId); itP != folderContents_.end()) -- std::erase_if(itP->second.childItems, [&](auto itChild) { return itChild == it; }); -+ eraseIf(itP->second.childItems, [&](auto itChild) { return itChild == it; }); - //if all parents are removed, Google Drive will (recursively) delete the item => don't prematurely do this now: wait for change notifications! - - it->second = *details; -@@ -1959,7 +1959,7 @@ - { - for (const std::string& parentId : it->second.parentIds) //1. delete from parent folders - if (auto itP = folderContents_.find(parentId); itP != folderContents_.end()) -- std::erase_if(itP->second.childItems, [&](auto itChild) { return itChild == it; }); -+ eraseIf(itP->second.childItems, [&](auto itChild) { return itChild == it; }); - - itemDetails_.erase(it); + GoogleItemDetails detailsNew = it->second; +- std::erase_if(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdOld; }); ++ eraseIf(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdOld; }); + notifyItemUpdate(stateDelta, itemId, detailsNew); } -@@ -1967,7 +1967,7 @@ - if (auto itP = folderContents_.find(itemId); itP != folderContents_.end()) + else //conflict!!! +@@ -1592,7 +1592,7 @@ + GoogleItemDetails detailsNew = it->second; + detailsNew.itemName = utfTo<std::string>(newName); + +- std::erase_if(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdFrom || id == parentIdTo; }); // ++ eraseIf(detailsNew.parentIds, [&](const std::string& id) { return id == parentIdFrom || id == parentIdTo; }); // + detailsNew.parentIds.push_back(parentIdTo); //not a duplicate + + notifyItemUpdate(stateDelta, itemId, detailsNew); +@@ -1701,7 +1701,7 @@ + return; //=> avoid misleading changeLog_ entries after Google Drive sync!!! + + //update change logs (and clean up obsolete entries) +- std::erase_if(changeLog_, [&](std::weak_ptr<ItemIdDelta>& weakPtr) ++ eraseIf(changeLog_, [&](std::weak_ptr<ItemIdDelta>& weakPtr) { - for (auto itChild : itP->second.childItems) //2. delete as parent from child items (don't wait for change notifications of children) -- std::erase_if(itChild->second.parentIds, [&](const std::string& id) { return id == itemId; }); -+ eraseIf(itChild->second.parentIds, [&](const std::string& id) { return id == itemId; }); - folderContents_.erase(itP); + if (std::shared_ptr<ItemIdDelta> iid = weakPtr.lock()) + { +@@ -1722,15 +1722,15 @@ + + std::vector<std::string> parentIdsNew = details->parentIds; + std::vector<std::string> parentIdsRemoved = it->second.parentIds; +- std::erase_if(parentIdsNew, [&](const std::string& id) { return std::find(it->second.parentIds.begin(), it->second.parentIds.end(), id) != it->second.parentIds.end(); }); +- std::erase_if(parentIdsRemoved, [&](const std::string& id) { return std::find(details->parentIds.begin(), details->parentIds.end(), id) != details->parentIds.end(); }); ++ eraseIf(parentIdsNew, [&](const std::string& id) { return std::find(it->second.parentIds.begin(), it->second.parentIds.end(), id) != it->second.parentIds.end(); }); ++ eraseIf(parentIdsRemoved, [&](const std::string& id) { return std::find(details->parentIds.begin(), details->parentIds.end(), id) != details->parentIds.end(); }); + + for (const std::string& parentId : parentIdsNew) + folderContents_[parentId].childItems.push_back(it); //new insert => no need for duplicate check + + for (const std::string& parentId : parentIdsRemoved) + if (auto itP = folderContents_.find(parentId); itP != folderContents_.end()) +- std::erase_if(itP->second.childItems, [&](auto itChild) { return itChild == it; }); ++ eraseIf(itP->second.childItems, [&](auto itChild) { return itChild == it; }); + //if all parents are removed, Google Drive will (recursively) delete the item => don't prematurely do this now: wait for change notifications! + + it->second = *details; +@@ -1749,7 +1749,7 @@ + { + for (const std::string& parentId : it->second.parentIds) //1. delete from parent folders + if (auto itP = folderContents_.find(parentId); itP != folderContents_.end()) +- std::erase_if(itP->second.childItems, [&](auto itChild) { return itChild == it; }); ++ eraseIf(itP->second.childItems, [&](auto itChild) { return itChild == it; }); + + itemDetails_.erase(it); + } +@@ -1757,7 +1757,7 @@ + if (auto itP = folderContents_.find(itemId); itP != folderContents_.end()) + { + for (auto itChild : itP->second.childItems) //2. delete as parent from child items (don't wait for change notifications of children) +- std::erase_if(itChild->second.parentIds, [&](const std::string& id) { return id == itemId; }); ++ eraseIf(itChild->second.parentIds, [&](const std::string& id) { return id == itemId; }); + folderContents_.erase(itP); + } } - } diff -x '*.swp' -x .git -x '*.orig' -x '*.rej' -Naur 10.18-1/FreeFileSync/Source/afs/sftp.cpp 10.18-2/FreeFileSync/Source/afs/sftp.cpp --- 10.18-1/FreeFileSync/Source/afs/sftp.cpp 2019-11-20 17:54:23.078438037 -0500 +++ 10.18-2/FreeFileSync/Source/afs/sftp.cpp 2019-11-20 17:57:30.557558372 -0500 |