From c8e0e909b4a8d18319fc65434a10dc446434817c Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:19:49 +0200 Subject: 5.3 --- ui/grid_view.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'ui/grid_view.cpp') diff --git a/ui/grid_view.cpp b/ui/grid_view.cpp index 2a3e84e3..80ff895c 100644 --- a/ui/grid_view.cpp +++ b/ui/grid_view.cpp @@ -267,10 +267,9 @@ GridView::StatusSyncPreview GridView::updateSyncPreview(bool hideFiltered, //map } -void GridView::getAllFileRef(const std::set& rows, std::vector& output) +std::vector GridView::getAllFileRef(const std::set& rows) { - output.clear(); - output.reserve(rows.size()); + std::vector output; auto iterLast = rows.lower_bound(rowsOnView()); //loop over valid rows only! std::for_each(rows.begin(), iterLast, @@ -279,6 +278,7 @@ void GridView::getAllFileRef(const std::set& rows, std::vector().swap(sortedRef); // currentSort.reset(); + folderPairCount = std::count_if(begin(folderCmp), end(folderCmp), + [](const BaseDirMapping& baseObj) //count non-empty pairs to distinguish single/multiple folder pair cases + { + return !baseObj.getBaseDirPf().empty() || + !baseObj.getBaseDirPf().empty(); + }); + for (auto iter = begin(folderCmp); iter != end(folderCmp); ++iter) SerializeHierarchy(sortedRef, iter - begin(folderCmp)).execute(*iter); } @@ -499,7 +506,7 @@ void GridView::sortView(ColumnTypeRim type, bool onLeft, bool ascending) viewRef.clear(); rowPositions.clear(); rowPositionsFirstChild.clear(); - currentSort.reset(new SortInfo(type, onLeft, ascending)); + currentSort = make_unique(type, onLeft, ascending); switch (type) { -- cgit