Fix warnings, fix crash when ctrl+click opening a save
This commit is contained in:
parent
0b1ffbcfd6
commit
1171c308e1
@ -1964,7 +1964,7 @@ Json::Value Client::GetPref(Json::Value root, std::string prop, Json::Value defa
|
||||
{
|
||||
try
|
||||
{
|
||||
int dot = prop.find('.');
|
||||
size_t dot = prop.find('.');
|
||||
if (dot == prop.npos)
|
||||
return root.get(prop, defaultValue);
|
||||
else
|
||||
@ -2042,7 +2042,7 @@ std::vector<std::string> Client::GetPrefStringArray(std::string prop)
|
||||
{
|
||||
std::vector<std::string> ret;
|
||||
Json::Value arr = GetPref(preferences, prop);
|
||||
for (int i = 0; i < arr.size(); i++)
|
||||
for (int i = 0; i < (int)arr.size(); i++)
|
||||
ret.push_back(arr[i].asString());
|
||||
return ret;
|
||||
}
|
||||
@ -2059,7 +2059,7 @@ std::vector<double> Client::GetPrefNumberArray(std::string prop)
|
||||
{
|
||||
std::vector<double> ret;
|
||||
Json::Value arr = GetPref(preferences, prop);
|
||||
for (int i = 0; i < arr.size(); i++)
|
||||
for (int i = 0; i < (int)arr.size(); i++)
|
||||
ret.push_back(arr[i].asDouble());
|
||||
return ret;
|
||||
}
|
||||
@ -2076,7 +2076,7 @@ std::vector<int> Client::GetPrefIntegerArray(std::string prop)
|
||||
{
|
||||
std::vector<int> ret;
|
||||
Json::Value arr = GetPref(preferences, prop);
|
||||
for (int i = 0; i < arr.size(); i++)
|
||||
for (int i = 0; i < (int)arr.size(); i++)
|
||||
ret.push_back(arr[i].asInt());
|
||||
return ret;
|
||||
}
|
||||
@ -2093,7 +2093,7 @@ std::vector<unsigned int> Client::GetPrefUIntegerArray(std::string prop)
|
||||
{
|
||||
std::vector<unsigned int> ret;
|
||||
Json::Value arr = GetPref(preferences, prop);
|
||||
for (int i = 0; i < arr.size(); i++)
|
||||
for (int i = 0; i < (int)arr.size(); i++)
|
||||
ret.push_back(arr[i].asUInt());
|
||||
return ret;
|
||||
}
|
||||
@ -2110,7 +2110,7 @@ std::vector<bool> Client::GetPrefBoolArray(std::string prop)
|
||||
{
|
||||
std::vector<bool> ret;
|
||||
Json::Value arr = GetPref(preferences, prop);
|
||||
for (int i = 0; i < arr.size(); i++)
|
||||
for (int i = 0; i < (int)arr.size(); i++)
|
||||
ret.push_back(arr[i].asBool());
|
||||
return ret;
|
||||
}
|
||||
@ -2128,7 +2128,7 @@ std::vector<bool> Client::GetPrefBoolArray(std::string prop)
|
||||
// and return it to SetPref to do the actual setting
|
||||
Json::Value Client::SetPrefHelper(Json::Value root, std::string prop, Json::Value value)
|
||||
{
|
||||
int dot = prop.find(".");
|
||||
size_t dot = prop.find(".");
|
||||
if (dot == prop.npos)
|
||||
root[prop] = value;
|
||||
else
|
||||
@ -2144,7 +2144,7 @@ void Client::SetPref(std::string prop, Json::Value value)
|
||||
{
|
||||
try
|
||||
{
|
||||
int dot = prop.find(".");
|
||||
size_t dot = prop.find(".");
|
||||
if (dot == prop.npos)
|
||||
preferences[prop] = value;
|
||||
else
|
||||
@ -2163,7 +2163,7 @@ void Client::SetPref(std::string prop, std::vector<Json::Value> value)
|
||||
try
|
||||
{
|
||||
Json::Value arr;
|
||||
for (int i = 0; i < value.size(); i++)
|
||||
for (int i = 0; i < (int)value.size(); i++)
|
||||
{
|
||||
arr.append(value[i]);
|
||||
}
|
||||
@ -2173,4 +2173,4 @@ void Client::SetPref(std::string prop, std::vector<Json::Value> value)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,13 +9,13 @@ Download::Download(std::string uri_, bool keepAlive):
|
||||
downloadData(NULL),
|
||||
downloadSize(0),
|
||||
downloadStatus(0),
|
||||
downloadFinished(false),
|
||||
downloadCanceled(false),
|
||||
downloadStarted(false),
|
||||
postData(""),
|
||||
postDataBoundary(""),
|
||||
userID(""),
|
||||
userSession("")
|
||||
userSession(""),
|
||||
downloadFinished(false),
|
||||
downloadCanceled(false),
|
||||
downloadStarted(false)
|
||||
{
|
||||
uri = std::string(uri_);
|
||||
DownloadManager::Ref().AddDownload(this);
|
||||
|
@ -9,8 +9,8 @@ DownloadManager::DownloadManager():
|
||||
lastUsed(time(NULL)),
|
||||
managerRunning(false),
|
||||
managerShutdown(false),
|
||||
downloads(NULL),
|
||||
downloadsAddQueue(NULL)
|
||||
downloads(std::vector<Download*>()),
|
||||
downloadsAddQueue(std::vector<Download*>())
|
||||
{
|
||||
pthread_mutex_init(&downloadLock, NULL);
|
||||
pthread_mutex_init(&downloadAddLock, NULL);
|
||||
@ -142,4 +142,4 @@ void DownloadManager::Lock()
|
||||
void DownloadManager::Unlock()
|
||||
{
|
||||
pthread_mutex_unlock(&downloadAddLock);
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <string>
|
||||
|
||||
static const char hexChars[] = "0123456789abcdef";
|
||||
static long http_timeout = 15;
|
||||
static const long http_timeout = 15;
|
||||
|
||||
void http_init(char *proxy);
|
||||
void http_done(void);
|
||||
|
@ -12,6 +12,8 @@ PreviewModel::PreviewModel():
|
||||
saveInfo(NULL),
|
||||
saveData(NULL),
|
||||
saveComments(NULL),
|
||||
saveDataDownload(NULL),
|
||||
commentsDownload(NULL),
|
||||
commentBoxEnabled(false),
|
||||
commentsLoaded(false),
|
||||
commentsTotal(0),
|
||||
|
Loading…
Reference in New Issue
Block a user