diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:01:29 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:01:29 +0200 |
commit | 9a2a524f1e311853d08050be2dcdddc09ac7759a (patch) | |
tree | d8e4a24169fce88c2d89931d58514889a0bcb0ea /algorithm.h | |
parent | 2.3 (diff) | |
download | FreeFileSync-9a2a524f1e311853d08050be2dcdddc09ac7759a.tar.gz FreeFileSync-9a2a524f1e311853d08050be2dcdddc09ac7759a.tar.bz2 FreeFileSync-9a2a524f1e311853d08050be2dcdddc09ac7759a.zip |
3.0
Diffstat (limited to 'algorithm.h')
-rw-r--r-- | algorithm.h | 86 |
1 files changed, 36 insertions, 50 deletions
diff --git a/algorithm.h b/algorithm.h index 25fc6338..b2b0a4ef 100644 --- a/algorithm.h +++ b/algorithm.h @@ -3,67 +3,53 @@ #include "fileHierarchy.h" -class ErrorHandler; -class wxComboBox; -class wxTextCtrl; -class wxDirPickerCtrl; -class wxScrolledWindow; - namespace FreeFileSync { - wxString formatFilesizeToShortString(const wxLongLong& filesize); - wxString formatFilesizeToShortString(const wxULongLong& filesize); - wxString formatFilesizeToShortString(const double filesize); - - wxString includeNumberSeparator(const wxString& number); - - 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 MainConfiguration& config, FolderComparison& folderCmp); - void swapGrids2(const MainConfiguration& config, FolderComparison& folderCmp); +struct DeterminationProblem //callback +{ + virtual ~DeterminationProblem() {} + virtual void reportWarning(const wxString& text) = 0; +}; +void redetermineSyncDirection(const SyncConfiguration& config, BaseDirMapping& baseDirectory, DeterminationProblem* handler); //handler may be NULL +void redetermineSyncDirection(const MainConfiguration& currentMainCfg, FolderComparison& folderCmp, DeterminationProblem* handler); - void redetermineSyncDirection(const SyncConfiguration& config, HierarchyObject& baseDirectory); - void redetermineSyncDirection(const MainConfiguration& currentMainCfg, FolderComparison& folderCmp); +void setSyncDirectionRec(SyncDirection newDirection, FileSystemObject& fsObj); //set new direction (recursively) - void setSyncDirection(SyncDirection newDirection, FileSystemObject& fsObj); //set new direction (recursively) +void applyFiltering(const MainConfiguration& currentMainCfg, FolderComparison& folderCmp); - void applyFiltering(const MainConfiguration& currentMainCfg, FolderComparison& folderCmp); +//manual deletion of files on main grid +std::pair<wxString, int> deleteFromGridAndHDPreview( //returns wxString with elements to be deleted and total count + const std::vector<FileSystemObject*>& rowsToDeleteOnLeft, //all pointers need to be bound! + const std::vector<FileSystemObject*>& rowsToDeleteOnRight, // + const bool deleteOnBothSides); - //manual deletion of files on main grid - std::pair<wxString, int> deleteFromGridAndHDPreview( //returns wxString with elements to be deleted and total count - const std::vector<FileSystemObject*>& rowsToDeleteOnLeft, //all pointers need to be bound! - const std::vector<FileSystemObject*>& rowsToDeleteOnRight, // - const bool deleteOnBothSides); +class DeleteFilesHandler +{ +public: + DeleteFilesHandler() {} + virtual ~DeleteFilesHandler() {} - class DeleteFilesHandler + enum Response { - public: - DeleteFilesHandler() {} - virtual ~DeleteFilesHandler() {} - - enum Response - { - IGNORE_ERROR = 10, - RETRY - }; - virtual Response reportError(const wxString& errorMessage) = 0; - - //virtual void totalFilesToDelete(int objectsTotal) = 0; //informs about the total number of files to be deleted - virtual void deletionSuccessful() = 0; //called for each file/folder that has been deleted - + IGNORE_ERROR = 10, + RETRY }; - void deleteFromGridAndHD(FolderComparison& folderCmp, //attention: rows will be physically deleted! - std::vector<FileSystemObject*>& rowsToDeleteOnLeft, //refresh GUI grid after deletion to remove invalid rows - std::vector<FileSystemObject*>& rowsToDeleteOnRight, //all pointers need to be bound! - const bool deleteOnBothSides, - const bool useRecycleBin, - const MainConfiguration& mainConfig, - DeleteFilesHandler* statusHandler); - - - wxString utcTimeToLocalString(const wxLongLong& utcTime, const Zstring& filename); + virtual Response reportError(const wxString& errorMessage) = 0; + + //virtual void totalFilesToDelete(int objectsTotal) = 0; //informs about the total number of files to be deleted + virtual void deletionSuccessful() = 0; //called for each file/folder that has been deleted + +}; +void deleteFromGridAndHD(FolderComparison& folderCmp, //attention: rows will be physically deleted! + std::vector<FileSystemObject*>& rowsToDeleteOnLeft, //refresh GUI grid after deletion to remove invalid rows + std::vector<FileSystemObject*>& rowsToDeleteOnRight, //all pointers need to be bound! + const bool deleteOnBothSides, + const bool useRecycleBin, + const MainConfiguration& mainConfig, + DeleteFilesHandler* statusHandler); } #endif // ALGORITHM_H_INCLUDED |