diff options
| author | Alex Borisov <borisov.alexandr@rambler.ru> | 2011-12-04 22:53:44 +0200 | 
|---|---|---|
| committer | Alex Borisov <borisov.alexandr@rambler.ru> | 2011-12-04 22:53:44 +0200 | 
| commit | dddb90056c37c9d094255ed8af956b4c049b41c9 (patch) | |
| tree | 7ecd07b0bb219a3b5b008aed7d087c3ea61dc151 | |
| parent | 4fc3551822a57a3b26d0c4540e205f9b340f9899 (diff) | |
FIX encoding issues
| -rw-r--r-- | client/Dialog.cpp | 22 | 
1 files changed, 11 insertions, 11 deletions
diff --git a/client/Dialog.cpp b/client/Dialog.cpp index a5d205c..3df6c19 100644 --- a/client/Dialog.cpp +++ b/client/Dialog.cpp @@ -25,7 +25,7 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)  	vector<string> countries = cfg->GetCountries();  	for (unsigned i = 0; i < countries.size(); i++)  	{ -		QString country = QString::fromUtf8(countries[i].c_str()); +		QString country = QString::fromLocal8Bit(countries[i].c_str());  		countryBox->addItem(country);  	}  	countryBox->setCurrentIndex(-1); @@ -115,7 +115,7 @@ void ProxyDialog::CountryActivated(int index)  		return;  	} -	string country(countryBox->currentText().toUtf8().constData()); +	string country(countryBox->currentText().toLocal8Bit().constData());  	Logger::Info("Country %s was selected\n", country.c_str());  	UpdatedConfig *cfg = UpdatedConfig::CurrentConfig(); @@ -127,7 +127,7 @@ void ProxyDialog::CountryActivated(int index)  		cityBox->clear();  		for (unsigned i = 0; i < cities.size(); i++)  		{ -			QString city = QString::fromUtf8(cities[i].c_str()); +			QString city = QString::fromLocal8Bit(cities[i].c_str());  			cityBox->addItem(city);  		}  		cityBox->setCurrentIndex(-1); @@ -139,7 +139,7 @@ void ProxyDialog::CountryActivated(int index)  		stateBox->clear();  		for (unsigned i = 0; i < states.size(); i++)  		{ -			QString state = QString::fromUtf8(states[i].c_str()); +			QString state = QString::fromLocal8Bit(states[i].c_str());  			stateBox->addItem(state);  		}  		stateBox->setCurrentIndex(-1); @@ -157,8 +157,8 @@ void ProxyDialog::StateActivated(int index)  		return;  	} -	string country(countryBox->currentText().toUtf8().constData()); -	string state(stateBox->currentText().toUtf8().constData()); +	string country(countryBox->currentText().toLocal8Bit().constData()); +	string state(stateBox->currentText().toLocal8Bit().constData());  	Logger::Info("State %s was selected\n", state.c_str());  	UpdatedConfig *cfg = UpdatedConfig::CurrentConfig(); @@ -166,7 +166,7 @@ void ProxyDialog::StateActivated(int index)  	cityBox->clear();  	for (unsigned i = 0; i < cities.size(); i++)  	{ -		QString city = QString::fromUtf8(cities[i].c_str()); +		QString city = QString::fromLocal8Bit(cities[i].c_str());  		cityBox->addItem(city);  	}  	cityBox->setCurrentIndex(-1); @@ -184,11 +184,11 @@ void ProxyDialog::CityActivated(int index)  	vector<string> proxies;  	UpdatedConfig *cfg = UpdatedConfig::CurrentConfig();	 -	string country(countryBox->currentText().toUtf8().constData()); -	string city(cityBox->currentText().toUtf8().constData()); +	string country(countryBox->currentText().toLocal8Bit().constData()); +	string city(cityBox->currentText().toLocal8Bit().constData());  	if (stateBox->isVisible())  	{ -		string state(stateBox->currentText().toUtf8().constData()); +		string state(stateBox->currentText().toLocal8Bit().constData());  		proxies = cfg->GetProxies(country, state, city);  	}  	else @@ -210,7 +210,7 @@ void ProxyDialog::CityActivated(int index)  	Logger::Trace("Adding new buttons\n");  	for (unsigned i = 0; i < proxies.size(); i++)  	{ -		QString btnStr = QString::fromUtf8(proxies[i].c_str()); +		QString btnStr = QString::fromLocal8Bit(proxies[i].c_str());  		QPushButton *btn = new QPushButton(btnStr);  		btn->setCheckable(true);  		genericProxyGroup->addButton(btn);  | 
