diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:19:49 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:19:49 +0200 |
commit | c8e0e909b4a8d18319fc65434a10dc446434817c (patch) | |
tree | eee91e7d2ce229dd043811eae8f1e2bd78061916 /ui/grid_view.cpp | |
parent | 5.2 (diff) | |
download | FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.gz FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.bz2 FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.zip |
5.3
Diffstat (limited to 'ui/grid_view.cpp')
-rw-r--r-- | ui/grid_view.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
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<size_t>& rows, std::vector<FileSystemObject*>& output) +std::vector<FileSystemObject*> GridView::getAllFileRef(const std::set<size_t>& rows) { - output.clear(); - output.reserve(rows.size()); + std::vector<FileSystemObject*> 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<size_t>& rows, std::vector<FileSyste if (FileSystemObject* fsObj = FileSystemObject::retrieve(viewRef[pos])) output.push_back(fsObj); }); + return output; } @@ -336,6 +336,13 @@ void GridView::setData(FolderComparison& folderCmp) std::vector<RefIndex>().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<LEFT_SIDE >().empty() || + !baseObj.getBaseDirPf<RIGHT_SIDE>().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<SortInfo>(type, onLeft, ascending); switch (type) { |