Skip to content
Browse files

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

Reverts some changes from 97e948a.

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.
  • Loading branch information...
1 parent 3131b00 commit e2253ebeca276461f3926317afa6ed128dad3b12 @Sude- committed Mar 24, 2013
Showing with 0 additions and 30 deletions.
  1. +0 −1 include/downloader.h
  2. +0 −29 src/downloader.cpp
View
1 include/downloader.h
@@ -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
29 src/downloader.cpp
@@ -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

0 comments on commit e2253eb

Please sign in to comment.
Something went wrong with that request. Please try again.