diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:59:06 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:59:06 +0200 |
commit | 4046be06720932a57a0f49416b0144b2858824d0 (patch) | |
tree | 678c37cab05960f48923a23bb46d9e01be89d35a /ui/gridView.cpp | |
parent | 1.19 (diff) | |
download | FreeFileSync-4046be06720932a57a0f49416b0144b2858824d0.tar.gz FreeFileSync-4046be06720932a57a0f49416b0144b2858824d0.tar.bz2 FreeFileSync-4046be06720932a57a0f49416b0144b2858824d0.zip |
2.0
Diffstat (limited to 'ui/gridView.cpp')
-rw-r--r-- | ui/gridView.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/ui/gridView.cpp b/ui/gridView.cpp index aa309970..aa1867fd 100644 --- a/ui/gridView.cpp +++ b/ui/gridView.cpp @@ -4,7 +4,7 @@ using FreeFileSync::GridView; -GridView::GridView(FolderComparison& results) : +GridView::GridView(FreeFileSync::FolderComparison& results) : leftOnlyFilesActive(false), rightOnlyFilesActive(false), leftNewerFilesActive(false), @@ -48,26 +48,24 @@ GridView::StatusInfo GridView::update_sub(const bool hideFiltered) { const FileComparison& fileCmp = j->fileCmp; - output.objectsTotal += j->fileCmp.size(); - RefIndex newEntry; newEntry.folderIndex = j - folderCmp.begin(); for (FileComparison::const_iterator i = fileCmp.begin(); i != fileCmp.end(); ++i) { - //hide filtered row, if corresponding option is set - if (hideFiltered && !i->selectedForSynchronization) - continue; - //process UI filter settings if (syncPreviewActive) //synchronization preview { //exclude result "==" - if (i->cmpResult == FILE_EQUAL) //note: consider elementsTotal()! - { - --output.objectsTotal; + if (i->cmpResult == FILE_EQUAL) //note: consider "objectsTotal" continue; - } + + output.objectsTotal++; + + //hide filtered row, if corresponding option is set + if (hideFiltered && !i->selectedForSynchronization) //keep AFTER "objectsTotal++" + continue; + switch (i->direction) { @@ -91,6 +89,12 @@ GridView::StatusInfo GridView::update_sub(const bool hideFiltered) } else //comparison results view { + output.objectsTotal++; + + //hide filtered row, if corresponding option is set + if (hideFiltered && !i->selectedForSynchronization) + continue; + switch (i->cmpResult) { case FILE_LEFT_SIDE_ONLY: @@ -164,13 +168,13 @@ GridView::StatusInfo GridView::update(const bool hideFiltered, const bool syncPr } -void GridView::viewRefToFolderRef(const std::set<int>& viewRef, FolderCompRef& output) +void GridView::viewRefToFolderRef(const std::set<int>& viewRef, FreeFileSync::FolderCompRef& output) { output.clear(); for (int i = 0; i < int(folderCmp.size()); ++i) output.push_back(std::set<int>()); //avoid copy by value for full set<int> - for (std::set<int>::iterator i = viewRef.begin(); i != viewRef.end(); ++i) + for (std::set<int>::const_iterator i = viewRef.begin(); i != viewRef.end(); ++i) { const unsigned int folder = refView[*i].folderIndex; const unsigned int row = refView[*i].rowIndex; @@ -261,6 +265,10 @@ void GridView::sortView(const SortType type, const bool onLeft, const bool ascen if ( ascending) std::sort(fileCmp.begin(), fileCmp.end(), sortByCmpResult<ASCENDING>); else if (!ascending) std::sort(fileCmp.begin(), fileCmp.end(), sortByCmpResult<DESCENDING>); break; + case SORT_BY_SYNC_DIRECTION: + if ( ascending) std::sort(fileCmp.begin(), fileCmp.end(), sortBySyncDirection<ASCENDING>); + else if (!ascending) std::sort(fileCmp.begin(), fileCmp.end(), sortBySyncDirection<DESCENDING>); + break; default: assert(false); } |