summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-15 19:46:48 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-15 23:35:48 +0300
commit243932ef169949917f17d3107e00f97886da0a14 (patch)
tree8f11d6e99b250ff480a32b04ea3bbb0ce9bc7f14
parent3658d5a5564db6f0854ec9378c485aef8acc8992 (diff)
downloadmanaplus-243932ef169949917f17d3107e00f97886da0a14.tar.gz
manaplus-243932ef169949917f17d3107e00f97886da0a14.tar.bz2
manaplus-243932ef169949917f17d3107e00f97886da0a14.tar.xz
manaplus-243932ef169949917f17d3107e00f97886da0a14.zip
Fix code style.
-rw-r--r--src/being/being.cpp6
-rw-r--r--src/being/localplayer.cpp4
-rw-r--r--src/being/localplayer.h4
-rw-r--r--src/dropshortcut.cpp1
-rw-r--r--src/dropshortcut.h2
-rw-r--r--src/eventsmanager.cpp6
-rw-r--r--src/game.cpp1
-rw-r--r--src/gui/widgets/avatarlistbox.cpp13
-rw-r--r--src/gui/widgets/setupbuttonitem.cpp2
-rw-r--r--src/gui/widgets/setupbuttonitem.h12
-rw-r--r--src/gui/widgets/tabs/setup_other.cpp1
-rw-r--r--src/listeners/uploadlistener.cpp1
-rw-r--r--src/shortcutbase.h4
13 files changed, 28 insertions, 29 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index a47738868..8baab8a44 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2911,6 +2911,12 @@ std::string Being::loadComment(const std::string &name,
case ActorType::NPC:
str = settings.npcsDir;
break;
+ case ActorType::UNKNOWN:
+ case ActorType::MONSTER:
+ case ActorType::FLOOR_ITEM:
+ case ActorType::PORTAL:
+ case ActorType::PET:
+ case ActorType::AVATAR:
default:
return "";
}
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index bc1cf5bd5..7c07e57cb 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -2463,7 +2463,7 @@ void LocalPlayer::tryPingRequest()
}
-void LocalPlayer::setAway(const std::string &message)
+void LocalPlayer::setAway(const std::string &message) const
{
setAfkMessage(message);
GameModifiers::changeAwayMode();
@@ -2487,7 +2487,7 @@ void LocalPlayer::setAfkMessage(std::string message)
}
}
-void LocalPlayer::setPseudoAway(const std::string &message)
+void LocalPlayer::setPseudoAway(const std::string &message) const
{
setAfkMessage(message);
settings.pseudoAwayMode = !settings.pseudoAwayMode;
diff --git a/src/being/localplayer.h b/src/being/localplayer.h
index e6b7a99d2..71c80de8b 100644
--- a/src/being/localplayer.h
+++ b/src/being/localplayer.h
@@ -230,9 +230,9 @@ class LocalPlayer final : public Being,
void pingResponse();
- void setAway(const std::string &message);
+ void setAway(const std::string &message) const;
- void setPseudoAway(const std::string &message);
+ void setPseudoAway(const std::string &message) const;
void setHalfAway(const bool n)
{ mInactive = n; }
diff --git a/src/dropshortcut.cpp b/src/dropshortcut.cpp
index 5f9492b7b..70e100029 100644
--- a/src/dropshortcut.cpp
+++ b/src/dropshortcut.cpp
@@ -22,7 +22,6 @@
#include "dropshortcut.h"
-#include "configuration.h"
#include "inventory.h"
#include "item.h"
#include "settings.h"
diff --git a/src/dropshortcut.h b/src/dropshortcut.h
index 5b2080b7f..4e0c92870 100644
--- a/src/dropshortcut.h
+++ b/src/dropshortcut.h
@@ -27,8 +27,6 @@
#include "localconsts.h"
-class Item;
-
/**
* The class which keeps track of the item shortcuts.
*/
diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp
index b79c382b8..37baa084e 100644
--- a/src/eventsmanager.cpp
+++ b/src/eventsmanager.cpp
@@ -212,8 +212,10 @@ void EventsManager::logEvent(const SDL_Event &event)
break
case SDL_MOUSEMOTION:
- logger->log("event: SDL_MOUSEMOTION: %u,%u,%u",
- event.motion.state, event.motion.x, event.motion.y);
+ logger->log("event: SDL_MOUSEMOTION: %u,%d,%d",
+ event.motion.state,
+ static_cast<int>(event.motion.x),
+ static_cast<int>(event.motion.y));
break;
case SDL_FINGERDOWN:
{
diff --git a/src/game.cpp b/src/game.cpp
index bca5813c1..ea006cefc 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -28,7 +28,6 @@
#include "auctionmanager.h"
#include "animatedsprite.h"
#include "client.h"
-#include "commandhandler.h"
#include "configuration.h"
#include "effectmanager.h"
#include "emoteshortcut.h"
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 36c6592fd..4968393b2 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -425,6 +425,19 @@ void AvatarListBox::mousePressed(MouseEvent &event)
popupManager->showPickupItemPopup(name);
break;
}
+ case MapItemType::HOME:
+ case MapItemType::ROAD:
+ case MapItemType::CROSS:
+ case MapItemType::ARROW_UP:
+ case MapItemType::ARROW_DOWN:
+ case MapItemType::ARROW_LEFT:
+ case MapItemType::ARROW_RIGHT:
+ case MapItemType::PORTAL:
+ case MapItemType::MUSIC:
+ case MapItemType::SEPARATOR:
+ {
+ break;
+ }
default:
{
const Map *const map = viewport->getMap();
diff --git a/src/gui/widgets/setupbuttonitem.cpp b/src/gui/widgets/setupbuttonitem.cpp
index ad2c6548b..7551adaf6 100644
--- a/src/gui/widgets/setupbuttonitem.cpp
+++ b/src/gui/widgets/setupbuttonitem.cpp
@@ -26,8 +26,6 @@
#include "gui/widgets/tabs/setuptabscroll.h"
-#include "utils/mathutils.h"
-
#include "debug.h"
SetupButtonItem::SetupButtonItem(const std::string &restrict text,
diff --git a/src/gui/widgets/setupbuttonitem.h b/src/gui/widgets/setupbuttonitem.h
index 9e9a7837b..0909f4056 100644
--- a/src/gui/widgets/setupbuttonitem.h
+++ b/src/gui/widgets/setupbuttonitem.h
@@ -23,21 +23,9 @@
#include "gui/widgets/setupitem.h"
-#include "listeners/actionlistener.h"
-
class Button;
-class CheckBox;
-class Configuration;
-class DropDown;
-class EditDialog;
class HorizontContainer;
-class IntTextField;
-class Label;
-class ListModel;
class SetupTabScroll;
-class Slider;
-class SliderList;
-class TextField;
class SetupButtonItem final : public SetupItem
{
diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp
index a3a939489..2c62e179c 100644
--- a/src/gui/widgets/tabs/setup_other.cpp
+++ b/src/gui/widgets/tabs/setup_other.cpp
@@ -27,7 +27,6 @@
#include "gui/widgets/containerplacer.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/setupbuttonitem.h"
-#include "gui/widgets/setupitem.h"
#include "gui/widgets/scrollarea.h"
#include "listeners/uploadlistener.h"
diff --git a/src/listeners/uploadlistener.cpp b/src/listeners/uploadlistener.cpp
index cf4f325dd..0403d9af0 100644
--- a/src/listeners/uploadlistener.cpp
+++ b/src/listeners/uploadlistener.cpp
@@ -22,7 +22,6 @@
#include "commandhandler.h"
#include "commands.h"
-#include "logger.h"
#include "debug.h"
diff --git a/src/shortcutbase.h b/src/shortcutbase.h
index 50ea8a2ce..ffabed39f 100644
--- a/src/shortcutbase.h
+++ b/src/shortcutbase.h
@@ -73,7 +73,7 @@ class ShortcutBase notfinal
/**
* Returns the amount of shortcut items.
*/
- int getItemCount() A_WARN_UNUSED
+ int getItemCount() const A_WARN_UNUSED
{ return mMaxSize; }
/**
@@ -131,8 +131,6 @@ class ShortcutBase notfinal
int mItemSelected;
int mMaxSize;
unsigned char mItemColorSelected;
-
- int mLastDropIndex;
};
#endif // SHORTCUTBASE_H