diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-07 17:54:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-07 17:54:05 +0300 |
commit | b43451daa5dc7b2e352d084d45934cf71db7ae4f (patch) | |
tree | 1e636b067a19ca00fe757d2c287342b300058b29 | |
parent | 5b1eaa9ce112d70f3b93699145858e6a33ab2a3b (diff) | |
download | manaverse-b43451daa5dc7b2e352d084d45934cf71db7ae4f.tar.gz manaverse-b43451daa5dc7b2e352d084d45934cf71db7ae4f.tar.bz2 manaverse-b43451daa5dc7b2e352d084d45934cf71db7ae4f.tar.xz manaverse-b43451daa5dc7b2e352d084d45934cf71db7ae4f.zip |
Add missing const.
-rw-r--r-- | src/gui/widgets/itemcontainer.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/scrollarea.cpp | 11 | ||||
-rw-r--r-- | src/listeners/baselistener.hpp | 4 | ||||
-rw-r--r-- | src/utils/translation/podict.h | 4 |
4 files changed, 9 insertions, 12 deletions
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h index 06e9fd459..0fbe84da9 100644 --- a/src/gui/widgets/itemcontainer.h +++ b/src/gui/widgets/itemcontainer.h @@ -123,7 +123,7 @@ class ItemContainer final : public Widget, void setSortType(const int sortType); - void setName(std::string str) + void setName(const std::string &str) { mName = str; } void updateMatrix(); diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 8761e3f7d..e006302c7 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -254,16 +254,13 @@ void ScrollArea::logic() Widget *const content = getContent(); if (content) { - const int frameSize = content->getFrameSize(); + unsigned int frameSize = content->getFrameSize(); content->setPosition(-mHScroll + frameSize, -mVScroll + frameSize); content->logic(); - } - // When no scrollbar in a certain direction, adapt content size to match - // the content dimension exactly. - if (content) - { - const unsigned int frameSize = 2 * content->getFrameSize(); + // When no scrollbar in a certain direction, + // adapt content size to match the content dimension exactly. + frameSize = 2 * content->getFrameSize(); if (mHPolicy == ScrollArea::SHOW_NEVER) { content->setWidth((mVBarVisible ? (mDimension.width diff --git a/src/listeners/baselistener.hpp b/src/listeners/baselistener.hpp index 66dd0d7cf..9b089aab2 100644 --- a/src/listeners/baselistener.hpp +++ b/src/listeners/baselistener.hpp @@ -41,7 +41,7 @@ mListeners.push_back(listener); \ } \ \ - void name::removeListener(name *const listener) \ + void name::removeListener(const name *const listener) \ { \ std::vector<name*>::iterator it = mListeners.begin(); \ while (it != mListeners.end()) \ @@ -61,7 +61,7 @@ \ static void addListener(name *const listener); \ \ - static void removeListener(name *const listener); \ + static void removeListener(const name *const listener); \ \ private: \ static std::vector<name*> mListeners; diff --git a/src/utils/translation/podict.h b/src/utils/translation/podict.h index 36cf0d4af..45150d408 100644 --- a/src/utils/translation/podict.h +++ b/src/utils/translation/podict.h @@ -47,10 +47,10 @@ class PoDict final PoMap *getMap() { return &mPoLines; } - void set(std::string key, std::string value) + void set(const std::string &key, const std::string &value) { mPoLines[key] = value; } - void setLang(std::string lang) + void setLang(const std::string &lang) { mLang = lang; } private: |