diff options
Diffstat (limited to 'algorithm.h')
-rw-r--r-- | algorithm.h | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/algorithm.h b/algorithm.h index 96ff6b1a..66203ec7 100644 --- a/algorithm.h +++ b/algorithm.h @@ -1,12 +1,13 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * +// * Copyright (C) ZenJu (zhnmju123 AT gmx DOT de) - All Rights Reserved * // ************************************************************************** #ifndef ALGORITHM_H_INCLUDED #define ALGORITHM_H_INCLUDED +#include <functional> #include "file_hierarchy.h" #include "lib/soft_filter.h" @@ -14,15 +15,10 @@ namespace zen { void swapGrids(const MainConfiguration& config, FolderComparison& folderCmp); -struct DeterminationProblem //callback -{ - virtual ~DeterminationProblem() {} - virtual void reportWarning(const std::wstring& text) = 0; -}; std::vector<DirectionConfig> extractDirectionCfg(const MainConfiguration& mainCfg); -void redetermineSyncDirection(const DirectionConfig& directConfig, BaseDirMapping& baseDirectory, DeterminationProblem* handler); //handler may be NULL -void redetermineSyncDirection(const MainConfiguration& mainCfg, FolderComparison& folderCmp, DeterminationProblem* handler); +void redetermineSyncDirection(const DirectionConfig& directConfig, BaseDirMapping& baseDirectory, std::function<void(const std::wstring&)> reportWarning); +void redetermineSyncDirection(const MainConfiguration& mainCfg, FolderComparison& folderCmp, std::function<void(const std::wstring&)> reportWarning); void setSyncDirectionRec(SyncDirection newDirection, FileSystemObject& fsObj); //set new direction (recursively) @@ -40,9 +36,9 @@ void setActiveStatus(bool newStatus, FileSystemObject& fsObj); //activate or //manual deletion of files on main grid -std::pair<wxString, int> deleteFromGridAndHDPreview( //returns wxString with elements to be deleted and total count of selected(!) objects, NOT total files/dirs! - const std::vector<FileSystemObject*>& rowsToDeleteOnLeft, //all pointers need to be bound! - const std::vector<FileSystemObject*>& rowsToDeleteOnRight, // +std::pair<wxString, int> deleteFromGridAndHDPreview( //returns wxString with elements to be deleted and total count of selected(!) objects, NOT total files/dirs! + const std::vector<FileSystemObject*>& selectionLeft, //all pointers need to be bound! + const std::vector<FileSystemObject*>& selectionRight, // bool deleteOnBothSides); class DeleteFilesHandler @@ -61,8 +57,8 @@ public: //virtual void totalFilesToDelete(int objectsTotal) = 0; //informs about the total number of files to be deleted virtual void notifyDeletion(const Zstring& currentObject) = 0; //called for each file/folder that has been deleted }; -void deleteFromGridAndHD(std::vector<FileSystemObject*>& rowsToDeleteOnLeft, //refresh GUI grid after deletion to remove invalid rows - std::vector<FileSystemObject*>& rowsToDeleteOnRight, //all pointers need to be bound! +void deleteFromGridAndHD(const std::vector<FileSystemObject*>& rowsToDeleteOnLeft, //refresh GUI grid after deletion to remove invalid rows + const std::vector<FileSystemObject*>& rowsToDeleteOnRight, //all pointers need to be bound! FolderComparison& folderCmp, //attention: rows will be physically deleted! const std::vector<DirectionConfig>& directCfgs, bool deleteOnBothSides, |