diff --git a/src/components/GuiGameScraper.cpp b/src/components/GuiGameScraper.cpp index d8111f7a4..e15eab576 100644 --- a/src/components/GuiGameScraper.cpp +++ b/src/components/GuiGameScraper.cpp @@ -4,10 +4,8 @@ #include "../scrapers/Scraper.h" #include "../Settings.h" -#define RESULT_COUNT 5 - GuiGameScraper::GuiGameScraper(Window* window, ScraperSearchParams params, std::function doneFunc, std::function skipFunc) : GuiComponent(window), - mList(window, Eigen::Vector2i(2, 7 + RESULT_COUNT)), + mList(window, Eigen::Vector2i(2, 7 + MAX_SCRAPER_RESULTS)), mBox(window, ":/frame.png"), mHeader(window, params.game->getBaseName(), Font::get(*window->getResourceManager(), Font::getDefaultPath(), FONT_SIZE_MEDIUM)), mResultName(window, "", Font::get(*window->getResourceManager(), Font::getDefaultPath(), FONT_SIZE_MEDIUM)), @@ -78,8 +76,8 @@ GuiGameScraper::GuiGameScraper(Window* window, ScraperSearchParams params, std:: //y = 5 is a spacer row std::shared_ptr font = Font::get(*window->getResourceManager(), Font::getDefaultPath(), FONT_SIZE_SMALL); - mResultNames.reserve(RESULT_COUNT); - for(int i = 0; i < RESULT_COUNT; i ++) + mResultNames.reserve(MAX_SCRAPER_RESULTS); + for(int i = 0; i < MAX_SCRAPER_RESULTS; i ++) { mResultNames.push_back(TextComponent(mWindow, "RESULT...", font)); mResultNames.at(i).setColor(0x111111FF); diff --git a/src/components/GuiGameScraper.h b/src/components/GuiGameScraper.h index db8d0191f..1a268a114 100644 --- a/src/components/GuiGameScraper.h +++ b/src/components/GuiGameScraper.h @@ -11,6 +11,8 @@ #include "../HttpReq.h" #include "ImageComponent.h" +#define MAX_SCRAPER_RESULTS 5 + class GuiGameScraper : public GuiComponent { public: diff --git a/src/scrapers/GamesDBScraper.cpp b/src/scrapers/GamesDBScraper.cpp index d44b4d390..a0cb66915 100644 --- a/src/scrapers/GamesDBScraper.cpp +++ b/src/scrapers/GamesDBScraper.cpp @@ -1,4 +1,5 @@ #include "GamesDBScraper.h" +#include "../components/GuiGameScraper.h" #include "../components/AsyncReqComponent.h" #include "../Log.h" #include "../pugiXML/pugixml.hpp" @@ -49,7 +50,7 @@ std::vector GamesDBScraper::parseReq(ScraperSearchParams params, s unsigned int resultNum = 0; pugi::xml_node game = data.child("Game"); - while(game && resultNum < 5) + while(game && resultNum < MAX_SCRAPER_RESULTS) { mdl.push_back(MetaDataList(params.system->getGameMDD())); mdl.back().set("name", game.child("GameTitle").text().get());