From 2e48bd149ce70eb5e0f5ade518ff7709708ef49e Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Fri, 22 Jun 2012 01:44:30 +0100 Subject: [PATCH] Stage 2 of autoupdate working --- src/client/Client.cpp | 18 +++++++++--------- src/update/UpdateActivity.cpp | 2 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 41c1faffb..71bbfc4db 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -27,6 +27,8 @@ #include "ClientListener.h" +#include "Update.h" + Client::Client(): authUser(0, ""), updateAvailable(false) @@ -76,19 +78,17 @@ Client::Client(): authUser = User(0, ""); std::cerr << "Error: Client [Read User data from pref] " << e.what() << std::endl; } - try - { - proxyString = ((json::String)(configDocument["Proxy"])).Value(); - } - catch (json::Exception &e) - { - proxyString = ""; - std::cerr << "Error: Client [Read Proxy from pref] " << e.what() << std::endl; - } } configFile.close(); } + if(GetPrefBool("version.update", false)==true) + { + SetPref("version.update", false); + update_finish(); + } + + proxyString = GetPrefString("proxy", ""); if(proxyString.length()) { http_init((char *)proxyString.c_str()); diff --git a/src/update/UpdateActivity.cpp b/src/update/UpdateActivity.cpp index a8fb7fc79..74343c10f 100644 --- a/src/update/UpdateActivity.cpp +++ b/src/update/UpdateActivity.cpp @@ -11,6 +11,7 @@ #include "UpdateActivity.h" #include "tasks/Task.h" #include "client/HTTP.h" +#include "client/Client.h" #include "Update.h" @@ -105,6 +106,7 @@ private: notifyError("Update failed - try downloading a new version."); } + Client::Ref().SetPref("version.update", true); return; corrupt: