adium-1.4 3313:b678f1bfdb70: Added a prefix header for the Spotl...
commits at adium.im
commits at adium.im
Sun Dec 19 07:23:37 UTC 2010
details: http://hg.adium.im/adium-1.4/rev/b678f1bfdb70
revision: 3313:b678f1bfdb70
author: Peter Hosey <hg at boredzo.org>
date: Sat Dec 18 23:08:38 2010 -0800
Added a prefix header for the Spotlight importer.
Subject: adium-1.4 3314:6fdac6392065: Deleted the other copy of scandate from the Spotlight Importer. Include and link the one that [de5dde2df90b] moved into a separate pair of files instead.
details: http://hg.adium.im/adium-1.4/rev/6fdac6392065
revision: 3314:6fdac6392065
author: Peter Hosey <hg at boredzo.org>
date: Sat Dec 18 23:10:30 2010 -0800
Deleted the other copy of scandate from the Spotlight Importer. Include and link the one that [de5dde2df90b] moved into a separate pair of files instead.
diffs (181 lines):
diff -r e20de4ece246 -r 6fdac6392065 Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj Sat Dec 18 22:21:40 2010 -0800
+++ b/Adium.xcodeproj/project.pbxproj Sat Dec 18 23:10:30 2010 -0800
@@ -229,6 +229,7 @@
31DDDA7012BDD5CE0048F6C0 /* scandate.m in Sources */ = {isa = PBXBuildFile; fileRef = 31DDDA6F12BDD5CE0048F6C0 /* scandate.m */; };
31DDDA7112BDD5CE0048F6C0 /* scandate.m in Sources */ = {isa = PBXBuildFile; fileRef = 31DDDA6F12BDD5CE0048F6C0 /* scandate.m */; };
31DDDA7A12BDD6E90048F6C0 /* TestScandate.m in Sources */ = {isa = PBXBuildFile; fileRef = 31DDDA7912BDD6E90048F6C0 /* TestScandate.m */; };
+ 31DDDB3A12BDE6FA0048F6C0 /* scandate.m in Sources */ = {isa = PBXBuildFile; fileRef = 31DDDA6F12BDD5CE0048F6C0 /* scandate.m */; };
31E0CD810C5EEF5200271DB1 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31E0CD800C5EEF5200271DB1 /* CoreAudio.framework */; };
31FA804C0D4A8EB200ABE634 /* Adium.sdef in Resources */ = {isa = PBXBuildFile; fileRef = 0CAC6A130C0C657A0090AE95 /* Adium.sdef */; };
3402D5A5080DBC91004E50B4 /* SortConfiguration.nib in Resources */ = {isa = PBXBuildFile; fileRef = 347E791D07CAA52300350507 /* SortConfiguration.nib */; };
@@ -2077,6 +2078,7 @@
31DDDA6F12BDD5CE0048F6C0 /* scandate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = scandate.m; path = Source/scandate.m; sourceTree = "<group>"; };
31DDDA7812BDD6E90048F6C0 /* TestScandate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestScandate.h; path = UnitTests/TestScandate.h; sourceTree = "<group>"; };
31DDDA7912BDD6E90048F6C0 /* TestScandate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestScandate.m; path = UnitTests/TestScandate.m; sourceTree = "<group>"; };
+ 31DDDAF112BDE54B0048F6C0 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Prefix.pch; path = "Other/Adium Spotlight Importer/Prefix.pch"; sourceTree = "<group>"; };
31E0CD800C5EEF5200271DB1 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
31E84DF10C7F387800674BCA /* AIUnitTestUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIUnitTestUtilities.h; path = UnitTests/AIUnitTestUtilities.h; sourceTree = "<group>"; };
31FA7F0F0D4A75D000ABE634 /* TestRichTextCoercion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestRichTextCoercion.h; path = UnitTests/TestRichTextCoercion.h; sourceTree = "<group>"; };
@@ -8184,6 +8186,7 @@
633D50550F9D31B8004F491E /* AdiumSpotlightImporter.h */,
633D4FB40F9D30E3004F491E /* main.c */,
633D4FB50F9D30E3004F491E /* maintest.m */,
+ 31DDDAF112BDE54B0048F6C0 /* Prefix.pch */,
633D4FAF0F9D30E3004F491E /* Log Importing */,
633D4FAC0F9D30E3004F491E /* Additions */,
);
@@ -10923,6 +10926,7 @@
633D4FB80F9D30E3004F491E /* GetMetadataForHTMLLog.m in Sources */,
633D4FB90F9D30E3004F491E /* main.c in Sources */,
633D4FBE0F9D30FA004F491E /* NSCalendarDate+ISO8601Parsing.m in Sources */,
+ 31DDDB3A12BDE6FA0048F6C0 /* scandate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -12736,6 +12740,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 63C7E2080FAFAA4700B310AC /* Spotlight Importer.xcconfig */;
buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SRCROOT)/Other/Adium Spotlight Importer/Prefix.pch";
};
name = Debug;
};
@@ -12748,6 +12754,8 @@
i386,
x86_64,
);
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SRCROOT)/Other/Adium Spotlight Importer/Prefix.pch";
};
name = Release;
};
@@ -12760,6 +12768,8 @@
i386,
x86_64,
);
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SRCROOT)/Other/Adium Spotlight Importer/Prefix.pch";
};
name = "Release-Debug";
};
diff -r e20de4ece246 -r 6fdac6392065 Other/Adium Spotlight Importer/GetMetadataForHTMLLog.m
--- a/Other/Adium Spotlight Importer/GetMetadataForHTMLLog.m Sat Dec 18 22:21:40 2010 -0800
+++ b/Other/Adium Spotlight Importer/GetMetadataForHTMLLog.m Sat Dec 18 23:10:30 2010 -0800
@@ -8,90 +8,31 @@
#import "GetMetadataForHTMLLog.h"
#import "GetMetadataForHTMLLog-Additions.h"
+#import "scandate.h"
+
static char *gaim_markup_strip_html(const char *str);
-//Scan an Adium date string, supahfast C style
-static BOOL scandate(const char *sample, unsigned long *outyear,
- unsigned long *outmonth, unsigned long *outdate)
-{
- BOOL success = YES;
- unsigned long component;
- //read three numbers, starting after:
-
- //a space...
- while (*sample != ' ') {
- if (!*sample) {
- success = NO;
- goto fail;
- } else {
- ++sample;
- }
- }
-
- //...followed by a (
- while (*sample != '(') {
- if (!*sample) {
- success = NO;
- goto fail;
- } else {
- ++sample;
- }
- }
-
- //current character is a '(' now, so skip over it.
- ++sample; //start with the next character
-
- /*get the year*/ {
- while (*sample && (*sample < '0' || *sample > '9')) ++sample;
- if (!*sample) {
- success = NO;
- goto fail;
- }
- component = strtoul(sample, (char **)&sample, 10);
- if (outyear) *outyear = component;
- }
-
- /*get the month*/ {
- while (*sample && (*sample < '0' || *sample > '9')) ++sample;
- if (!*sample) {
- success = NO;
- goto fail;
- }
- component = strtoul(sample, (char **)&sample, 10);
- if (outmonth) *outmonth = component;
- }
-
- /*get the date*/ {
- while (*sample && (*sample < '0' || *sample > '9')) ++sample;
- if (!*sample) {
- success = NO;
- goto fail;
- }
- component = strtoul(sample, (char **)&sample, 10);
- if (outdate) *outdate = component;
- }
-
-fail:
- return success;
-}
-
-//Given an Adium log file name, return an NSCalendarDate with year, month, and day specified
+//Given an Adium log file name, return an NSCalendarDate for its creation date
static NSDate *dateFromHTMLLog(NSString *pathToFile)
{
NSDate *date = nil;
unsigned long year = 0;
unsigned long month = 0;
unsigned long day = 0;
-
- if (scandate([pathToFile UTF8String], &year, &month, &day)) {
+ unsigned long hour = 0;
+ unsigned long minute = 0;
+ unsigned long second = 0;
+ long timeZoneOffset = +0;
+
+ if (scandate([pathToFile UTF8String], &year, &month, &day, /*outHasTime*/ NULL, &hour, &minute, &second, &timeZoneOffset)) {
if (year && month && day) {
NSCalendarDate *calendarDate = [NSCalendarDate dateWithYear:year
month:month
day:day
- hour:0
- minute:0
- second:0
- timeZone:[NSTimeZone defaultTimeZone]];
+ hour:hour
+ minute:minute
+ second:second
+ timeZone:[NSTimeZone timeZoneForSecondsFromGMT:(NSInteger)timeZoneOffset]];
date = [NSDate dateWithTimeIntervalSince1970:[calendarDate timeIntervalSince1970]];
}
}
diff -r e20de4ece246 -r 6fdac6392065 Other/Adium Spotlight Importer/Prefix.pch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Other/Adium Spotlight Importer/Prefix.pch Sat Dec 18 23:10:30 2010 -0800
@@ -0,0 +1,8 @@
+#if __OBJC__
+# import <Cocoa/Cocoa.h>
+#endif
+
+#import <CoreFoundation/CoreFoundation.h>
+#import <CoreFoundation/CFPlugInCOM.h>
+#import <CoreServices/CoreServices.h>
+#import <ApplicationServices/ApplicationServices.h>
More information about the commits
mailing list