From kde-devel Thu Jan 20 15:54:12 2005 From: Waldo Bastian Date: Thu, 20 Jan 2005 15:54:12 +0000 To: kde-devel Subject: Re: OT: What is the purpose of virtual_hook anyways? Message-Id: <200501201654.12665.bastian () suse ! com> X-MARC-Message: https://marc.info/?l=kde-devel&m=110633959832676 On Thursday 20 January 2005 15:03, Jason Keirstead wrote: > On Thursday 20 January 2005 12:22 am, Thiago Macieira wrote: > > To solve that problem, declaring d to be a const pointer would probably > > help, in most cases. That should be a KDE4 policy, just as having > > d-pointers themselves or virtual hooks. > > BTW, what is the purpose of all those virtual_hook methods? I have never > seen a definition of why these are used, or what purpose they serve - esp. > since most of them are empty. > > Is it also to ensure BC, so that you have a generic entry point of data > into the class, in case you really need it? > > Are there any cases in kdelibs where these methods are in use? Yes, see e.g. hold() in kio/slave.cpp and kio/dataslave.cpp We can't make hold() virtual because it would break BC, so we use the virtual_hook there. Cheers, Waldo -- bastian@kde.org | Free Novell Linux Desktop 9 Evaluation Download bastian@suse.com | http://www.novell.com/products/desktop/eval.html >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<