diff options
Diffstat (limited to 'client/Config.cpp')
-rw-r--r-- | client/Config.cpp | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/client/Config.cpp b/client/Config.cpp index ba62ee0..21b2c44 100644 --- a/client/Config.cpp +++ b/client/Config.cpp @@ -44,10 +44,11 @@ void Config::FirewallEntry::Parse(string entry) /* * FileEntry nested class section */ -void Config::FileEntry::Parse(string entry, ActionType action) +void Config::FileEntry::Parse(string entry, ActionType _action) { Logger::Trace("Parsing file action %s\n", entry.c_str()); + action = _action; size_t start = 0, end = 0; if (action == DeleteAction) { @@ -66,8 +67,6 @@ void Config::FileEntry::Parse(string entry, ActionType action) { Logger::Error("Unknown FileEntry action!\n"); } - - Logger::Debug("path: %s, md5: %s\n", path.c_str(), md5.c_str()); } @@ -238,6 +237,30 @@ unsigned Config::GetStaticProxyGuiLines() return maxLine; } +vector<Config::FileEntry> Config::GetDeleteList() +{ + vector<FileEntry> delLst; + for (unsigned i = 0; i < fileActions.size(); i++) + { + if (fileActions[i].action == FileEntry::DeleteAction) + delLst.push_back(fileActions[i]); + } + + return delLst; +} + +vector<Config::FileEntry> Config::GetDownloadList() +{ + vector<FileEntry> downloadLst; + for (unsigned i = 0; i < fileActions.size(); i++) + { + if (fileActions[i].action == FileEntry::DownloadAction) + downloadLst.push_back(fileActions[i]); + } + + return downloadLst; +} + void Config::ParseConfig(string data) { @@ -366,9 +389,7 @@ void Config::ParseFirewalls(string data) } void Config::ParseDeleteList(string data) -{ - Logger::Debug("Delete list:\n%s", data.c_str()); - +{ //delete all entries with DeleteAction for (unsigned i = 0; i < fileActions.size(); i++) { |