From b70d1b6d97dcfd78030fb457889e37cb45f6097d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 14 Sep 2012 20:30:31 +0300 Subject: Fix code style. --- src/gui/palette.h | 4 ++-- src/gui/unregisterdialog.cpp | 4 ++-- src/gui/unregisterdialog.h | 4 ++-- src/gui/userpalette.cpp | 2 +- src/gui/widgets/layout.cpp | 12 ++++++------ 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/gui') diff --git a/src/gui/palette.h b/src/gui/palette.h index 836ec77e6..38bd83ffb 100644 --- a/src/gui/palette.h +++ b/src/gui/palette.h @@ -179,8 +179,8 @@ class Palette int delay; int committedDelay; - void set(int type0, gcn::Color& color0, GradientType grad0, - int delay0) + void set(const int type0, const gcn::Color &color0, + const GradientType grad0, const int delay0) { ColorElem::type = type0; ColorElem::color = color0; diff --git a/src/gui/unregisterdialog.cpp b/src/gui/unregisterdialog.cpp index 59441f9e1..edceb54e8 100644 --- a/src/gui/unregisterdialog.cpp +++ b/src/gui/unregisterdialog.cpp @@ -47,11 +47,11 @@ UnRegisterDialog::UnRegisterDialog(LoginData *const data): Window(_("Unregister"), true, nullptr, "unregister.xml"), ActionListener(), + mLoginData(data), mPasswordField(new PasswordField(mLoginData->password)), mUnRegisterButton(new Button(_("Unregister"), "unregister", this)), mCancelButton(new Button(_("Cancel"), "cancel", this)), - mWrongDataNoticeListener(new WrongDataNoticeListener), - mLoginData(data) + mWrongDataNoticeListener(new WrongDataNoticeListener) { gcn::Label *const userLabel = new Label(strprintf(_("Name: %s"), mLoginData->username.c_str())); diff --git a/src/gui/unregisterdialog.h b/src/gui/unregisterdialog.h index 8a3be85d9..de783a410 100644 --- a/src/gui/unregisterdialog.h +++ b/src/gui/unregisterdialog.h @@ -60,14 +60,14 @@ class UnRegisterDialog : public Window, public gcn::ActionListener void action(const gcn::ActionEvent &event); private: + LoginData *mLoginData; + gcn::TextField *mPasswordField; gcn::Button *mUnRegisterButton; gcn::Button *mCancelButton; WrongDataNoticeListener *mWrongDataNoticeListener; - - LoginData *mLoginData; }; #endif diff --git a/src/gui/userpalette.cpp b/src/gui/userpalette.cpp index 69c2b7093..cb4aa3587 100644 --- a/src/gui/userpalette.cpp +++ b/src/gui/userpalette.cpp @@ -298,7 +298,7 @@ void UserPalette::addColor(const unsigned type, const unsigned rgb, rgbValue = atox(rgbString); else rgbValue = atoi(rgbString.c_str()); - gcn::Color trueCol = rgbValue; + const gcn::Color &trueCol = rgbValue; grad = static_cast(config.getValue(configName + "Gradient", static_cast(grad))); delay = config.getValueInt(configName + "Delay", delay); diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp index 96c6dffee..b0b194bde 100644 --- a/src/gui/widgets/layout.cpp +++ b/src/gui/widgets/layout.cpp @@ -88,7 +88,7 @@ void LayoutCell::computeSizes() std::vector >::const_iterator i = mArray->mCells.begin(); - std::vector >::const_iterator + const std::vector >::const_iterator i_end = mArray->mCells.end(); while (i != i_end) { @@ -116,12 +116,12 @@ LayoutArray::~LayoutArray() { std::vector >::iterator i = mCells.begin(); - std::vector >::iterator + const std::vector >::iterator i_end = mCells.end(); while (i != i_end) { std::vector< LayoutCell * >::iterator j = i->begin(); - std::vector< LayoutCell * >::iterator j_end = i->end(); + const std::vector< LayoutCell * >::iterator j_end = i->end(); while (j != j_end) { delete *j; @@ -162,7 +162,7 @@ void LayoutArray::resizeGrid(int w, const int h) std::vector >::iterator i = mCells.begin(); - std::vector >::iterator + const std::vector >::iterator i_end = mCells.end(); while (i != i_end) { @@ -187,7 +187,7 @@ void LayoutArray::matchColWidth(const int n1, const int n2) { resizeGrid(std::max(n1, n2) + 1, 0); const std::vector widths = getSizes(0, Layout::AUTO_DEF); - int s = std::max(widths[n1], widths[n2]); + const int s = std::max(widths[n1], widths[n2]); mSizes[0][n1] = s; mSizes[0][n2] = s; } @@ -273,7 +273,7 @@ std::vector LayoutArray::getSizes(const int dim, int upp) const { for (int gridX = 0; gridX < gridW; ++gridX) { - LayoutCell const *cell = mCells[gridY][gridX]; + const LayoutCell *const cell = mCells[gridY][gridX]; if (!cell || cell->mType == LayoutCell::NONE) continue; -- cgit v1.2.3-70-g09d2