From d16122cae03202761d75384388f52ca084f91ea4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 14 Mar 2017 18:47:16 +0300 Subject: Fix shadow variables in PopupMenu and Desktop. --- src/gui/popups/popupmenu.cpp | 34 +++++++++++++++++----------------- src/gui/popups/popupmenu.h | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/gui/popups') diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 846c29174..913ebdeba 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -115,7 +115,7 @@ PopupMenu::PopupMenu() : mMapItem(nullptr), mTab(nullptr), mSpell(nullptr), - mWindow(nullptr), + mCallerWindow(nullptr), mRenameListener(), mPlayerListener(), mDialog(nullptr), @@ -733,7 +733,7 @@ void PopupMenu::showMapPopup(const int x, const int y, mY = y2; if (isMinimap) - mWindow = minimap; + mCallerWindow = minimap; mBrowserBox->clearRows(); @@ -776,7 +776,7 @@ void PopupMenu::showOutfitsWindowPopup(const int x, const int y) { mX = x; mY = y; - mWindow = outfitWindow; + mCallerWindow = outfitWindow; mBrowserBox->clearRows(); @@ -838,7 +838,7 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab) mTab = tab; mX = x; mY = y; - mWindow = chatWindow; + mCallerWindow = chatWindow; mBrowserBox->clearRows(); @@ -1078,7 +1078,7 @@ void PopupMenu::showWindowPopup(Window *const window) return; setMousePos(); - mWindow = window; + mCallerWindow = window; mBrowserBox->clearRows(); // TRANSLATORS: popup menu header mBrowserBox->addRow(_("window")); @@ -1478,20 +1478,20 @@ void PopupMenu::handleLink(const std::string &link, showPlayerMenu(); return; } - else if (link == "window close" && mWindow) + else if (link == "window close" && mCallerWindow) { - if (Widget::widgetExists(mWindow)) - mWindow->close(); + if (Widget::widgetExists(mCallerWindow)) + mCallerWindow->close(); } - else if (link == "window unlock" && mWindow) + else if (link == "window unlock" && mCallerWindow) { - if (Widget::widgetExists(mWindow)) - mWindow->setSticky(false); + if (Widget::widgetExists(mCallerWindow)) + mCallerWindow->setSticky(false); } - else if (link == "window lock" && mWindow) + else if (link == "window lock" && mCallerWindow) { - if (Widget::widgetExists(mWindow)) - mWindow->setSticky(true); + if (Widget::widgetExists(mCallerWindow)) + mCallerWindow->setSticky(true); } else if (link == "join chat" && being) { @@ -1715,7 +1715,7 @@ void PopupMenu::handleLink(const std::string &link, mMapItem = nullptr; mTab = nullptr; mSpell = nullptr; - mWindow = nullptr; + mCallerWindow = nullptr; mDialog = nullptr; mButton = nullptr; mName.clear(); @@ -1740,7 +1740,7 @@ void PopupMenu::showPopup(Window *const parent, for (int f = 0; f < maxCards; f ++) mItemCards[f] = item->getCard(f); mItemColor = item->getColor(); - mWindow = parent; + mCallerWindow = parent; mX = x; mY = y; mName.clear(); @@ -2876,7 +2876,7 @@ void PopupMenu::clear() mMapItem = nullptr; mTab = nullptr; mSpell = nullptr; - mWindow = nullptr; + mCallerWindow = nullptr; mButton = nullptr; mTextField = nullptr; } diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h index c42976359..539424592 100644 --- a/src/gui/popups/popupmenu.h +++ b/src/gui/popups/popupmenu.h @@ -280,7 +280,7 @@ class PopupMenu final : public Popup, public LinkHandler MapItem *mMapItem; ChatTab *mTab; TextCommand *mSpell; - Window *mWindow; + Window *mCallerWindow; RenameListener mRenameListener; PlayerListener mPlayerListener; TextDialog *mDialog; -- cgit v1.2.3-70-g09d2