summaryrefslogtreecommitdiff
path: root/algorithm.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:18:53 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:18:53 +0200
commit32cb97237e7691d31977ab503c6ea4511e8eb3a8 (patch)
tree4e97b53e9f7b74e8cc5d7548507d9e82ae38e36f /algorithm.h
parent4.6 (diff)
downloadFreeFileSync-32cb97237e7691d31977ab503c6ea4511e8eb3a8.tar.gz
FreeFileSync-32cb97237e7691d31977ab503c6ea4511e8eb3a8.tar.bz2
FreeFileSync-32cb97237e7691d31977ab503c6ea4511e8eb3a8.zip
5.0
Diffstat (limited to 'algorithm.h')
-rw-r--r--algorithm.h22
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,
bgstack15