From c52f13c5f2150e314db0723ba02f447be672e296 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 19 Mar 2002 00:12:36 +0000 Subject: fixed pointer --- src/Toolbar.cc | 19 +++++++++---------- src/Toolbar.hh | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Toolbar.cc b/src/Toolbar.cc index e85f20d..9cf2752 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.12 2002/02/20 23:13:32 fluxgen Exp $ +// $Id: Toolbar.cc,v 1.13 2002/03/19 00:12:36 fluxgen Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library @@ -71,20 +71,20 @@ using namespace std; Toolbar::Toolbar(BScreen *scrn): screen(scrn), image_ctrl(screen->getImageControl()), +clock_timer(this), // get the clock updating every minute iconbar(0) { - fluxbox = Fluxbox::instance(); - - // get the clock updating every minute - clock_timer = new BTimer(fluxbox, this); + fluxbox = Fluxbox::instance(); + + timeval now; gettimeofday(&now, 0); - clock_timer->setTimeout((60 - (now.tv_sec % 60)) * 1000); - clock_timer->start(); + clock_timer.setTimeout((60 - (now.tv_sec % 60)) * 1000); + clock_timer.start(); hide_handler.toolbar = this; - hide_timer = new BTimer(fluxbox, &hide_handler); + hide_timer = new BTimer(&hide_handler); hide_timer->setTimeout(fluxbox->getAutoRaiseDelay()); hide_timer->fireOnce(True); @@ -199,7 +199,6 @@ Toolbar::~Toolbar(void) { XDestroyWindow(display, frame.window); delete hide_timer; - delete clock_timer; delete toolbarmenu; if (iconbar) delete iconbar; @@ -1198,7 +1197,7 @@ void Toolbar::timeout(void) { timeval now; gettimeofday(&now, 0); - clock_timer->setTimeout((60 - (now.tv_sec % 60)) * 1000); + clock_timer.setTimeout((60 - (now.tv_sec % 60)) * 1000); } diff --git a/src/Toolbar.hh b/src/Toolbar.hh index adbe7e3..d2d4016 100644 --- a/src/Toolbar.hh +++ b/src/Toolbar.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.hh,v 1.7 2002/02/17 18:49:02 fluxgen Exp $ +// $Id: Toolbar.hh,v 1.8 2002/03/19 00:12:36 fluxgen Exp $ #ifndef TOOLBAR_HH #define TOOLBAR_HH @@ -99,7 +99,7 @@ private: Fluxbox *fluxbox; BScreen *screen; BImageControl *image_ctrl; - BTimer *clock_timer, *hide_timer; + BTimer clock_timer, *hide_timer; Toolbarmenu *toolbarmenu; class IconBar *iconbar; -- cgit v0.11.2