From 23903de1cf3fbd029d7140b75d5d32cc412b8326 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 27 Mar 2021 10:26:13 +0100 Subject: [PATCH] Minor cosmetic code cleanup. --- es-app/src/guis/GuiGameScraper.cpp | 2 +- es-app/src/guis/GuiGamelistFilter.cpp | 2 +- es-app/src/guis/GuiScraperMulti.cpp | 2 +- es-app/src/scrapers/ScreenScraper.h | 4 ++-- es-core/src/ThemeData.h | 16 ++++++++-------- es-core/src/components/ComponentList.cpp | 2 +- es-core/src/components/HelpComponent.cpp | 4 ++-- es-core/src/components/HelpComponent.h | 2 +- es-core/src/components/MenuComponent.cpp | 2 +- es-core/src/guis/GuiInputConfig.cpp | 2 +- es-core/src/guis/GuiTextEditPopup.cpp | 2 +- es-core/src/resources/ResourceManager.h | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/es-app/src/guis/GuiGameScraper.cpp b/es-app/src/guis/GuiGameScraper.cpp index e32ea054d..1556daa95 100644 --- a/es-app/src/guis/GuiGameScraper.cpp +++ b/es-app/src/guis/GuiGameScraper.cpp @@ -68,7 +68,7 @@ GuiGameScraper::GuiGameScraper( mGrid.setEntry(mSearch, Vector2i(0, 5), true); // Buttons - std::vector< std::shared_ptr > buttons; + std::vector> buttons; buttons.push_back(std::make_shared(mWindow, "REFINE SEARCH", "refine search", [&] { diff --git a/es-app/src/guis/GuiGamelistFilter.cpp b/es-app/src/guis/GuiGamelistFilter.cpp index f35dc3ae2..27c4b5481 100644 --- a/es-app/src/guis/GuiGamelistFilter.cpp +++ b/es-app/src/guis/GuiGamelistFilter.cpp @@ -134,7 +134,7 @@ void GuiGamelistFilter::addFiltersToMenu() // All possible filters for this type. std::map* allKeys = (*it).allIndexKeys; std::string menuLabel = (*it).menuLabel; // Text to show in menu. - std::shared_ptr< OptionListComponent > optionList; + std::shared_ptr> optionList; // Add filters (with first one selected). ComponentListRow row; diff --git a/es-app/src/guis/GuiScraperMulti.cpp b/es-app/src/guis/GuiScraperMulti.cpp index d5abb0e72..741cfb317 100644 --- a/es-app/src/guis/GuiScraperMulti.cpp +++ b/es-app/src/guis/GuiScraperMulti.cpp @@ -74,7 +74,7 @@ GuiScraperMulti::GuiScraperMulti( mGrid.setEntry(mSearchComp, Vector2i(0, 3), mSearchComp->getSearchType() != GuiScraperSearch::ALWAYS_ACCEPT_FIRST_RESULT, true); - std::vector< std::shared_ptr > buttons; + std::vector> buttons; if (mApproveResults) { buttons.push_back(std::make_shared(mWindow, "REFINE SEARCH", diff --git a/es-app/src/scrapers/ScreenScraper.h b/es-app/src/scrapers/ScreenScraper.h index 8b889425d..5ca88e911 100644 --- a/es-app/src/scrapers/ScreenScraper.h +++ b/es-app/src/scrapers/ScreenScraper.h @@ -17,14 +17,14 @@ namespace pugi { class xml_document; } void screenscraper_generate_scraper_requests( const ScraperSearchParams& params, - std::queue< std::unique_ptr >& requests, + std::queue>& requests, std::vector& results); class ScreenScraperRequest : public ScraperHttpRequest { public: // ctor for a GetGameList request. - ScreenScraperRequest(std::queue< std::unique_ptr >& requestsWrite, + ScreenScraperRequest(std::queue>& requestsWrite, std::vector& resultsWrite, const std::string& url) : ScraperHttpRequest(resultsWrite, url), mRequestQueue(&requestsWrite) {} diff --git a/es-core/src/ThemeData.h b/es-core/src/ThemeData.h index 41f1c604d..d2855298f 100644 --- a/es-core/src/ThemeData.h +++ b/es-core/src/ThemeData.h @@ -102,17 +102,17 @@ public: std::string type; struct Property { - void operator= (const Vector4f& value) + void operator=(const Vector4f& value) { r = value; const Vector4f initVector = value; v = Vector2f(initVector.x(), initVector.y()); } - void operator= (const Vector2f& value) { v = value; } - void operator= (const std::string& value) { s = value; } - void operator= (const unsigned int& value) { i = value; } - void operator= (const float& value) { f = value; } - void operator= (const bool& value) { b = value; } + void operator=(const Vector2f& value) { v = value; } + void operator=(const std::string& value) { s = value; } + void operator=(const unsigned int& value) { i = value; } + void operator=(const float& value) { f = value; } + void operator=(const bool& value) { b = value; } Vector4f r; Vector2f v; @@ -122,7 +122,7 @@ public: bool b; }; - std::map< std::string, Property > properties; + std::map properties; template const T get(const std::string& prop) const @@ -185,7 +185,7 @@ public: static std::string getThemeFromCurrentSet(const std::string& system); private: - static std::map< std::string, std::map > sElementMap; + static std::map> sElementMap; static std::vector sSupportedFeatures; static std::vector sSupportedViews; diff --git a/es-core/src/components/ComponentList.cpp b/es-core/src/components/ComponentList.cpp index 3f9beb875..54fec3c40 100644 --- a/es-core/src/components/ComponentList.cpp +++ b/es-core/src/components/ComponentList.cpp @@ -327,7 +327,7 @@ void ComponentList::updateElementPosition(const ComponentListRow& row) void ComponentList::updateElementSize(const ComponentListRow& row) { float width = mSize.x() - (TOTAL_HORIZONTAL_PADDING_PX * Renderer::getScreenWidthModifier()); - std::vector< std::shared_ptr > resizeVec; + std::vector> resizeVec; for (auto it = row.elements.cbegin(); it != row.elements.cend(); it++) { if (it->resize_width) diff --git a/es-core/src/components/HelpComponent.cpp b/es-core/src/components/HelpComponent.cpp index 32a3c5067..d2eb37ec7 100644 --- a/es-core/src/components/HelpComponent.cpp +++ b/es-core/src/components/HelpComponent.cpp @@ -74,8 +74,8 @@ void HelpComponent::updateGrid() // [icon] [spacer1] [text] [spacer2] - std::vector< std::shared_ptr > icons; - std::vector< std::shared_ptr > labels; + std::vector> icons; + std::vector> labels; float width = 0; const float height = std::round(font->getLetterHeight() * 1.25f); diff --git a/es-core/src/components/HelpComponent.h b/es-core/src/components/HelpComponent.h index 4c1055481..36f726af7 100644 --- a/es-core/src/components/HelpComponent.h +++ b/es-core/src/components/HelpComponent.h @@ -31,7 +31,7 @@ public: private: std::shared_ptr getIconTexture(const char* name); - std::map< std::string, std::shared_ptr > mIconCache; + std::map> mIconCache; std::shared_ptr mGrid; void updateGrid(); diff --git a/es-core/src/components/MenuComponent.cpp b/es-core/src/components/MenuComponent.cpp index 36143d02f..d16b4ac54 100644 --- a/es-core/src/components/MenuComponent.cpp +++ b/es-core/src/components/MenuComponent.cpp @@ -142,7 +142,7 @@ std::vector MenuComponent::getHelpPrompts() } std::shared_ptr makeButtonGrid(Window* window, - const std::vector< std::shared_ptr >& buttons) + const std::vector>& buttons) { std::shared_ptr buttonGrid = std::make_shared (window, Vector2i(static_cast(buttons.size()), 2)); diff --git a/es-core/src/guis/GuiInputConfig.cpp b/es-core/src/guis/GuiInputConfig.cpp index 3047a093e..9c5db9f64 100644 --- a/es-core/src/guis/GuiInputConfig.cpp +++ b/es-core/src/guis/GuiInputConfig.cpp @@ -200,7 +200,7 @@ GuiInputConfig::GuiInputConfig( setPress(mMappings.front()); // Buttons. - std::vector< std::shared_ptr > buttons; + std::vector> buttons; std::function okFunction = [this, okCallback] { // If we have just configured the keyboard, then unset the flag to indicate that // we are using the default keyboard mappings. diff --git a/es-core/src/guis/GuiTextEditPopup.cpp b/es-core/src/guis/GuiTextEditPopup.cpp index 1aa6fa1f9..71aee9be9 100644 --- a/es-core/src/guis/GuiTextEditPopup.cpp +++ b/es-core/src/guis/GuiTextEditPopup.cpp @@ -41,7 +41,7 @@ GuiTextEditPopup::GuiTextEditPopup( mText = std::make_shared(mWindow); mText->setValue(initValue); - std::vector< std::shared_ptr > buttons; + std::vector> buttons; buttons.push_back(std::make_shared(mWindow, acceptBtnText, acceptBtnText, [this, okCallback] { okCallback(mText->getValue()); delete this; })); buttons.push_back(std::make_shared(mWindow, "CLEAR", "clear", diff --git a/es-core/src/resources/ResourceManager.h b/es-core/src/resources/ResourceManager.h index f589fd3ea..5ddfcc310 100644 --- a/es-core/src/resources/ResourceManager.h +++ b/es-core/src/resources/ResourceManager.h @@ -50,7 +50,7 @@ private: ResourceManager(); static std::shared_ptr sInstance; - std::list< std::weak_ptr > mReloadables; + std::list> mReloadables; ResourceData loadFile(const std::string& path) const; };