diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:03:20 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:03:20 +0200 |
commit | 528635604eea1d8c679a3d038e2f00030ef72444 (patch) | |
tree | 9c3cbec29aa7d3e209939662e040b9342c9e7400 /structures.h | |
parent | 3.1 (diff) | |
download | FreeFileSync-528635604eea1d8c679a3d038e2f00030ef72444.tar.gz FreeFileSync-528635604eea1d8c679a3d038e2f00030ef72444.tar.bz2 FreeFileSync-528635604eea1d8c679a3d038e2f00030ef72444.zip |
3.2
Diffstat (limited to 'structures.h')
-rw-r--r-- | structures.h | 58 |
1 files changed, 16 insertions, 42 deletions
diff --git a/structures.h b/structures.h index 180fa90c..ba9c3ada 100644 --- a/structures.h +++ b/structures.h @@ -134,25 +134,23 @@ struct AlternateSyncConfig } }; -//standard filter settings, OS dependent -Zstring defaultIncludeFilter(); -Zstring defaultExcludeFilter(); +//standard exclude filter settings, OS dependent +Zstring standardExcludeFilter(); -struct AlternateFilter +struct FilterConfig { - AlternateFilter(const Zstring& include, const Zstring& exclude) : + FilterConfig(const Zstring& include, const Zstring& exclude) : includeFilter(include), excludeFilter(exclude) {} - AlternateFilter() : //construct with default values - includeFilter(defaultIncludeFilter()), - excludeFilter(defaultExcludeFilter()) {} + FilterConfig() : //construct with default values + includeFilter(DefaultStr("*")) {} Zstring includeFilter; Zstring excludeFilter; - bool operator==(const AlternateFilter& other) const + bool operator==(const FilterConfig& other) const { return includeFilter == other.includeFilter && excludeFilter == other.excludeFilter; @@ -160,23 +158,6 @@ struct AlternateFilter }; -struct FolderPair -{ - FolderPair(const Zstring& leftDir, const Zstring& rightDir) : - leftDirectory(leftDir), - rightDirectory(rightDir) {} - - Zstring leftDirectory; - Zstring rightDirectory; - - bool operator==(const FolderPair& other) const - { - return leftDirectory == other.leftDirectory && - rightDirectory == other.rightDirectory; - } -}; - - struct FolderPairEnh //enhanced folder pairs with (optional) alternate configuration { FolderPairEnh() {} @@ -184,17 +165,17 @@ struct FolderPairEnh //enhanced folder pairs with (optional) alternate configura FolderPairEnh(const Zstring& leftDir, const Zstring& rightDir, const boost::shared_ptr<const AlternateSyncConfig>& syncConfig, - const boost::shared_ptr<const AlternateFilter>& filter) : + const FilterConfig& filter) : leftDirectory(leftDir), rightDirectory(rightDir) , altSyncConfig(syncConfig), - altFilter(filter) {} + localFilter(filter) {} Zstring leftDirectory; Zstring rightDirectory; boost::shared_ptr<const AlternateSyncConfig> altSyncConfig; //optional - boost::shared_ptr<const AlternateFilter> altFilter; //optional + FilterConfig localFilter; bool operator==(const FolderPairEnh& other) const { @@ -205,9 +186,7 @@ struct FolderPairEnh //enhanced folder pairs with (optional) alternate configura *altSyncConfig == *other.altSyncConfig : altSyncConfig.get() == other.altSyncConfig.get()) && - (altFilter.get() && other.altFilter.get() ? - *altFilter == *other.altFilter : - altFilter.get() == other.altFilter.get()); + localFilter == other.localFilter; } }; @@ -215,18 +194,13 @@ struct FolderPairEnh //enhanced folder pairs with (optional) alternate configura struct MainConfiguration { MainConfiguration() : - mainFolderPair(Zstring(), Zstring()), compareVar(CMP_BY_TIME_SIZE), -#ifdef FFS_WIN filterIsActive(true), -#elif defined FFS_LINUX - filterIsActive(false), -#endif - includeFilter(defaultIncludeFilter()), - excludeFilter(defaultExcludeFilter()), + includeFilter(DefaultStr("*")), + excludeFilter(standardExcludeFilter()), handleDeletion(FreeFileSync::recycleBinExistsWrap() ? MOVE_TO_RECYCLE_BIN : DELETE_PERMANENTLY) {} //enable if OS supports it; else user will have to activate first and then get an error message - FolderPair mainFolderPair; + FolderPairEnh firstPair; //there needs to be at least one pair! std::vector<FolderPairEnh> additionalPairs; //Compare setting @@ -235,7 +209,7 @@ struct MainConfiguration //Synchronisation settings SyncConfiguration syncConfiguration; - //Filter setting + //GLOBAL filter settings bool filterIsActive; Zstring includeFilter; Zstring excludeFilter; @@ -250,7 +224,7 @@ struct MainConfiguration bool operator==(const MainConfiguration& other) const { - return mainFolderPair == other.mainFolderPair && + return firstPair == other.firstPair && additionalPairs == other.additionalPairs && compareVar == other.compareVar && syncConfiguration == other.syncConfiguration && |