diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 22:55:02 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 22:55:02 +0200 |
commit | ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73 (patch) | |
tree | b803ae0a601e46cfa0539f79f76c731dc28652f2 /src/gui/widgets/window.cpp | |
parent | 2a3f16f5673e6482e422a65f6f23f958dd78955f (diff) | |
download | mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.tar.gz mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.tar.bz2 mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.tar.xz mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.zip |
Made the PopupMenu a Popup subclass
It's a natural better fit. The SkinLoader was changed into a singleton,
since it's used by both Window and Popup classes.
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r-- | src/gui/widgets/window.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 1d7961f3..f252c5f6 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -61,9 +61,6 @@ Window::Window(const std::string &caption, bool modal, Window *parent, const std if (!windowContainer) throw GCN_EXCEPTION("Window::Window(): no windowContainer set"); - if (instances == 0) - skinLoader = new SkinLoader; - instances++; setFrameSize(0); @@ -71,7 +68,7 @@ Window::Window(const std::string &caption, bool modal, Window *parent, const std setTitleBarHeight(20); // Loads the skin - mSkin = skinLoader->load(skin, mDefaultSkinPath); + mSkin = SkinLoader::instance()->load(skin, mDefaultSkinPath); // Add this window to the window container windowContainer->add(this); @@ -104,9 +101,6 @@ Window::~Window() instances--; mSkin->instances--; - - if (instances == 0) - delete skinLoader; } void Window::setWindowContainer(WindowContainer *wc) @@ -511,7 +505,7 @@ void Window::loadWindowState() if (skinName.compare(mSkin->getFilePath()) != 0) { mSkin->instances--; - mSkin = skinLoader->load(skinName, mDefaultSkinPath); + mSkin = SkinLoader::instance()->load(skinName, mDefaultSkinPath); } if (mGrip) |