From 1d22b74180777745a27e7ddbd3006c950063cf41 Mon Sep 17 00:00:00 2001 From: gustav_b Date: Fri, 7 Dec 2007 01:41:04 +0000 Subject: Rework dialog management. Use singleton behavior for dialogs when started in floating dialogs mode and use one dialog/desktop behavior when started in dockable dialogs mode. Replace the panels use of the SP_ACTIVE_DESKTOP macro and unify the panels' handling of desktop activation events. (bzr r4188) --- src/dialogs/iconpreview.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/dialogs/iconpreview.cpp') diff --git a/src/dialogs/iconpreview.cpp b/src/dialogs/iconpreview.cpp index c36414705..e61b7d7f9 100644 --- a/src/dialogs/iconpreview.cpp +++ b/src/dialogs/iconpreview.cpp @@ -47,18 +47,14 @@ namespace UI { namespace Dialogs { -IconPreviewPanel* IconPreviewPanel::instance = 0; - IconPreviewPanel& IconPreviewPanel::getInstance() { - if ( !instance ) { - instance = new IconPreviewPanel(); - } + IconPreviewPanel &instance = *new IconPreviewPanel(); - instance->refreshPreview(); + instance.refreshPreview(); - return *instance; + return instance; } //######################################################################### @@ -214,7 +210,7 @@ IconPreviewPanel::IconPreviewPanel() : void IconPreviewPanel::refreshPreview() { - SPDesktop *desktop = SP_ACTIVE_DESKTOP; + SPDesktop *desktop = getDesktop(); if ( desktop ) { if ( selectionButton && selectionButton->get_active() ) -- cgit v1.2.3