diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-04-22 17:47:52 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-08-04 21:24:44 +0200 |
commit | f94d3280c2f2520a80e9099e0dd4d6d9491e18a5 (patch) | |
tree | bd546ac39f2f2739b8d10ed6ac9385534d38b256 | |
parent | 3d1aa110349c2f74bfd10451edba10e2a4d485d6 (diff) | |
download | mana-f94d3280c2f2520a80e9099e0dd4d6d9491e18a5.tar.gz mana-f94d3280c2f2520a80e9099e0dd4d6d9491e18a5.tar.bz2 mana-f94d3280c2f2520a80e9099e0dd4d6d9491e18a5.tar.xz mana-f94d3280c2f2520a80e9099e0dd4d6d9491e18a5.zip |
Removed unused Skin::mName and Skin::mFilePath
-rw-r--r-- | src/resources/theme.cpp | 17 | ||||
-rw-r--r-- | src/resources/theme.h | 20 |
2 files changed, 8 insertions, 29 deletions
diff --git a/src/resources/theme.cpp b/src/resources/theme.cpp index 67cd6650..9a8ac7a7 100644 --- a/src/resources/theme.cpp +++ b/src/resources/theme.cpp @@ -53,12 +53,7 @@ static void initDefaultThemePath() defaultThemePath = "graphics/gui/"; } -Skin::Skin(ImageRect skin, Image *close, Image *stickyUp, Image *stickyDown, - const std::string &filePath, - const std::string &name): - instances(0), - mFilePath(filePath), - mName(name), +Skin::Skin(ImageRect skin, Image *close, Image *stickyUp, Image *stickyDown): mBorder(skin), mCloseImage(close), mStickyImageUp(stickyUp), @@ -157,10 +152,11 @@ Skin *Theme::load(const std::string &filename, const std::string &defaultPath) { // Check if this skin was already loaded auto skinIterator = mSkins.find(filename); - if (mSkins.end() != skinIterator) + if (skinIterator != mSkins.end()) { - skinIterator->second->instances++; - return skinIterator->second; + Skin *skin = skinIterator->second; + skin->instances++; + return skin; } Skin *skin = readSkin(filename); @@ -316,8 +312,7 @@ Skin *Theme::readSkin(const std::string &filename) Image *stickyImageDown = sticky->getSubImage(15, 0, 15, 15); sticky->decRef(); - Skin *skin = new Skin(border, closeImage, stickyImageUp, stickyImageDown, - filename); + Skin *skin = new Skin(border, closeImage, stickyImageUp, stickyImageDown); skin->updateAlpha(mMinimumOpacity); return skin; } diff --git a/src/resources/theme.h b/src/resources/theme.h index 434bd6d8..7edae416 100644 --- a/src/resources/theme.h +++ b/src/resources/theme.h @@ -40,25 +40,11 @@ class ProgressBar; class Skin { public: - Skin(ImageRect skin, Image *close, Image *stickyUp, Image *stickyDown, - const std::string &filePath, - const std::string &name = std::string()); + Skin(ImageRect skin, Image *close, Image *stickyUp, Image *stickyDown); ~Skin(); /** - * Returns the skin's name. Useful for giving a human friendly skin - * name if a dialog for skin selection for a specific window type is - * done. - */ - const std::string &getName() const { return mName; } - - /** - * Returns the skin's xml file path. - */ - const std::string &getFilePath() const { return mFilePath; } - - /** * Returns the background skin. */ const ImageRect &getBorder() const { return mBorder; } @@ -89,11 +75,9 @@ class Skin */ void updateAlpha(float minimumOpacityAllowed = 0.0f); - int instances; + int instances = 0; private: - std::string mFilePath; /**< File name path for the skin */ - std::string mName; /**< Name of the skin to use */ ImageRect mBorder; /**< The window border and background */ Image *mCloseImage; /**< Close Button Image */ Image *mStickyImageUp; /**< Sticky Button Image */ |