From e8026e67c826cd17c2ae94308419c47c1dccdc15 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 30 Mar 2011 15:01:55 +0000 Subject: [PATCH] Monotone-Parent: 10ffe772d1b4699a4fc8aa41c3f3354e492d3e35 Monotone-Revision: 2f3c94605759601f796021ed2469cb5eb7910364 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-30T15:01:55 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 2 ++ Main/GNUmakefile.preamble | 5 +---- Main/SOGo.m | 5 ++--- SoObjects/Appointments/SOGoAppointmentFolderObject.m | 5 ++++- SoObjects/Appointments/SOGoCalendarComponent.m | 8 ++++++-- SoObjects/Appointments/SOGoFreeBusyObject.m | 5 ++++- SoObjects/Contacts/SOGoContactLDIFEntry.m | 6 +++++- SoObjects/SOGo/GNUmakefile.preamble | 5 ++++- SoObjects/SOGo/SOGoBuild.h | 1 + SoObjects/SOGo/SOGoBuild.m | 3 +++ UI/MailerUI/UIxMailView.m | 6 ++---- 11 files changed, 34 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f3f8016d..34dc0e952 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2011-03-30 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoBuild.m: export new SOGoVersion NSString. + * Main/SOGo.m (+initialize): moved most initialization code from -init and -run here since this method is invoked before forking and data memory is in "copy-on-write" mode, slightly reducing diff --git a/Main/GNUmakefile.preamble b/Main/GNUmakefile.preamble index 0a33a3dab..7614f2028 100644 --- a/Main/GNUmakefile.preamble +++ b/Main/GNUmakefile.preamble @@ -1,10 +1,7 @@ # compile settings ADDITIONAL_CPPFLAGS += \ - -D_GNU_SOURCE \ - -DSOGO_MAJOR_VERSION=$(MAJOR_VERSION) \ - -DSOGO_MINOR_VERSION=$(MINOR_VERSION) \ - -DSOGO_SUBMINOR_VERSION=$(SUBMINOR_VERSION) + -D_GNU_SOURCE ADDITIONAL_INCLUDE_DIRS += \ -I../SOPE/ \ diff --git a/Main/SOGo.m b/Main/SOGo.m index 1b51e2cf2..eb95cbe60 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -106,9 +106,8 @@ static BOOL debugLeaks; SoClassSecurityInfo *sInfo; NSArray *basicRoles; - [self logWithFormat: @"version %d.%d.%d (build %@) -- starting", - SOGO_MAJOR_VERSION, SOGO_MINOR_VERSION, SOGO_SUBMINOR_VERSION, - SOGoBuildDate]; + [self logWithFormat: @"version %@ (build %@) -- starting", + SOGoVersion, SOGoBuildDate]; defaults = [SOGoSystemDefaults sharedSystemDefaults]; doCrashOnSessionCreate = [defaults crashOnSessionCreate]; diff --git a/SoObjects/Appointments/SOGoAppointmentFolderObject.m b/SoObjects/Appointments/SOGoAppointmentFolderObject.m index f0a339c52..112c26ea6 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolderObject.m +++ b/SoObjects/Appointments/SOGoAppointmentFolderObject.m @@ -32,6 +32,7 @@ #import #import +#import #import #import @@ -220,7 +221,9 @@ static NSArray *contentFields = nil; calendar = [iCalCalendar groupWithTag: @"vcalendar"]; [calendar setMethod: @"PUBLISH"]; [calendar setVersion: @"2.0"]; - [calendar setProdID: @"-//Inverse inc./SOGo 1.0//EN"]; + [calendar setProdID: [NSString stringWithFormat: + @"-//Inverse inc./SOGo %@//EN", + SOGoVersion]]; [calendar addChildren: [timeZones allValues]]; [calendar addChildren: components]; diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 48694f44b..a9a17d630 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -47,6 +47,7 @@ #import #import #import +#import #import #import #import @@ -428,7 +429,7 @@ static inline BOOL _occurenceHasID (iCalRepeatableEntityObject *occurence, { iCalRepeatableEntityObject *newComponent; iCalCalendar **calendar, *returnedCopy; - NSString *iCalString, *tag; + NSString *iCalString, *tag, *prodID; if (secure) calendar = &safeCalendar; @@ -454,7 +455,10 @@ static inline BOOL _occurenceHasID (iCalRepeatableEntityObject *occurence, { ASSIGN (*calendar, [iCalCalendar groupWithTag: @"vcalendar"]); [*calendar setVersion: @"2.0"]; - [*calendar setProdID: @"-//Inverse inc./SOGo 1.0//EN"]; + prodID = [NSString stringWithFormat: + @"-//Inverse inc./SOGo %@//EN", + SOGoVersion]; + [*calendar setProdID: prodID]; tag = [[self componentTag] uppercaseString]; newComponent = [[*calendar classForTag: tag] groupWithTag: tag]; diff --git a/SoObjects/Appointments/SOGoFreeBusyObject.m b/SoObjects/Appointments/SOGoFreeBusyObject.m index d4cd26af4..9b302bc6a 100644 --- a/SoObjects/Appointments/SOGoFreeBusyObject.m +++ b/SoObjects/Appointments/SOGoFreeBusyObject.m @@ -31,6 +31,7 @@ #import #import +#import #import #import #import @@ -106,7 +107,9 @@ user = [SOGoUser userWithLogin: login]; calendar = [iCalCalendar groupWithTag: @"vcalendar"]; - [calendar setProdID: @"//Inverse inc./SOGo 1.0//EN"]; + [calendar setProdID: [NSString stringWithFormat: + @"-//Inverse inc./SOGo %@//EN", + SOGoVersion]]; [calendar setVersion: @"2.0"]; if (method) [calendar setMethod: method]; diff --git a/SoObjects/Contacts/SOGoContactLDIFEntry.m b/SoObjects/Contacts/SOGoContactLDIFEntry.m index a210a6efe..f7795ff60 100644 --- a/SoObjects/Contacts/SOGoContactLDIFEntry.m +++ b/SoObjects/Contacts/SOGoContactLDIFEntry.m @@ -28,6 +28,8 @@ #import #import +#import + #import "SOGoContactGCSEntry.h" #import "SOGoContactLDIFEntry.h" @@ -115,7 +117,9 @@ { vcard = [[NGVCard alloc] initWithUid: [self nameInContainer]]; [vcard setVClass: @"PUBLIC"]; - [vcard setProdID: @"-//Inverse inc./SOGo 1.0//EN"]; + [vcard setProdID: [NSString + stringWithFormat: @"-//Inverse inc./SOGo %@//EN", + SOGoVersion]]; [vcard setProfile: @"VCARD"]; info = [ldifEntry objectForKey: @"c_cn"]; if (![info length]) diff --git a/SoObjects/SOGo/GNUmakefile.preamble b/SoObjects/SOGo/GNUmakefile.preamble index 7116ea411..7823443df 100644 --- a/SoObjects/SOGo/GNUmakefile.preamble +++ b/SoObjects/SOGo/GNUmakefile.preamble @@ -1,6 +1,9 @@ # compilation settings -SOGo_INCLUDE_DIRS += -I.. -I../../UI -DSOGO_MAJOR_VERSION="\"$(MAJOR_VERSION)\"" -DSOGO_MINOR_VERSION="\"$(MINOR_VERSION)\"" +SOGo_INCLUDE_DIRS += -I.. -I../../UI \ + -DSOGO_MAJOR_VERSION="@\"$(MAJOR_VERSION)\"" \ + -DSOGO_MINOR_VERSION="@\"$(MINOR_VERSION)\"" \ + -DSOGO_SUBMINOR_VERSION="@\"$(SUBMINOR_VERSION)\"" HOSTNAME = $(shell hostname -f) BUILD_DATE = $(shell echo $$USER@$(HOSTNAME); date +"%Y%m%d%H%M") diff --git a/SoObjects/SOGo/SOGoBuild.h b/SoObjects/SOGo/SOGoBuild.h index f068ebed4..f5924202d 100644 --- a/SoObjects/SOGo/SOGoBuild.h +++ b/SoObjects/SOGo/SOGoBuild.h @@ -24,5 +24,6 @@ #define BUILD_H extern NSString *SOGoBuildDate; +extern NSString *SOGoVersion; #endif /* BUILD_H */ diff --git a/SoObjects/SOGo/SOGoBuild.m b/SoObjects/SOGo/SOGoBuild.m index d8800d191..665d3f76c 100644 --- a/SoObjects/SOGo/SOGoBuild.m +++ b/SoObjects/SOGo/SOGoBuild.m @@ -23,3 +23,6 @@ #import NSString *SOGoBuildDate = SOGO_BUILD_DATE; +NSString *SOGoVersion = (SOGO_MAJOR_VERSION + @"." SOGO_MINOR_VERSION + @"." SOGO_SUBMINOR_VERSION); diff --git a/UI/MailerUI/UIxMailView.m b/UI/MailerUI/UIxMailView.m index e53489d98..7ab9d6b84 100644 --- a/UI/MailerUI/UIxMailView.m +++ b/UI/MailerUI/UIxMailView.m @@ -38,6 +38,7 @@ #import #import +#import #import #import #import @@ -399,10 +400,7 @@ static NSString *mailETag = nil; [map release]; mdnPartMessage = [[NSMutableString alloc] initWithCapacity: 100]; - [mdnPartMessage appendFormat: @"Reporting-UA: SOGoMail %d.%d.%d\n", - SOGO_MAJOR_VERSION, - SOGO_MINOR_VERSION, - SOGO_SUBMINOR_VERSION]; + [mdnPartMessage appendFormat: @"Reporting-UA: SOGoMail %@\n", SOGoVersion]; [mdnPartMessage appendFormat: @"Final-Recipient: rfc822;%@\n", [self _matchingIdentityEMail]]; messageId = [[self clientObject] messageId];