summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-14 16:40:47 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-14 16:40:47 +0300
commitb8b4e4c524331b4deb0a6caa8da004430297c98a (patch)
treea2fd6f1db45e76f08c0e5c1b4e57bbb86efba57b /src/gui/widgets
parentc28cd5ffb1ca37a3a6d5ee0a73828dcd092db7f1 (diff)
downloadmv-b8b4e4c524331b4deb0a6caa8da004430297c98a.tar.gz
mv-b8b4e4c524331b4deb0a6caa8da004430297c98a.tar.bz2
mv-b8b4e4c524331b4deb0a6caa8da004430297c98a.tar.xz
mv-b8b4e4c524331b4deb0a6caa8da004430297c98a.zip
Replace static members usage from pointers to direct classes.
clang-tidy warning: readability-static-accessed-through-instance
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/itemshortcutcontainer.cpp5
-rw-r--r--src/gui/widgets/popup.cpp4
-rw-r--r--src/gui/widgets/tabs/chat/emulateguildtab.cpp10
-rw-r--r--src/gui/widgets/tabs/setup_audio.cpp4
-rw-r--r--src/gui/widgets/tabs/setup_joystick.cpp5
-rw-r--r--src/gui/widgets/tabs/socialnavigationtab.h8
-rw-r--r--src/gui/widgets/window.cpp4
7 files changed, 17 insertions, 23 deletions
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp
index e99230216..9f667caba 100644
--- a/src/gui/widgets/itemshortcutcontainer.cpp
+++ b/src/gui/widgets/itemshortcutcontainer.cpp
@@ -63,10 +63,7 @@ ItemShortcutContainer::ItemShortcutContainer(Widget2 *const widget,
mUnEquipedColor(getThemeColor(ThemeColorId::ITEM_NOT_EQUIPPED)),
mUnEquipedColor2(getThemeColor(ThemeColorId::ITEM_NOT_EQUIPPED_OUTLINE))
{
- if (itemShortcut[mNumber] != nullptr)
- mMaxItems = itemShortcut[mNumber]->getItemCount();
- else
- mMaxItems = 0;
+ mMaxItems = ItemShortcut::getItemCount();
}
ItemShortcutContainer::~ItemShortcutContainer()
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index bf2b2bb83..0f5c5a31a 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -250,8 +250,8 @@ void Popup::mouseMoved(MouseEvent &event A_UNUSED)
{
if (popupManager != nullptr)
{
- popupManager->hideBeingPopup();
- popupManager->hideTextPopup();
+ PopupManager::hideBeingPopup();
+ PopupManager::hideTextPopup();
}
mRedraw = true;
}
diff --git a/src/gui/widgets/tabs/chat/emulateguildtab.cpp b/src/gui/widgets/tabs/chat/emulateguildtab.cpp
index 4374f6b2c..4e94bf11d 100644
--- a/src/gui/widgets/tabs/chat/emulateguildtab.cpp
+++ b/src/gui/widgets/tabs/chat/emulateguildtab.cpp
@@ -56,16 +56,14 @@ EmulateGuildTab::~EmulateGuildTab()
bool EmulateGuildTab::handleCommand(const std::string &restrict type,
const std::string &restrict args)
{
- if (guildManager == nullptr)
- return false;
if (type == "invite")
- guildManager->invite(args);
+ GuildManager::invite(args);
else if (type == "leave")
- guildManager->leave();
+ GuildManager::leave();
else if (type == "kick")
- guildManager->kick(args);
+ GuildManager::kick(args);
else if (type == "notice")
- guildManager->notice(args);
+ GuildManager::notice(args);
else
return false;
diff --git a/src/gui/widgets/tabs/setup_audio.cpp b/src/gui/widgets/tabs/setup_audio.cpp
index 7a37f2d89..bd8097318 100644
--- a/src/gui/widgets/tabs/setup_audio.cpp
+++ b/src/gui/widgets/tabs/setup_audio.cpp
@@ -72,14 +72,14 @@ Setup_Audio::Setup_Audio(const Widget2 *const widget) :
// TRANSLATORS: settings option
new SetupItemSlider(_("Sfx volume"), "", "sfxVolume",
- this, "sfxVolumeEvent", 0, soundManager.getMaxVolume(), 1,
+ this, "sfxVolumeEvent", 0, SoundManager::getMaxVolume(), 1,
150,
OnTheFly_true,
MainConfig_true);
// TRANSLATORS: settings option
new SetupItemSlider(_("Music volume"), "", "musicVolume",
- this, "musicVolumeEvent", 0, soundManager.getMaxVolume(), 1,
+ this, "musicVolumeEvent", 0, SoundManager::getMaxVolume(), 1,
150,
OnTheFly_true,
MainConfig_true);
diff --git a/src/gui/widgets/tabs/setup_joystick.cpp b/src/gui/widgets/tabs/setup_joystick.cpp
index 490205b4b..84cd60521 100644
--- a/src/gui/widgets/tabs/setup_joystick.cpp
+++ b/src/gui/widgets/tabs/setup_joystick.cpp
@@ -164,8 +164,7 @@ void Setup_Joystick::setTempEnabled(const bool sel)
void Setup_Joystick::cancel()
{
- if (joystick != nullptr)
- joystick->setEnabled(mOriginalJoystickEnabled);
+ Joystick::setEnabled(mOriginalJoystickEnabled);
if (mOriginalJoystickEnabled != mJoystickEnabled->isSelected())
setTempEnabled(mOriginalJoystickEnabled);
@@ -178,7 +177,7 @@ void Setup_Joystick::apply()
if (joystick == nullptr)
return;
- config.setValue("joystickEnabled", joystick->isEnabled());
+ config.setValue("joystickEnabled", Joystick::isEnabled());
config.setValue("useInactiveJoystick", mUseInactiveCheckBox->isSelected());
joystick->setUseInactive(mUseInactiveCheckBox->isSelected());
diff --git a/src/gui/widgets/tabs/socialnavigationtab.h b/src/gui/widgets/tabs/socialnavigationtab.h
index 3bd584991..1b049f055 100644
--- a/src/gui/widgets/tabs/socialnavigationtab.h
+++ b/src/gui/widgets/tabs/socialnavigationtab.h
@@ -136,8 +136,8 @@ class SocialNavigationTab final : public SocialTab
->findPortalByTile(x, y);
if (being != nullptr)
{
- being->setName(keyboard.getKeyShortString(
- outfitWindow->keyName(idx)));
+ being->setName(KeyboardConfig::getKeyShortString(
+ OutfitWindow::keyName(idx)));
}
if (specialLayer != nullptr)
@@ -146,8 +146,8 @@ class SocialNavigationTab final : public SocialTab
ava->getX(), ava->getY());
if (portal != nullptr)
{
- portal->setName(keyboard.getKeyShortString(
- outfitWindow->keyName(idx)));
+ portal->setName(KeyboardConfig::getKeyShortString(
+ OutfitWindow::keyName(idx)));
}
}
}
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 5d48cfad3..9d9385f8d 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -958,8 +958,8 @@ void Window::mouseMoved(MouseEvent &event)
updateResizeHandler(event);
if ((popupManager != nullptr) && !event.isConsumed())
{
- popupManager->hideBeingPopup();
- popupManager->hideTextPopup();
+ PopupManager::hideBeingPopup();
+ PopupManager::hideTextPopup();
}
}