From 87ace0b8cb3d407b3f43610d8838cd90fe36e1da Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 4 Jan 2022 22:36:15 +0100 Subject: [PATCH] Changed some shared_ptr return values to use values instead of references. --- es-app/src/SystemData.h | 2 +- es-app/src/guis/GuiScraperSearch.h | 2 +- es-app/src/views/gamelist/IGameListView.h | 2 +- es-core/src/ThemeData.cpp | 2 +- es-core/src/ThemeData.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/es-app/src/SystemData.h b/es-app/src/SystemData.h index f40ac14bc..990ff7ee6 100644 --- a/es-app/src/SystemData.h +++ b/es-app/src/SystemData.h @@ -91,7 +91,7 @@ public: mEnvData->mPlatformIds.cend(); } - const std::shared_ptr& getTheme() const { return mTheme; } + const std::shared_ptr getTheme() const { return mTheme; } std::string getGamelistPath(bool forWrite) const; std::string getThemePath() const; diff --git a/es-app/src/guis/GuiScraperSearch.h b/es-app/src/guis/GuiScraperSearch.h index 2df3ce320..490fee366 100644 --- a/es-app/src/guis/GuiScraperSearch.h +++ b/es-app/src/guis/GuiScraperSearch.h @@ -98,7 +98,7 @@ public: void onFocusGained() override { mGrid.onFocusGained(); } void onFocusLost() override { mGrid.onFocusLost(); } - std::shared_ptr& getResultList() { return mResultList; } + std::shared_ptr getResultList() { return mResultList; } private: void updateViewStyle(); diff --git a/es-app/src/views/gamelist/IGameListView.h b/es-app/src/views/gamelist/IGameListView.h index 212a062e9..9c31185d9 100644 --- a/es-app/src/views/gamelist/IGameListView.h +++ b/es-app/src/views/gamelist/IGameListView.h @@ -30,7 +30,7 @@ public: virtual void onThemeChanged(const std::shared_ptr& theme) = 0; void setTheme(const std::shared_ptr& theme); - const std::shared_ptr& getTheme() const { return mTheme; } + const std::shared_ptr getTheme() const { return mTheme; } virtual void preloadGamelist(){}; diff --git a/es-core/src/ThemeData.cpp b/es-core/src/ThemeData.cpp index 87a6a8594..ee57b2bdc 100644 --- a/es-core/src/ThemeData.cpp +++ b/es-core/src/ThemeData.cpp @@ -607,7 +607,7 @@ const ThemeData::ThemeElement* ThemeData::getElement(const std::string& view, return &elemIt->second; } -const std::shared_ptr& ThemeData::getDefault() +const std::shared_ptr ThemeData::getDefault() { static std::shared_ptr theme = nullptr; if (theme == nullptr) { diff --git a/es-core/src/ThemeData.h b/es-core/src/ThemeData.h index 416c0d433..9bca793c3 100644 --- a/es-core/src/ThemeData.h +++ b/es-core/src/ThemeData.h @@ -199,7 +199,7 @@ public: const std::string& view, Window* window); - static const std::shared_ptr& getDefault(); + static const std::shared_ptr getDefault(); static std::map getThemeSets(); static std::string getThemeFromCurrentSet(const std::string& system);