From 11caa7aeeb3a7b40823da8573576d2354b7504b5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 2 Feb 2014 12:46:32 +0300 Subject: Add missing const and static into gui classes. --- src/gui/widgets/scrollarea.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/gui/widgets/scrollarea.cpp') diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 6d7695198..a260142a1 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -96,23 +96,19 @@ ScrollArea::~ScrollArea() delete getContent(); instances--; - const Theme *const theme = Theme::instance(); - if (theme) + if (instances == 0) { - if (instances == 0) + Theme::unloadRect(background); + Theme::unloadRect(vMarker); + Theme::unloadRect(vMarkerHi); + Theme::unloadRect(vBackground); + Theme::unloadRect(hBackground); + for (int i = 0; i < 2; i ++) { - theme->unloadRect(background); - theme->unloadRect(vMarker); - theme->unloadRect(vMarkerHi); - theme->unloadRect(vBackground); - theme->unloadRect(hBackground); - for (int i = 0; i < 2; i ++) + for (int f = UP; f < BUTTONS_DIR; f ++) { - for (int f = UP; f < BUTTONS_DIR; f ++) - { - if (buttons[f][i]) - buttons[f][i]->decRef(); - } + if (buttons[f][i]) + buttons[f][i]->decRef(); } } } -- cgit v1.2.3-60-g2f50