From e2253ebeca276461f3926317afa6ed128dad3b12 Mon Sep 17 00:00:00 2001 From: Sude Date: Sun, 24 Mar 2013 00:21:10 +0200 Subject: [PATCH] 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. --- include/downloader.h | 1 - src/downloader.cpp | 29 ----------------------------- 2 files changed, 30 deletions(-) diff --git a/include/downloader.h b/include/downloader.h index ce04c9a..ee0bbca 100644 --- a/include/downloader.h +++ b/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(); diff --git a/src/downloader.cpp b/src/downloader.cpp index 0a7dd9b..94e2d6b 100644 --- a/src/downloader.cpp +++ b/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 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