--verbose now also sets curlhandle in API to verbose

This commit is contained in:
Sude 2013-03-16 22:33:03 +02:00
parent 57415af1c1
commit 6aa24207c3
3 changed files with 4 additions and 4 deletions

View File

@ -85,7 +85,7 @@ class API
apiConfig config;
userDetails user;
API(const std::string& token,const std::string& secret);
API(const std::string& token,const std::string& secret, const bool& verbose = false);
int init();
int login(const std::string& email, const std::string& password);
int getAPIConfig();

View File

@ -32,10 +32,10 @@ gameFile::~gameFile()
}
API::API(const std::string& token, const std::string& secret)
API::API(const std::string& token, const std::string& secret, const bool& verbose)
{
curlhandle = curl_easy_init();
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 0);
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, verbose);
curl_easy_setopt(curlhandle, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curlhandle, CURLOPT_NOPROGRESS, 1);
curl_easy_setopt(curlhandle, CURLOPT_CONNECTTIMEOUT, 10);

View File

@ -62,7 +62,7 @@ int Downloader::init()
if (config.bVerbose)
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1);
gogAPI = new API(config.sToken, config.sSecret);
gogAPI = new API(config.sToken, config.sSecret, config.bVerbose);
progressbar = new ProgressBar(!config.bNoUnicode, !config.bNoColor);
if (config.bLogin || !gogAPI->init())