summaryrefslogtreecommitdiff
path: root/client/Config.cpp
diff options
context:
space:
mode:
authorAlex Borisov <borisov.alexandr@rambler.ru>2011-11-27 12:31:03 +0200
committerAlex Borisov <borisov.alexandr@rambler.ru>2011-11-27 12:31:03 +0200
commita19e9744751d4278f56cb3b6ff885c0068f03a3d (patch)
treec33901631e352a48594700a11505e8f74bfa0368 /client/Config.cpp
parent474acc85db4e403d8207f1744de18bfc4a5f0acd (diff)
File downloading (no MD5 hash check yet). Various fixes
Diffstat (limited to 'client/Config.cpp')
-rw-r--r--client/Config.cpp33
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++)
{