From aac2975ea79f75c403cf31ff37ac15c6ba601782 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Oct 2013 00:40:44 +0300 Subject: move virtual member calls from desktop constuctor into postInit. --- src/client.cpp | 1 + src/gui/widgets/desktop.cpp | 6 +++++- src/gui/widgets/desktop.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client.cpp b/src/client.cpp index a3d07440a..09355f958 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1095,6 +1095,7 @@ int Client::gameExec() break; mDesktop = new Desktop(nullptr); + mDesktop->postInit(); top->add(mDesktop); int x = top->getWidth() - mButtonPadding; ADDBUTTON(mSetupButton, new Button(mDesktop, diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index 07a49c420..9bbe91cbb 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -57,7 +57,6 @@ Desktop::Desktop(const Widget2 *const widget) : } mVersionLabel->setBackgroundColor(getThemeColor(Theme::BACKGROUND, 128)); - add(mVersionLabel, 25, 2); } Desktop::~Desktop() @@ -69,6 +68,11 @@ Desktop::~Desktop() } } +void Desktop::postInit() +{ + add(mVersionLabel, 25, 2); +} + void Desktop::reloadWallpaper() { Wallpaper::loadWallpapers(); diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h index d0a853efb..3d7c6bdf5 100644 --- a/src/gui/widgets/desktop.h +++ b/src/gui/widgets/desktop.h @@ -62,6 +62,8 @@ class Desktop final : public Container, private gcn::WidgetListener void draw(gcn::Graphics *graphics) override; + void postInit(); + private: void setBestFittingWallpaper(); -- cgit v1.2.3-70-g09d2