From 75eb811532b107aa97b223375a59f127cb4290bb Mon Sep 17 00:00:00 2001 From: helge Date: Sat, 30 Jul 2005 17:17:16 +0000 Subject: [PATCH] added more fields to Kolab contact viewer cache parse DOM documents git-svn-id: http://svn.opengroupware.org/SOGo/trunk@925 d1b88da0-ebda-0310-925b-ed51d893ca5b --- UI/MailPartViewers/ChangeLog | 4 +- UI/MailPartViewers/UIxKolabPartViewer.h | 3 ++ UI/MailPartViewers/UIxKolabPartViewer.m | 24 ++++++++++- UI/MailPartViewers/Version | 2 +- .../UIxKolabPartContactViewer.wox | 40 +++++++++++++++---- 5 files changed, 62 insertions(+), 11 deletions(-) diff --git a/UI/MailPartViewers/ChangeLog b/UI/MailPartViewers/ChangeLog index 42c280a1..2e886cbc 100644 --- a/UI/MailPartViewers/ChangeLog +++ b/UI/MailPartViewers/ChangeLog @@ -1,5 +1,7 @@ 2005-07-30 Helge Hess - + + * UIxKolabPartViewer.m: cache parsed DOM document (v0.9.21) + * v0.9.20 * UIxMailPartViewer.m: added ability to use a fallback string encoding diff --git a/UI/MailPartViewers/UIxKolabPartViewer.h b/UI/MailPartViewers/UIxKolabPartViewer.h index af288097..c2d02c68 100644 --- a/UI/MailPartViewers/UIxKolabPartViewer.h +++ b/UI/MailPartViewers/UIxKolabPartViewer.h @@ -30,8 +30,11 @@ Superclass for viewers which show the application/x-vnd.* XML documents. */ +#include + @interface UIxKolabPartViewer : UIxMailPartViewer { + id domDocument; } @end diff --git a/UI/MailPartViewers/UIxKolabPartViewer.m b/UI/MailPartViewers/UIxKolabPartViewer.m index 0d754469..aecdb03a 100644 --- a/UI/MailPartViewers/UIxKolabPartViewer.m +++ b/UI/MailPartViewers/UIxKolabPartViewer.m @@ -36,13 +36,33 @@ static id domBuilder = nil; NSStringFromClass(self), domBuilder); } +- (void)dealloc { + [(id)self->domDocument release]; + [super dealloc]; +} + +/* maintain caches */ + +- (void)resetPathCaches { + [super resetPathCaches]; + [(id)self->domDocument release]; self->domDocument = nil; +} + +/* getting a DOM representation */ + - (id)domDocument { /* Note: this ignores the charset MIME header and will rely on proper encoding header in the XML. */ - return [domBuilder buildFromSource:[self decodedFlatContent] - systemId:@"Kolab Mail Object"]; + + if (self->domDocument != nil) + return [(id)self->domDocument isNotNull] ? self->domDocument : nil; + + self->domDocument = + [[domBuilder buildFromSource:[self decodedFlatContent] + systemId:@"Kolab Mail Object"] retain]; + return self->domDocument; } @end /* UIxKolabPartViewer */ diff --git a/UI/MailPartViewers/Version b/UI/MailPartViewers/Version index af42e0b0..d7c250fc 100644 --- a/UI/MailPartViewers/Version +++ b/UI/MailPartViewers/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=20 +SUBMINOR_VERSION:=21 # v0.9.0 requires libNGiCal v4.5.53 # v0.9.1 requires libNGMime v4.5.213 diff --git a/UI/Templates/MailPartViewers/UIxKolabPartContactViewer.wox b/UI/Templates/MailPartViewers/UIxKolabPartContactViewer.wox index 378f4654..0b5f5724 100644 --- a/UI/Templates/MailPartViewers/UIxKolabPartContactViewer.wox +++ b/UI/Templates/MailPartViewers/UIxKolabPartContactViewer.wox @@ -14,6 +14,7 @@
+ @@ -67,24 +68,49 @@ + + + + + + + + + + + + + + + + + + + + +
::
:
:
:
:
: + + + + / + + +
-