diff options
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/popup.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/window.h | 1 |
3 files changed, 4 insertions, 11 deletions
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index 7d73e749..41d60ab6 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -50,7 +50,7 @@ Popup::Popup(const std::string &name, const std::string &skin): setPadding(3); // Loads the skin - mSkin = skinLoader->load(skin, mDefaultSkinPath); + mSkin = SkinLoader::instance()->load(skin, mDefaultSkinPath); // Add this window to the window container windowContainer->add(this); @@ -85,7 +85,7 @@ void Popup::loadPopupConfiguration() if (skinName.compare(mSkin->getFilePath()) != 0) { mSkin->instances--; - mSkin = skinLoader->load(skinName, mDefaultSkinPath); + mSkin = SkinLoader::instance()->load(skinName, mDefaultSkinPath); } } 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) diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index f53bc483..510b0f04 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -34,7 +34,6 @@ class Layout; class LayoutCell; class ResizeGrip; class Skin; -class SkinLoader; class WindowContainer; /** |