From 82ace39b426a843382a6a809e7b66487c1412494 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 31 Dec 2012 22:27:26 +0300 Subject: Fix code style and compilation under windows. --- src/gui/setup_touch.cpp | 2 -- src/gui/widgets/browserbox.cpp | 7 +++++-- src/gui/widgets/setuptouchitem.cpp | 9 +++++---- src/gui/widgets/setuptouchitem.h | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src/gui') diff --git a/src/gui/setup_touch.cpp b/src/gui/setup_touch.cpp index bd8214232..744be43d7 100644 --- a/src/gui/setup_touch.cpp +++ b/src/gui/setup_touch.cpp @@ -25,8 +25,6 @@ #include "configuration.h" -#include "utils/gettext.h" - #include "debug.h" static const int sizeListSize = 4; diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 1551ae81d..26d446060 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -536,8 +536,11 @@ int BrowserBox::calcHeight() const signed char c = row.at(start + 2); bool valid; - const gcn::Color col[2] = {getThemeCharColor(c, valid), - getThemeCharColor(c | 0x80, valid)}; + const gcn::Color col[2] = + { + getThemeCharColor(c, valid), + getThemeCharColor(c | 0x80, valid) + }; if (c == '>') { diff --git a/src/gui/widgets/setuptouchitem.cpp b/src/gui/widgets/setuptouchitem.cpp index 06faf7b19..8fea0478e 100644 --- a/src/gui/widgets/setuptouchitem.cpp +++ b/src/gui/widgets/setuptouchitem.cpp @@ -39,7 +39,8 @@ class SortTouchActionFunctor final } } touchActionSorter; -TouchActionsModel::TouchActionsModel() +TouchActionsModel::TouchActionsModel() : + NamesModel() { std::vector data; @@ -66,14 +67,14 @@ TouchActionsModel::TouchActionsModel() } } -int TouchActionsModel::getActionFromSelection(int sel) +int TouchActionsModel::getActionFromSelection(const int sel) const { - if (sel < 0 || sel > mActionId.size()) + if (sel < 0 || sel > static_cast(mActionId.size())) return -1; return mActionId[sel]; } -int TouchActionsModel::getSelectionFromAction(int action) +int TouchActionsModel::getSelectionFromAction(const int action) const { std::map::const_iterator it = mActionToSelection.find(action); diff --git a/src/gui/widgets/setuptouchitem.h b/src/gui/widgets/setuptouchitem.h index 77eff2ae6..36770ae63 100644 --- a/src/gui/widgets/setuptouchitem.h +++ b/src/gui/widgets/setuptouchitem.h @@ -38,9 +38,9 @@ class TouchActionsModel final : public NamesModel virtual ~TouchActionsModel() { } - int getActionFromSelection(int sel); + int getActionFromSelection(const int sel) const; - int getSelectionFromAction(int action); + int getSelectionFromAction(const int action) const; private: std::vector mActionId; -- cgit v1.2.3-70-g09d2