Closed Bug 290043 Opened 19 years ago Closed 19 years ago

Tidy address book code (nsIAddrDBAnnouncer and nsIAddrDBListener)

Categories

(SeaMonkey :: MailNews: Address Book & Contacts, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
seamonkey1.0alpha

People

(Reporter: standard8, Assigned: standard8)

Details

Attachments

(1 file)

One of the bugs I am working on has caused me to look at nsIAddrDBAnnouncer and 
nsIAddrDBListener, as it may require me to pass round a parent directory via 
those mechanisms.

However, in looking at these, I realised that the "instigator" parameter passed 
round in the functions, is nearly always null (except for onAnnouncerGoingAway) 
and is never used in any case.

LXR Links:
http://lxr.mozilla.org/seamonkey/source/mailnews/addrbook/public/nsIAddrDBAnnoun
cer.idl#44
http://lxr.mozilla.org/mozilla/source/mailnews/addrbook/public/nsIAddrDBListener
.idl#44

Looking at CVS Blame, the parameters were present from the first check-in and 
never used.

Also, nsAbRDFResource.h and .cpp are never used, although nsAbRDFDataSource.h 
and .cpp are.

nsAbRDFResource.h/.cpp seem to have been renamed (to nsAbMDBRDFResource) in Bug 
69480 and later nsAbMDBRDFResource was removed altogether.

Therefore I propose

1) to remove the instigator parameter from the announcer and listener classes 
(and derived)

2) to remove nsAbRDFResource.h/.cpp from cvs

if anyone knows a reason or objection as to why I should not, please post here 
and I can re-consider. I'll be looking at implementing it in the next couple of 
weeks.
Status: UNCONFIRMED → NEW
Ever confirmed: true
This patch removes the instigator parameters that are never used (all bar one
was always nsnull). I'd also like approval to remove nsAbRDFResource.h/.cpp
from cvs as they are not part of the build.

I have tested the changes on both suite & tb, and also done a check via lxr to
ensure weren't using any of the functions in js.
Attachment #182011 - Flags: review?(bienvenu)
Comment on attachment 182011 [details] [diff] [review]
Remove unused parameters

yes, the original AB implementer copied the instigator stuff from the msg db
code. There, the idea was to avoid getting circular notifications, though I
don't remember if it turned out to be used even there...
Attachment #182011 - Flags: review?(bienvenu) → review+
Comment on attachment 182011 [details] [diff] [review]
Remove unused parameters

Requesting sr. Scott, please also confirm your approval for the files
nsAbRDFResource.h/.cpp in mailnews/addressbook/src/ to be removed as they are
no longer used.
Attachment #182011 - Flags: superreview?(mscott)
Status: NEW → ASSIGNED
Attachment #182011 - Flags: superreview?(mscott) → superreview+
i concurr that nsAbRDFResource.cpp/.h is no longer part of the build.
Comment on attachment 182011 [details] [diff] [review]
Remove unused parameters

Requesting approval for checkin. Backend address book change removing unused
parameters from address book code (Suite & TB affected). Should be low risk as
the parameters are unused.

Also would like approval for removing the files
nsAbRDFResource.h/.cpp in mailnews/addressbook/src/ to be removed as they are
no longer used (Scott has already confirmed he's happy with this, see previous
comment)
Attachment #182011 - Flags: approval1.8b2?
Comment on attachment 182011 [details] [diff] [review]
Remove unused parameters

a=chofmann
Attachment #182011 - Flags: approval1.8b2? → approval1.8b2+
Checked in by Pike:

2005-05-02 08:41	axel%pike.org 	mozilla/ mailnews/ addrbook/ src/
nsAbMDBDirectory.cpp 	1.44 	4/4
2005-05-02 08:41	axel%pike.org 	mozilla/ mailnews/ addrbook/ public/
nsIAddrDBListener.idl 	1.8 	5/8 
2005-05-02 08:41	axel%pike.org 	mozilla/ mailnews/ addrbook/ public/
nsIAddrDBAnnouncer.idl 	1.7 	3/5 
2005-05-02 08:41	axel%pike.org 	mozilla/ mailnews/ addrbook/ src/
nsAbRDFResource.h 	  	0/0 
2005-05-02 08:41	axel%pike.org 	mozilla/ mailnews/ addrbook/ src/
nsAbRDFResource.cpp 	  	0/0 
2005-05-02 08:41	axel%pike.org 	mozilla/ mailnews/ addrbook/ src/
nsAddrDatabase.h 	1.52 	1/1 
2005-05-02 08:41	axel%pike.org 	mozilla/ mailnews/ addrbook/ src/
nsAddrDatabase.cpp 	1.129 	18/18 
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Target Milestone: --- → Seamonkey1.0alpha
Verified FIXED via LXR for code-inspection (just verifying that it landed).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: