From f1812857720449697c9106a7a3776b7202258cb3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 18 Nov 2015 19:02:45 +0300 Subject: Fix code style in beingequipbackend and add some consts to it. --- src/gui/popups/popupmenu.cpp | 4 ++-- src/gui/popups/popupmenu.h | 6 +++--- src/gui/windows/equipmentwindow.cpp | 4 ++-- src/gui/windows/equipmentwindow.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/gui') diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index f55d8cb22..5f0676741 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1624,7 +1624,7 @@ void PopupMenu::handleLink(const std::string &link, void PopupMenu::showPopup(Window *const parent, const int x, const int y, - Item *const item, + const Item *const item, const InventoryTypeT type) { if (!item) @@ -2120,7 +2120,7 @@ void PopupMenu::showPickupItemPopup(const int x, const int y, void PopupMenu::showUndressPopup(const int x, const int y, const Being *const being, - Item *const item) + const Item *const item) { if (!being || !item) return; diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h index d37a29f56..0a83c5dd7 100644 --- a/src/gui/popups/popupmenu.h +++ b/src/gui/popups/popupmenu.h @@ -95,7 +95,7 @@ class PopupMenu final : public Popup, public LinkHandler */ void showPopup(Window *const parent, const int x, const int y, - Item *const item, + const Item *const item, const InventoryTypeT type); void showPopup(const int x, const int y, Button *const button); @@ -125,7 +125,7 @@ class PopupMenu final : public Popup, public LinkHandler void showUndressPopup(const int x, const int y, const Being *const being, - Item *const item); + const Item *const item); void showMapPopup(const int x, const int y, const int x2, const int y2, @@ -209,7 +209,7 @@ class PopupMenu final : public Popup, public LinkHandler BeingId mBeingId; BeingId mFloorItemId; - Item *mItem; + const Item *mItem; int mItemId; ItemColor mItemColor; MapItem *mMapItem; diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 54b3f2f7c..c8a8da5ab 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -397,7 +397,7 @@ void EquipmentWindow::updatePage() mRedraw = true; } -Item *EquipmentWindow::getItem(const int x, const int y) const +const Item *EquipmentWindow::getItem(const int x, const int y) const { if (!mEquipment) return nullptr; @@ -469,7 +469,7 @@ void EquipmentWindow::mousePressed(MouseEvent& event) } else if (event.getButton() == MouseButton::RIGHT) { - if (Item *const item = getItem(x, y)) + if (const Item *const item = getItem(x, y)) { if (itemPopup) itemPopup->setVisible(Visible_false); diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index 2e901fd0e..5836b0986 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -98,7 +98,7 @@ class EquipmentWindow final : public Window, static void prepareSlotNames(); private: - Item *getItem(const int x, const int y) const A_WARN_UNUSED; + const Item *getItem(const int x, const int y) const A_WARN_UNUSED; void setSelected(const int index); -- cgit v1.2.3-70-g09d2