summaryrefslogtreecommitdiff
path: root/src/gui/userpalette.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-21 00:45:24 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-21 00:45:24 +0300
commitcfa5391c1be51ef49380e398a72c813255d6316e (patch)
tree32e9f77ae80e72a6388923dddb90721e661394e5 /src/gui/userpalette.cpp
parent31acb66791e27b6cfa846302156ad2e7a88f5f04 (diff)
downloadplus-cfa5391c1be51ef49380e398a72c813255d6316e.tar.gz
plus-cfa5391c1be51ef49380e398a72c813255d6316e.tar.bz2
plus-cfa5391c1be51ef49380e398a72c813255d6316e.tar.xz
plus-cfa5391c1be51ef49380e398a72c813255d6316e.zip
first part of checks and style fixes.
Diffstat (limited to 'src/gui/userpalette.cpp')
-rw-r--r--src/gui/userpalette.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/gui/userpalette.cpp b/src/gui/userpalette.cpp
index 5d878a0f0..69c2b7093 100644
--- a/src/gui/userpalette.cpp
+++ b/src/gui/userpalette.cpp
@@ -25,12 +25,10 @@
#include "configuration.h"
#include "client.h"
-#include "logger.h"
#include "gui/gui.h"
#include "utils/gettext.h"
-#include "utils/stringutils.h"
#include <math.h>
@@ -192,7 +190,8 @@ UserPalette::~UserPalette()
}
}
-void UserPalette::setColor(int type, int r, int g, int b)
+void UserPalette::setColor(const int type, const int r,
+ const int g, const int b)
{
gcn::Color &color = mColors[type].color;
color.r = r;
@@ -200,11 +199,9 @@ void UserPalette::setColor(int type, int r, int g, int b)
color.b = b;
}
-void UserPalette::setGradient(int type, GradientType grad)
+void UserPalette::setGradient(const int type, const GradientType grad)
{
- ColorElem *elem = &mColors[type];
- if (!elem)
- return;
+ ColorElem *const elem = &mColors[type];
if (elem->grad != STATIC && grad == STATIC)
{
@@ -234,7 +231,7 @@ std::string UserPalette::getElementAt(int i)
return mColors[i].text;
}
-void UserPalette::commit(bool commitNonStatic)
+void UserPalette::commit(const bool commitNonStatic)
{
for (Colors::iterator i = mColors.begin(), iEnd = mColors.end();
i != iEnd; ++i)
@@ -279,8 +276,9 @@ int UserPalette::getColorTypeAt(int i)
return mColors[i].type;
}
-void UserPalette::addColor(unsigned type, unsigned rgb,
- Palette::GradientType grad, const std::string &text,
+void UserPalette::addColor(const unsigned type, const unsigned rgb,
+ Palette::GradientType grad,
+ const std::string &text,
int delay)
{
const unsigned maxType = sizeof(ColorTypeNames)