diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-10 03:29:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-10 03:29:39 +0300 |
commit | 1d3118ec21f537695dc0e6a9608acd67396d0a51 (patch) | |
tree | 5cf9229b2d23f2a7a584b5fed9aaead306df6496 /src | |
parent | dd996d01676d7dca3eec442b14c4966ba0bb0935 (diff) | |
download | manaplus-1d3118ec21f537695dc0e6a9608acd67396d0a51.tar.gz manaplus-1d3118ec21f537695dc0e6a9608acd67396d0a51.tar.bz2 manaplus-1d3118ec21f537695dc0e6a9608acd67396d0a51.tar.xz manaplus-1d3118ec21f537695dc0e6a9608acd67396d0a51.zip |
Delete copy constructor from other classes.
Diffstat (limited to 'src')
43 files changed, 193 insertions, 27 deletions
diff --git a/src/gui/botcheckerwindow.cpp b/src/gui/botcheckerwindow.cpp index 63721c242..6b2e9596a 100644 --- a/src/gui/botcheckerwindow.cpp +++ b/src/gui/botcheckerwindow.cpp @@ -68,6 +68,8 @@ public: playersUpdated(); } + A_DELETE_COPY(UsersTableModel); + virtual ~UsersTableModel() { freeWidgets(); diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index 3307f9b76..24a3f1d8a 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -78,6 +78,8 @@ class CharDeleteConfirm final : public ConfirmDialog { } + A_DELETE_COPY(CharDeleteConfirm); + void action(const gcn::ActionEvent &event) { if (event.getId() == "yes" && mMaster) @@ -96,6 +98,8 @@ class CharacterDisplay final : public Container public: CharacterDisplay(CharSelectDialog *const charSelectDialog); + A_DELETE_COPY(CharacterDisplay); + void setCharacter(Net::Character *const character); Net::Character *getCharacter() const diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 190961839..3be64f3c5 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -86,6 +86,8 @@ class ChatInput final : public TextField, public gcn::FocusListener addFocusListener(this); } + A_DELETE_COPY(ChatInput); + /** * Called if the chat input loses focus. It will set itself to * invisible as result. diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 463ba9803..9f46559e5 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -62,6 +62,8 @@ class GuiConfigListener final : public ConfigListener mGui(g) {} + A_DELETE_COPY(GuiConfigListener); + void optionChanged(const std::string &name) { if (name == "customcursor" && mGui) diff --git a/src/gui/itemamountwindow.cpp b/src/gui/itemamountwindow.cpp index 1751f6043..cfd51f720 100644 --- a/src/gui/itemamountwindow.cpp +++ b/src/gui/itemamountwindow.cpp @@ -78,6 +78,8 @@ public: } } + A_DELETE_COPY(ItemsModal); + virtual ~ItemsModal() { } diff --git a/src/gui/logindialog.cpp b/src/gui/logindialog.cpp index d70e8e4df..cbdc657bb 100644 --- a/src/gui/logindialog.cpp +++ b/src/gui/logindialog.cpp @@ -59,22 +59,27 @@ const char *UPDATE_TYPE_TEXT[3] = class UpdateTypeModel final : public gcn::ListModel { -public: - virtual ~UpdateTypeModel() - { } + public: + UpdateTypeModel() + { } - virtual int getNumberOfElements() - { - return 3; - } + A_DELETE_COPY(UpdateTypeModel); - virtual std::string getElementAt(int i) - { - if (i >= getNumberOfElements() || i < 0) - return _("???"); + virtual ~UpdateTypeModel() + { } - return gettext(UPDATE_TYPE_TEXT[i]); - } + virtual int getNumberOfElements() + { + return 3; + } + + virtual std::string getElementAt(int i) + { + if (i >= getNumberOfElements() || i < 0) + return _("???"); + + return gettext(UPDATE_TYPE_TEXT[i]); + } }; class UpdateListModel final : public gcn::ListModel @@ -86,6 +91,8 @@ class UpdateListModel final : public gcn::ListModel { } + A_DELETE_COPY(UpdateListModel); + virtual ~UpdateListModel() { } diff --git a/src/gui/questswindow.cpp b/src/gui/questswindow.cpp index 3407ba891..6192ab261 100644 --- a/src/gui/questswindow.cpp +++ b/src/gui/questswindow.cpp @@ -80,6 +80,8 @@ class QuestsModel final : public ExtendedNamesModel { } + A_DELETE_COPY(QuestsModel); + virtual ~QuestsModel() { } }; diff --git a/src/gui/setup_input.cpp b/src/gui/setup_input.cpp index 68a14f557..7891560ee 100644 --- a/src/gui/setup_input.cpp +++ b/src/gui/setup_input.cpp @@ -59,6 +59,8 @@ class KeyListModel final : public gcn::ListModel { } + A_DELETE_COPY(KeyListModel); + /** * Returns the number of elements in container. */ diff --git a/src/gui/setup_relations.cpp b/src/gui/setup_relations.cpp index 48271f6b7..d4792f610 100644 --- a/src/gui/setup_relations.cpp +++ b/src/gui/setup_relations.cpp @@ -102,6 +102,8 @@ public: playerRelationsUpdated(); } + A_DELETE_COPY(PlayerTableModel); + virtual ~PlayerTableModel() { freeWidgets(); diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 9c6b3f064..f84500ebb 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -78,6 +78,8 @@ class ModeListModel final : public gcn::ListModel */ ModeListModel(); + A_DELETE_COPY(ModeListModel); + /** * Destructor. */ diff --git a/src/gui/shortcutwindow.cpp b/src/gui/shortcutwindow.cpp index bc8cd5fc1..3186598cb 100644 --- a/src/gui/shortcutwindow.cpp +++ b/src/gui/shortcutwindow.cpp @@ -48,6 +48,8 @@ class ShortcutTab final : public Tab setCaption(name); } + A_DELETE_COPY(ShortcutTab); + ShortcutContainer* mContent; }; diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 78282ec46..1f8378a87 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -99,6 +99,8 @@ class SkillListBox final : public ListBox { } + A_DELETE_COPY(SkillListBox); + ~SkillListBox() { delete mModel; @@ -194,6 +196,8 @@ class SkillTab final : public Tab setCaption(name); } + A_DELETE_COPY(SkillTab); + ~SkillTab() { delete mListBox; diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index 1b1d0e6e8..938817b0d 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -82,6 +82,8 @@ class SortFriendsFunctor final class SocialTab : public Tab { public: + A_DELETE_COPY(SocialTab); + virtual void invite() = 0; virtual void leave() = 0; @@ -153,6 +155,8 @@ public: mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); } + A_DELETE_COPY(SocialGuildTab); + ~SocialGuildTab() { delete mList; @@ -257,6 +261,8 @@ public: mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); } + A_DELETE_COPY(SocialGuildTab2); + ~SocialGuildTab2() { delete mList; @@ -317,6 +323,8 @@ public: mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); } + A_DELETE_COPY(SocialPartyTab); + ~SocialPartyTab() { delete mList; @@ -404,6 +412,8 @@ public: { } + A_DELETE_COPY(BeingsListModal); + ~BeingsListModal() { delete_all(mMembers); @@ -446,6 +456,8 @@ public: setCaption(name); } + A_DELETE_COPY(SocialPlayersTab); + ~SocialPlayersTab() { delete mList; @@ -612,6 +624,8 @@ public: setCaption(_("Nav")); } + A_DELETE_COPY(SocialNavigationTab); + ~SocialNavigationTab() { delete mList; @@ -948,6 +962,8 @@ public: setCaption(_("Atk")); } + A_DELETE_COPY(SocialAttackTab); + ~SocialAttackTab() { delete mList; @@ -1004,6 +1020,8 @@ public: setCaption(_("Pik")); } + A_DELETE_COPY(SocialPickupTab); + ~SocialPickupTab() { delete mList; @@ -1060,6 +1078,8 @@ public: setCaption(name); } + A_DELETE_COPY(SocialFriendsTab); + ~SocialFriendsTab() { delete mList; @@ -1161,6 +1181,8 @@ public: mBrowserBox->getHeight() + 8); } + A_DELETE_COPY(CreatePopup); + void handleLink(const std::string &link, gcn::MouseEvent *event A_UNUSED) { if (link == "guild" && socialWindow) diff --git a/src/gui/specialswindow.cpp b/src/gui/specialswindow.cpp index 0fed5da50..60753aa54 100644 --- a/src/gui/specialswindow.cpp +++ b/src/gui/specialswindow.cpp @@ -58,6 +58,8 @@ class SpecialEntry final : public Container public: SpecialEntry(SpecialInfo *info); + A_DELETE_COPY(SpecialEntry); + void update(int current, int needed); protected: diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 08efc3efa..4f287f8c2 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -61,6 +61,8 @@ class AttrDisplay : public Container UNKNOWN }; + A_DELETE_COPY(AttrDisplay); + ~AttrDisplay(); virtual std::string update(); @@ -92,6 +94,8 @@ class DerDisplay final : public AttrDisplay public: DerDisplay(const int id, const std::string &name); + A_DELETE_COPY(DerDisplay); + virtual Type getType() const { return DERIVED; } }; @@ -101,6 +105,8 @@ class ChangeDisplay final : public AttrDisplay, gcn::ActionListener public: ChangeDisplay(const int id, const std::string &name); + A_DELETE_COPY(ChangeDisplay); + std::string update(); virtual Type getType() const diff --git a/src/gui/textcommandeditor.cpp b/src/gui/textcommandeditor.cpp index 79fcd17b4..2a2c2f218 100644 --- a/src/gui/textcommandeditor.cpp +++ b/src/gui/textcommandeditor.cpp @@ -83,6 +83,8 @@ public: } } + A_DELETE_COPY(IconsModal); + virtual ~IconsModal() { } diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index 7005386b6..d00ff287b 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -45,6 +45,8 @@ public: GuiTableActionListener(GuiTable *_table, gcn::Widget *_widget, int _row, int _column); + A_DELETE_COPY(GuiTableActionListener); + virtual ~GuiTableActionListener(); virtual void action(const gcn::ActionEvent& actionEvent); diff --git a/src/gui/worldselectdialog.cpp b/src/gui/worldselectdialog.cpp index 7e77ffc6d..d6e1abfb2 100644 --- a/src/gui/worldselectdialog.cpp +++ b/src/gui/worldselectdialog.cpp @@ -54,6 +54,8 @@ class WorldListModel final : public gcn::ListModel { } + A_DELETE_COPY(WorldListModel); + virtual ~WorldListModel() { } diff --git a/src/resources/action.h b/src/resources/action.h index dbb572ef3..4cfb498f1 100644 --- a/src/resources/action.h +++ b/src/resources/action.h @@ -37,6 +37,8 @@ class Action final public: Action(); + A_DELETE_COPY(Action); + ~Action(); void setAnimation(const int direction, Animation *const animation); diff --git a/src/resources/ambientlayer.h b/src/resources/ambientlayer.h index 09767a472..6c051774e 100644 --- a/src/resources/ambientlayer.h +++ b/src/resources/ambientlayer.h @@ -44,6 +44,8 @@ class AmbientLayer final const float speedX, const float speedY, const bool keepRatio = false); + A_DELETE_COPY(AmbientLayer); + ~AmbientLayer(); void update(const int timePassed, const float dx, const float dy); diff --git a/src/resources/animation.h b/src/resources/animation.h index 55db8b717..dd5421735 100644 --- a/src/resources/animation.h +++ b/src/resources/animation.h @@ -43,6 +43,7 @@ struct Frame final LABEL, PAUSE }; + Image *image; int delay; int offsetX; diff --git a/src/resources/atlasmanager.h b/src/resources/atlasmanager.h index 1606fc4c9..4976185a7 100644 --- a/src/resources/atlasmanager.h +++ b/src/resources/atlasmanager.h @@ -42,6 +42,8 @@ struct AtlasItem { } + A_DELETE_COPY(AtlasItem); + Image *image; std::string name; int x; @@ -60,6 +62,8 @@ struct TextureAtlas { } + A_DELETE_COPY(TextureAtlas); + std::string name; Image *atlasImage; SDL_Surface *surface; @@ -71,6 +75,11 @@ struct TextureAtlas class AtlasResource : public Resource { public: + AtlasResource() + { } + + A_DELETE_COPY(AtlasResource); + ~AtlasResource(); void incRef(); @@ -85,6 +94,8 @@ class AtlasManager public: AtlasManager(); + A_DELETE_COPY(AtlasManager); + static AtlasResource *loadTextureAtlas(const std::string &name, const StringVect &files); diff --git a/src/resources/beinginfo.h b/src/resources/beinginfo.h index 208fcd541..f5e9650c1 100644 --- a/src/resources/beinginfo.h +++ b/src/resources/beinginfo.h @@ -48,6 +48,8 @@ struct Attack final mMissileParticle(missileParticle) { } + + A_DELETE_COPY(Attack); }; typedef std::map<int, Attack*> Attacks; @@ -81,6 +83,8 @@ class BeingInfo final BeingInfo(); + A_DELETE_COPY(BeingInfo); + ~BeingInfo(); void setName(const std::string &name) diff --git a/src/resources/dye.h b/src/resources/dye.h index 1655ce051..0795f1276 100644 --- a/src/resources/dye.h +++ b/src/resources/dye.h @@ -47,6 +47,8 @@ class DyePalette final */ DyePalette(const std::string &pallete, const int8_t blockSize); + A_DELETE_COPY(DyePalette); + /** * Gets a pixel color depending on its intensity. First color is * implicitly black (0, 0, 0). @@ -102,6 +104,8 @@ class Dye final */ Dye(const std::string &dye); + A_DELETE_COPY(Dye); + /** * Destroys the associated palettes. */ diff --git a/src/resources/emotedb.h b/src/resources/emotedb.h index bb4fbc4f5..e2d621a7f 100644 --- a/src/resources/emotedb.h +++ b/src/resources/emotedb.h @@ -33,12 +33,22 @@ class AnimatedSprite; struct EmoteSprite final { + EmoteSprite() + { } + + A_DELETE_COPY(EmoteSprite); + const AnimatedSprite *sprite; std::string name; }; struct EmoteInfo final { + EmoteInfo() + { } + + A_DELETE_COPY(EmoteInfo); + std::list<EmoteSprite*> sprites; StringVect particles; }; diff --git a/src/resources/image.h b/src/resources/image.h index 26498e988..160adcba3 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -65,6 +65,8 @@ class Image : public Resource #endif public: + A_DELETE_COPY(Image); + /** * Destructor. */ diff --git a/src/resources/imagehelper.h b/src/resources/imagehelper.h index fdda3b00f..ddd4ace97 100644 --- a/src/resources/imagehelper.h +++ b/src/resources/imagehelper.h @@ -43,6 +43,11 @@ class ImageHelper friend class Image; public: + ImageHelper() + { } + + A_DELETE_COPY(ImageHelper); + virtual ~ImageHelper() { } diff --git a/src/resources/imageset.h b/src/resources/imageset.h index 4ff138d7f..35a429329 100644 --- a/src/resources/imageset.h +++ b/src/resources/imageset.h @@ -27,6 +27,8 @@ #include <vector> +#include "localconsts.h" + class Image; /** @@ -41,6 +43,8 @@ class ImageSet : public Resource ImageSet(Image *const img, const int w, const int h, const int margin = 0, const int spacing = 0); + A_DELETE_COPY(ImageSet); + /** * Destructor. */ diff --git a/src/resources/music.h b/src/resources/music.h index e002f6b2f..96ad32981 100644 --- a/src/resources/music.h +++ b/src/resources/music.h @@ -35,6 +35,11 @@ class Music final : public Resource { public: + Music() + { } + + A_DELETE_COPY(Music); + /** * Destructor. */ diff --git a/src/resources/openglimagehelper.h b/src/resources/openglimagehelper.h index e5c0cab5e..75a6c52ad 100644 --- a/src/resources/openglimagehelper.h +++ b/src/resources/openglimagehelper.h @@ -49,6 +49,12 @@ class OpenGLImageHelper final : public ImageHelper friend class Image; public: + OpenGLImageHelper() + { + } + + A_DELETE_COPY(OpenGLImageHelper); + virtual ~OpenGLImageHelper() { } diff --git a/src/resources/resource.h b/src/resources/resource.h index d9b220338..4df9b47a0 100644 --- a/src/resources/resource.h +++ b/src/resources/resource.h @@ -28,6 +28,8 @@ #include <ctime> #include <string> +#include "localconsts.h" + /** * A generic reference counted resource object. */ @@ -49,6 +51,8 @@ class Resource { } + A_DELETE_COPY(Resource); + /** * Increments the internal reference count. */ diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index 80461ce19..dcd909aa7 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -62,6 +62,8 @@ class ResourceManager final ResourceManager(); + A_DELETE_COPY(ResourceManager); + /** * Destructor. Cleans up remaining resources, warning about resources * that were still referenced. diff --git a/src/resources/sdlimagehelper.h b/src/resources/sdlimagehelper.h index 6884af28d..3c790e7b7 100644 --- a/src/resources/sdlimagehelper.h +++ b/src/resources/sdlimagehelper.h @@ -40,6 +40,11 @@ class SDLImageHelper final : public ImageHelper friend class Image; public: + SDLImageHelper() + { } + + A_DELETE_COPY(SDLImageHelper); + virtual ~SDLImageHelper() { } diff --git a/src/resources/soundeffect.h b/src/resources/soundeffect.h index 6900669c9..229977c2a 100644 --- a/src/resources/soundeffect.h +++ b/src/resources/soundeffect.h @@ -35,6 +35,8 @@ class SoundEffect final : public Resource { public: + A_DELETE_COPY(SoundEffect); + /** * Destructor. */ diff --git a/src/resources/specialdb.h b/src/resources/specialdb.h index 1fa11df9e..d478f654b 100644 --- a/src/resources/specialdb.h +++ b/src/resources/specialdb.h @@ -27,6 +27,11 @@ struct SpecialInfo final { + SpecialInfo() + { } + + A_DELETE_COPY(SpecialInfo); + enum TargetMode { TARGET_SELF = 0, // no target selection diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index bc4f13a13..09e5171e4 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -49,6 +49,8 @@ struct SpriteReference final { } + A_DELETE_COPY(SpriteReference); + std::string sprite; int variant; }; @@ -110,6 +112,8 @@ enum SpriteDirection class SpriteDef final : public Resource { public: + A_DELETE_COPY(SpriteDef); + /** * Loads a sprite definition file. */ diff --git a/src/resources/subimage.h b/src/resources/subimage.h index 719b9f4c1..c30b39177 100644 --- a/src/resources/subimage.h +++ b/src/resources/subimage.h @@ -59,6 +59,8 @@ class SubImage final : public Image const int texWidth, const int textHeight); #endif + A_DELETE_COPY(SubImage); + /** * Destructor. */ diff --git a/src/test/testlauncher.h b/src/test/testlauncher.h index baa20c921..8bb7c99f0 100644 --- a/src/test/testlauncher.h +++ b/src/test/testlauncher.h @@ -29,11 +29,15 @@ #include <string> #include <sys/time.h> +#include "localconsts.h" + class TestLauncher { public: TestLauncher(std::string test); + A_DELETE_COPY(TestLauncher); + ~TestLauncher(); int exec(); diff --git a/src/test/testmain.h b/src/test/testmain.h index 69d2b8f77..e38639126 100644 --- a/src/test/testmain.h +++ b/src/test/testmain.h @@ -34,6 +34,8 @@ class TestMain public: TestMain(); + A_DELETE_COPY(TestMain); + int exec(const bool testAudio = true); static int readValue(const int ver, int def); diff --git a/src/utils/mutex.h b/src/utils/mutex.h index fe560e354..3ea607029 100644 --- a/src/utils/mutex.h +++ b/src/utils/mutex.h @@ -33,18 +33,22 @@ */ class Mutex { -public: - Mutex(); - ~Mutex(); + public: + Mutex(); - void lock(); - void unlock(); + A_DELETE_COPY(Mutex); -private: - Mutex(const Mutex&); // prevent copying - Mutex& operator=(const Mutex&); + ~Mutex(); - SDL_mutex *mMutex; + void lock(); + + void unlock(); + + private: +// Mutex(const Mutex&); // prevent copying +// Mutex& operator=(const Mutex&); + + SDL_mutex *mMutex; }; /** @@ -52,12 +56,13 @@ private: */ class MutexLocker { -public: - MutexLocker(Mutex *mutex); - ~MutexLocker(); + public: + MutexLocker(Mutex *mutex); + + ~MutexLocker(); -private: - Mutex *mMutex; + private: + Mutex *mMutex; }; diff --git a/src/utils/translation/podict.h b/src/utils/translation/podict.h index 4a62c6da8..d1f0a9677 100644 --- a/src/utils/translation/podict.h +++ b/src/utils/translation/podict.h @@ -33,6 +33,8 @@ class PoDict final public: PoDict(std::string lang); + A_DELETE_COPY(PoDict); + ~PoDict(); const std::string getStr(const std::string &str); diff --git a/src/utils/translation/poparser.h b/src/utils/translation/poparser.h index 274591d3b..a0ffc2669 100644 --- a/src/utils/translation/poparser.h +++ b/src/utils/translation/poparser.h @@ -33,6 +33,8 @@ class PoParser final public: PoParser(); + A_DELETE_COPY(PoParser); + PoDict *load(const std::string &lang, const std::string &fileName = "", PoDict *const dict = nullptr); diff --git a/src/utils/xml.h b/src/utils/xml.h index ad54f4b28..4889c4a1f 100644 --- a/src/utils/xml.h +++ b/src/utils/xml.h @@ -76,6 +76,8 @@ namespace XML */ Document(const char *const data, const int size); + A_DELETE_COPY(Document); + /** * Destructor. Frees the loaded XML file. */ |