From 4ecfd41e36533d858c98d051ef70cab80e69e972 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:00:50 +0200 Subject: 2.3 --- algorithm.h | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'algorithm.h') diff --git a/algorithm.h b/algorithm.h index a61859bf..25fc6338 100644 --- a/algorithm.h +++ b/algorithm.h @@ -1,12 +1,13 @@ #ifndef ALGORITHM_H_INCLUDED #define ALGORITHM_H_INCLUDED -#include "structures.h" +#include "fileHierarchy.h" class ErrorHandler; class wxComboBox; class wxTextCtrl; class wxDirPickerCtrl; +class wxScrolledWindow; namespace FreeFileSync @@ -19,18 +20,22 @@ namespace FreeFileSync void setDirectoryName(const wxString& dirname, wxTextCtrl* txtCtrl, wxDirPickerCtrl* dirPicker); void setDirectoryName(const wxString& dirname, wxComboBox* txtCtrl, wxDirPickerCtrl* dirPicker); + void scrollToBottom(wxScrolledWindow* scrWindow); - void swapGrids(const SyncConfiguration& config, FolderComparison& folderCmp); + void swapGrids2(const MainConfiguration& config, FolderComparison& folderCmp); - void redetermineSyncDirection(const SyncConfiguration& config, FolderComparison& folderCmp); + void redetermineSyncDirection(const SyncConfiguration& config, HierarchyObject& baseDirectory); + void redetermineSyncDirection(const MainConfiguration& currentMainCfg, FolderComparison& folderCmp); - void addSubElements(const FileComparison& fileCmp, const FileCompareLine& relevantRow, std::set& subElements); + void setSyncDirection(SyncDirection newDirection, FileSystemObject& fsObj); //set new direction (recursively) - //manual deletion of files on main grid: runs at individual directory pair level - std::pair deleteFromGridAndHDPreview(const FileComparison& fileCmp, //returns wxString with elements to be deleted and total count - const std::set& rowsToDeleteOnLeft, - const std::set& rowsToDeleteOnRight, - const bool deleteOnBothSides); + void applyFiltering(const MainConfiguration& currentMainCfg, FolderComparison& folderCmp); + + //manual deletion of files on main grid + std::pair deleteFromGridAndHDPreview( //returns wxString with elements to be deleted and total count + const std::vector& rowsToDeleteOnLeft, //all pointers need to be bound! + const std::vector& rowsToDeleteOnRight, // + const bool deleteOnBothSides); class DeleteFilesHandler { @@ -49,28 +54,16 @@ namespace FreeFileSync virtual void deletionSuccessful() = 0; //called for each file/folder that has been deleted }; - void deleteFromGridAndHD(FileComparison& fileCmp, - const std::set& rowsToDeleteOnLeft, - const std::set& rowsToDeleteOnRight, + void deleteFromGridAndHD(FolderComparison& folderCmp, //attention: rows will be physically deleted! + std::vector& rowsToDeleteOnLeft, //refresh GUI grid after deletion to remove invalid rows + std::vector& rowsToDeleteOnRight, //all pointers need to be bound! const bool deleteOnBothSides, const bool useRecycleBin, - const SyncConfiguration& syncConfig, + const MainConfiguration& mainConfig, DeleteFilesHandler* statusHandler); wxString utcTimeToLocalString(const wxLongLong& utcTime, const Zstring& filename); - - //enhanced binary search template: returns an iterator - template - inline - ForwardIterator custom_binary_search (ForwardIterator first, ForwardIterator last, const T& value) - { - first = lower_bound(first, last, value); - if (first != last && !(value < *first)) - return first; - else - return last; - } } #endif // ALGORITHM_H_INCLUDED -- cgit