summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-17 20:33:28 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-17 20:33:28 +0100
commit366e0b120624cb382fd3b233b8ec7a75c31a2da4 (patch)
tree8cd1d65a19e490c2ce74bc2c2ef6ebe358b4d1c1 /src/gui
parente02c372c50b3d8b498661a05183f460ae6ae395f (diff)
downloadmana-client-366e0b120624cb382fd3b233b8ec7a75c31a2da4.tar.gz
mana-client-366e0b120624cb382fd3b233b8ec7a75c31a2da4.tar.bz2
mana-client-366e0b120624cb382fd3b233b8ec7a75c31a2da4.tar.xz
mana-client-366e0b120624cb382fd3b233b8ec7a75c31a2da4.zip
Got rid of const where it does not make much sense
It's not that useful to make variables that are passed by value const. In the declaration it is even completely ignored.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/color.cpp6
-rw-r--r--src/gui/color.h12
-rw-r--r--src/gui/equipmentwindow.cpp2
-rw-r--r--src/gui/equipmentwindow.h2
-rw-r--r--src/gui/itemcontainer.cpp2
-rw-r--r--src/gui/itemcontainer.h2
-rw-r--r--src/gui/npcintegerdialog.cpp4
-rw-r--r--src/gui/npcintegerdialog.h4
8 files changed, 17 insertions, 17 deletions
diff --git a/src/gui/color.cpp b/src/gui/color.cpp
index 02469893..31fa8ea4 100644
--- a/src/gui/color.cpp
+++ b/src/gui/color.cpp
@@ -52,7 +52,7 @@ Color::~Color()
}
}
-void Color::setColor(const char c, const int rgb)
+void Color::setColor(char c, int rgb)
{
for (ColVector::iterator col = mColVector.begin(),
colEnd = mColVector.end();
@@ -67,7 +67,7 @@ void Color::setColor(const char c, const int rgb)
}
}
-int Color::getColor(const char c, bool &valid) const
+int Color::getColor(char c, bool &valid) const
{
for (ColVector::const_iterator col = mColVector.begin(),
colEnd = mColVector.end();
@@ -102,7 +102,7 @@ char Color::getColorCharAt(int i)
return mColVector[i].ch;
}
-void Color::addColor(const char c, const int rgb, const std::string &text)
+void Color::addColor(char c, int rgb, const std::string &text)
{
int trueRgb = (int) config.getValue("Color" + text, rgb);
mColVector.push_back(ColorElem(c, trueRgb, text));
diff --git a/src/gui/color.h b/src/gui/color.h
index 8684a1a7..2816cedc 100644
--- a/src/gui/color.h
+++ b/src/gui/color.h
@@ -46,7 +46,7 @@ class Color : public gcn::ListModel
* @param c charater to be replaced
* @param rgb color to replace character
*/
- void setColor(const char c, const int rgb);
+ void setColor(char c, int rgb);
/**
* Define the color replacement for a character
@@ -56,7 +56,7 @@ class Color : public gcn::ListModel
* @param g green component
* @param b blue component
*/
- void setColor(const char c, const int r, const int g, const int b)
+ void setColor(char c, int r, int g, int b)
{
setColor(c, (r << 16) | (g << 8) | b);
}
@@ -67,12 +67,12 @@ class Color : public gcn::ListModel
* @param c character requested
* @param valid indicate whether character is known
*/
- int getColor(const char c, bool &valid) const;
+ int getColor(char c, bool &valid) const;
/**
* Return the number of colors known
*/
- int getNumberOfElements() {return mColVector.size(); }
+ int getNumberOfElements() { return mColVector.size(); }
/**
* Return the name of the ith color
@@ -111,7 +111,7 @@ class Color : public gcn::ListModel
private:
struct ColorElem
{
- ColorElem(const char c, const int rgb, const std::string &text) :
+ ColorElem(char c, int rgb, const std::string &text) :
ch(c), rgb(rgb), text(text) {}
char ch;
int rgb;
@@ -128,7 +128,7 @@ class Color : public gcn::ListModel
* @param rgb default color if not found in config
* @param text identifier of color
*/
- void addColor(const char c, const int rgb, const std::string &text);
+ void addColor(char c, int rgb, const std::string &text);
};
extern Color *textColor;
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp
index ae60eaf7..7361f7ab 100644
--- a/src/gui/equipmentwindow.cpp
+++ b/src/gui/equipmentwindow.cpp
@@ -156,7 +156,7 @@ void EquipmentWindow::action(const gcn::ActionEvent &event)
}
}
-Item* EquipmentWindow::getItem(const int &x, const int &y)
+Item* EquipmentWindow::getItem(int x, int y) const
{
for (int i = EQUIP_LEGS_SLOT; i < EQUIP_VECTOREND; i++)
{
diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h
index c491062a..24438477 100644
--- a/src/gui/equipmentwindow.h
+++ b/src/gui/equipmentwindow.h
@@ -89,7 +89,7 @@ class EquipmentWindow : public Window, public gcn::ActionListener
void mouseExited(gcn::MouseEvent &event);
void mouseMoved(gcn::MouseEvent &event);
- Item* getItem(const int &x, const int &y);
+ Item* getItem(int x, int y) const;
Equipment *mEquipment;
Inventory *mInventory;
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index 2894ca26..6e73731b 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -277,7 +277,7 @@ void ItemContainer::mouseExited(gcn::MouseEvent &event)
mItemPopup->setVisible(false);
}
-int ItemContainer::getSlotIndex(const int posX, const int posY) const
+int ItemContainer::getSlotIndex(int posX, int posY) const
{
int columns = getWidth() / gridWidth;
int index = posX / gridWidth + ((posY / gridHeight) * columns) + mOffset;
diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h
index 71fcc5d0..5ad140be 100644
--- a/src/gui/itemcontainer.h
+++ b/src/gui/itemcontainer.h
@@ -137,7 +137,7 @@ class ItemContainer : public gcn::Widget,
* @param posY The Y Coordinate position.
* @return The slot index on success, -1 on failure.
*/
- int getSlotIndex(const int posX, const int posY) const;
+ int getSlotIndex(int posX, int posY) const;
Inventory *mInventory;
Image *mSelImg;
diff --git a/src/gui/npcintegerdialog.cpp b/src/gui/npcintegerdialog.cpp
index 6b26349a..463f46ae 100644
--- a/src/gui/npcintegerdialog.cpp
+++ b/src/gui/npcintegerdialog.cpp
@@ -63,7 +63,7 @@ NpcIntegerDialog::NpcIntegerDialog():
setLocationRelativeTo(getParent());
}
-void NpcIntegerDialog::setRange(const int min, const int max)
+void NpcIntegerDialog::setRange(int min, int max)
{
mValueField->setRange(min, max);
}
@@ -109,7 +109,7 @@ void NpcIntegerDialog::action(const gcn::ActionEvent &event)
}
}
-void NpcIntegerDialog::setDefaultValue(const int value)
+void NpcIntegerDialog::setDefaultValue(int value)
{
mValueField->setDefaultValue(value);
}
diff --git a/src/gui/npcintegerdialog.h b/src/gui/npcintegerdialog.h
index 7c064ca6..941bb55a 100644
--- a/src/gui/npcintegerdialog.h
+++ b/src/gui/npcintegerdialog.h
@@ -59,14 +59,14 @@ class NpcIntegerDialog : public Window, public gcn::ActionListener
* @param min The minimum value to allow
* @param max The maximum value to allow
*/
- void setRange(const int min, const int max);
+ void setRange(int min, int max);
/**
* Sets the default value.
*
* @param value The new default value
*/
- void setDefaultValue(const int value);
+ void setDefaultValue(int value);
/**
* Checks whether NpcStringDialog is Focused or not.