Partially revert "Add language to installer path if it is missing"

Reverts some changes from 97e948abb4d277da3b57f85c65befe2ebb3f04dd.

Revert automatically adding the language code to filename:
http://gog.com/forum/general/introducing_the_beta_release_of_the_new_gogcom_downloader/post1483
Keep language in gameFile class because it may be useful later.
This commit is contained in:
Sude 2013-03-24 00:21:10 +02:00
parent 3131b00589
commit e2253ebeca
2 changed files with 0 additions and 30 deletions

View File

@ -59,7 +59,6 @@ class Downloader
int downloadCovers(std::string gamename, std::string directory, std::string cover_xml_data);
int login();
int getGameDetails();
void fixInstallerLanguagePath(gameDetails& game);
void getGameList();
size_t getResumePosition();
CURLcode beginDownload();

View File

@ -229,7 +229,6 @@ int Downloader::getGameDetails()
game = gogAPI->getGameDetails(gameNames[i], config.iInstallerType, config.iInstallerLanguage);
if (!gogAPI->getError())
{
this->fixInstallerLanguagePath(game);
if (!config.bUpdateCheck)
games.push_back(game);
else
@ -260,34 +259,6 @@ int Downloader::getGameDetails()
return 0;
}
// Adds language to installer path if it is missing
void Downloader::fixInstallerLanguagePath(gameDetails& game)
{
for (unsigned int i = 0; i < game.installers.size(); ++i)
{
if (game.installers[i].language != GlobalConstants::LANGUAGE_EN)
{
std::string lang;
for (unsigned int j = 0; j < GlobalConstants::LANGUAGES.size(); ++j)
{
if (game.installers[i].language == GlobalConstants::LANGUAGES[j].languageId)
{
lang = "_" + GlobalConstants::LANGUAGES[j].languageCode + "_";
break;
}
}
boost::match_results<std::string::const_iterator> what;
boost::regex expression(lang, boost::regex::perl | boost::regex::icase);
if (!boost::regex_search(game.installers[i].path, what, expression))
{
boost::regex expression("(.*)_(\\d+\\.\\d+.*$)", boost::regex::perl | boost::regex::icase);
boost::regex_search(game.installers[i].path,what,expression);
game.installers[i].path = what[1] + lang + what[2];
}
}
}
}
void Downloader::listGames()
{
if (config.bListDetails) // Detailed list