Minor cosmetic code cleanup.

This commit is contained in:
Leon Styhre 2021-03-27 10:26:13 +01:00
parent 33a60c975c
commit 23903de1cf
12 changed files with 21 additions and 21 deletions

View file

@ -68,7 +68,7 @@ GuiGameScraper::GuiGameScraper(
mGrid.setEntry(mSearch, Vector2i(0, 5), true); mGrid.setEntry(mSearch, Vector2i(0, 5), true);
// Buttons // Buttons
std::vector< std::shared_ptr<ButtonComponent> > buttons; std::vector<std::shared_ptr<ButtonComponent>> buttons;
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "REFINE SEARCH", buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "REFINE SEARCH",
"refine search", [&] { "refine search", [&] {

View file

@ -134,7 +134,7 @@ void GuiGamelistFilter::addFiltersToMenu()
// All possible filters for this type. // All possible filters for this type.
std::map<std::string, int>* allKeys = (*it).allIndexKeys; std::map<std::string, int>* allKeys = (*it).allIndexKeys;
std::string menuLabel = (*it).menuLabel; // Text to show in menu. std::string menuLabel = (*it).menuLabel; // Text to show in menu.
std::shared_ptr< OptionListComponent<std::string> > optionList; std::shared_ptr<OptionListComponent<std::string>> optionList;
// Add filters (with first one selected). // Add filters (with first one selected).
ComponentListRow row; ComponentListRow row;

View file

@ -74,7 +74,7 @@ GuiScraperMulti::GuiScraperMulti(
mGrid.setEntry(mSearchComp, Vector2i(0, 3), mSearchComp->getSearchType() != mGrid.setEntry(mSearchComp, Vector2i(0, 3), mSearchComp->getSearchType() !=
GuiScraperSearch::ALWAYS_ACCEPT_FIRST_RESULT, true); GuiScraperSearch::ALWAYS_ACCEPT_FIRST_RESULT, true);
std::vector< std::shared_ptr<ButtonComponent> > buttons; std::vector<std::shared_ptr<ButtonComponent>> buttons;
if (mApproveResults) { if (mApproveResults) {
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "REFINE SEARCH", buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "REFINE SEARCH",

View file

@ -17,14 +17,14 @@ namespace pugi { class xml_document; }
void screenscraper_generate_scraper_requests( void screenscraper_generate_scraper_requests(
const ScraperSearchParams& params, const ScraperSearchParams& params,
std::queue< std::unique_ptr<ScraperRequest> >& requests, std::queue<std::unique_ptr<ScraperRequest>>& requests,
std::vector<ScraperSearchResult>& results); std::vector<ScraperSearchResult>& results);
class ScreenScraperRequest : public ScraperHttpRequest class ScreenScraperRequest : public ScraperHttpRequest
{ {
public: public:
// ctor for a GetGameList request. // ctor for a GetGameList request.
ScreenScraperRequest(std::queue< std::unique_ptr<ScraperRequest> >& requestsWrite, ScreenScraperRequest(std::queue<std::unique_ptr<ScraperRequest>>& requestsWrite,
std::vector<ScraperSearchResult>& resultsWrite, std::vector<ScraperSearchResult>& resultsWrite,
const std::string& url) : ScraperHttpRequest(resultsWrite, url), const std::string& url) : ScraperHttpRequest(resultsWrite, url),
mRequestQueue(&requestsWrite) {} mRequestQueue(&requestsWrite) {}

View file

@ -102,17 +102,17 @@ public:
std::string type; std::string type;
struct Property { struct Property {
void operator= (const Vector4f& value) void operator=(const Vector4f& value)
{ {
r = value; r = value;
const Vector4f initVector = value; const Vector4f initVector = value;
v = Vector2f(initVector.x(), initVector.y()); v = Vector2f(initVector.x(), initVector.y());
} }
void operator= (const Vector2f& value) { v = value; } void operator=(const Vector2f& value) { v = value; }
void operator= (const std::string& value) { s = value; } void operator=(const std::string& value) { s = value; }
void operator= (const unsigned int& value) { i = value; } void operator=(const unsigned int& value) { i = value; }
void operator= (const float& value) { f = value; } void operator=(const float& value) { f = value; }
void operator= (const bool& value) { b = value; } void operator=(const bool& value) { b = value; }
Vector4f r; Vector4f r;
Vector2f v; Vector2f v;
@ -122,7 +122,7 @@ public:
bool b; bool b;
}; };
std::map< std::string, Property > properties; std::map<std::string, Property> properties;
template<typename T> template<typename T>
const T get(const std::string& prop) const const T get(const std::string& prop) const
@ -185,7 +185,7 @@ public:
static std::string getThemeFromCurrentSet(const std::string& system); static std::string getThemeFromCurrentSet(const std::string& system);
private: private:
static std::map< std::string, std::map<std::string, ElementPropertyType> > sElementMap; static std::map<std::string, std::map<std::string, ElementPropertyType>> sElementMap;
static std::vector<std::string> sSupportedFeatures; static std::vector<std::string> sSupportedFeatures;
static std::vector<std::string> sSupportedViews; static std::vector<std::string> sSupportedViews;

View file

@ -327,7 +327,7 @@ void ComponentList::updateElementPosition(const ComponentListRow& row)
void ComponentList::updateElementSize(const ComponentListRow& row) void ComponentList::updateElementSize(const ComponentListRow& row)
{ {
float width = mSize.x() - (TOTAL_HORIZONTAL_PADDING_PX * Renderer::getScreenWidthModifier()); float width = mSize.x() - (TOTAL_HORIZONTAL_PADDING_PX * Renderer::getScreenWidthModifier());
std::vector< std::shared_ptr<GuiComponent> > resizeVec; std::vector<std::shared_ptr<GuiComponent>> resizeVec;
for (auto it = row.elements.cbegin(); it != row.elements.cend(); it++) { for (auto it = row.elements.cbegin(); it != row.elements.cend(); it++) {
if (it->resize_width) if (it->resize_width)

View file

@ -74,8 +74,8 @@ void HelpComponent::updateGrid()
// [icon] [spacer1] [text] [spacer2] // [icon] [spacer1] [text] [spacer2]
std::vector< std::shared_ptr<ImageComponent> > icons; std::vector<std::shared_ptr<ImageComponent>> icons;
std::vector< std::shared_ptr<TextComponent> > labels; std::vector<std::shared_ptr<TextComponent>> labels;
float width = 0; float width = 0;
const float height = std::round(font->getLetterHeight() * 1.25f); const float height = std::round(font->getLetterHeight() * 1.25f);

View file

@ -31,7 +31,7 @@ public:
private: private:
std::shared_ptr<TextureResource> getIconTexture(const char* name); std::shared_ptr<TextureResource> getIconTexture(const char* name);
std::map< std::string, std::shared_ptr<TextureResource> > mIconCache; std::map<std::string, std::shared_ptr<TextureResource>> mIconCache;
std::shared_ptr<ComponentGrid> mGrid; std::shared_ptr<ComponentGrid> mGrid;
void updateGrid(); void updateGrid();

View file

@ -142,7 +142,7 @@ std::vector<HelpPrompt> MenuComponent::getHelpPrompts()
} }
std::shared_ptr<ComponentGrid> makeButtonGrid(Window* window, std::shared_ptr<ComponentGrid> makeButtonGrid(Window* window,
const std::vector< std::shared_ptr<ButtonComponent> >& buttons) const std::vector<std::shared_ptr<ButtonComponent>>& buttons)
{ {
std::shared_ptr<ComponentGrid> buttonGrid = std::make_shared<ComponentGrid> std::shared_ptr<ComponentGrid> buttonGrid = std::make_shared<ComponentGrid>
(window, Vector2i(static_cast<int>(buttons.size()), 2)); (window, Vector2i(static_cast<int>(buttons.size()), 2));

View file

@ -200,7 +200,7 @@ GuiInputConfig::GuiInputConfig(
setPress(mMappings.front()); setPress(mMappings.front());
// Buttons. // Buttons.
std::vector< std::shared_ptr<ButtonComponent> > buttons; std::vector<std::shared_ptr<ButtonComponent>> buttons;
std::function<void()> okFunction = [this, okCallback] { std::function<void()> okFunction = [this, okCallback] {
// If we have just configured the keyboard, then unset the flag to indicate that // If we have just configured the keyboard, then unset the flag to indicate that
// we are using the default keyboard mappings. // we are using the default keyboard mappings.

View file

@ -41,7 +41,7 @@ GuiTextEditPopup::GuiTextEditPopup(
mText = std::make_shared<TextEditComponent>(mWindow); mText = std::make_shared<TextEditComponent>(mWindow);
mText->setValue(initValue); mText->setValue(initValue);
std::vector< std::shared_ptr<ButtonComponent> > buttons; std::vector<std::shared_ptr<ButtonComponent>> buttons;
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, acceptBtnText, acceptBtnText, buttons.push_back(std::make_shared<ButtonComponent>(mWindow, acceptBtnText, acceptBtnText,
[this, okCallback] { okCallback(mText->getValue()); delete this; })); [this, okCallback] { okCallback(mText->getValue()); delete this; }));
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "CLEAR", "clear", buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "CLEAR", "clear",

View file

@ -50,7 +50,7 @@ private:
ResourceManager(); ResourceManager();
static std::shared_ptr<ResourceManager> sInstance; static std::shared_ptr<ResourceManager> sInstance;
std::list< std::weak_ptr<IReloadable> > mReloadables; std::list<std::weak_ptr<IReloadable>> mReloadables;
ResourceData loadFile(const std::string& path) const; ResourceData loadFile(const std::string& path) const;
}; };