[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [PATCH] Configure toolbars from RMB switch to the current
From: David Faure <faure () kde ! org>
Date: 2004-04-28 18:47:25
Message-ID: 200404282047.25874.faure () kde ! org
[Download RAW message or body]
On Wednesday 28 April 2004 20:35, Andras Mantia wrote:
> Hi,
>
> Here is the (1st version of the) patch to implement what I was talking
> about earlier today. I read the BC document and it is written there
> that introducing static member variables is possible, but I got linking
> errors in the kdeui if I made m_defaultToolbar a static member
> variable
That's because you forgot to instanciate it in kedittoolbar.cpp ...
> so now it is a (static) global one. I've tested with KMail
> and Konqueror and works fine (without recompiling the apps).
Static objects in libraries are a very bad idea (destruction order not defined, etc.).
This is about storing a const char* anyway (an object's name), not a QString.
How about a class-static "const char* s_toolbarName;"?
You *will* need to instanciate it in the .cpp file, with
const char* KEditToolbar::s_toolbarName = 0;
(e.g. somewhere at the top of the .cpp file)
Make sure you call setDefaultToolbar(0) at the end of the ktoolbar.cpp method,
so that we don't risk keeping a dangling pointer. Once the popupmenu is closed
we don't need this anymore, anyway.
--
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic