Permalink
Browse files

Remove unnecessary codes and files

  • Loading branch information...
1 parent e1c4b4d commit 1bf7f0271dcc6dd7f510a3b64faf3f7996849a79 @psychs committed Aug 2, 2012
@@ -17,11 +17,6 @@ - (id)init
{
self = [super init];
if (self) {
-#ifndef TARGET_APP_STORE
- // migrate from the old .plist
- //CFPreferencesAddSuitePreferencesToApp(kCFPreferencesCurrentApplication, CFSTR("LimeChat"));
-#endif
-
[Preferences migrate];
[Preferences initPreferences];
}
@@ -1,11 +0,0 @@
-// LimeChat is copyrighted free software by Satoshi Nakagawa <psychs AT limechat DOT net>.
-// You can redistribute it and/or modify it under the terms of the GPL version 2 (see the file GPL.txt).
-
-#import <Cocoa/Cocoa.h>
-
-
-@interface NSArray (NSArrayHelper)
-
-- (id)safeObjectAtIndex:(int)n;
-
-@end
@@ -1,17 +0,0 @@
-// LimeChat is copyrighted free software by Satoshi Nakagawa <psychs AT limechat DOT net>.
-// You can redistribute it and/or modify it under the terms of the GPL version 2 (see the file GPL.txt).
-
-#import "NSArrayHelper.h"
-
-
-@implementation NSArray (NSArrayHelper)
-
-- (id)safeObjectAtIndex:(int)n
-{
- if (0 <= n && n < self.count) {
- return [self objectAtIndex:n];
- }
- return nil;
-}
-
-@end
@@ -19,21 +19,17 @@
- (BOOL)containsIgnoringCase:(NSString*)str;
- (int)findCharacter:(UniChar)c;
- (int)findCharacter:(UniChar)c start:(int)start;
-- (int)findString:(NSString*)str;
- (NSArray*)split:(NSString*)delimiter;
- (NSArray*)splitIntoLines;
- (NSString*)trim;
- (BOOL)isAlphaNumOnly;
- (BOOL)isNumericOnly;
-- (int)firstCharCodePoint;
-- (int)lastCharCodePoint;
-
- (NSString*)safeUsername;
- (NSString*)safeFileName;
-- (NSString*)stripEffects;
+- (NSString*)stripMIRCEffects;
- (NSRange)rangeOfUrl;
- (NSRange)rangeOfUrlStart:(int)start;
@@ -51,8 +47,6 @@
- (BOOL)isModeChannelName;
- (NSString*)canonicalName;
-+ (NSString*)bundleString:(NSString*)key;
-
@end
@interface NSMutableString (NSMutableStringHelper)
@@ -58,17 +58,6 @@ - (int)findCharacter:(UniChar)c start:(int)start
}
}
-- (int)findString:(NSString*)str
-{
- NSRange r = [self rangeOfString:str];
- if (r.location != NSNotFound) {
- return r.location;
- }
- else {
- return -1;
- }
-}
-
- (NSArray*)split:(NSString*)delimiter
{
NSMutableArray* ary = [NSMutableArray array];
@@ -164,44 +153,6 @@ - (BOOL)isAlphaNumOnly
return YES;
}
-- (int)firstCharCodePoint
-{
- int len = self.length;
- if (len == 0) return -1;
-
- int c = [self characterAtIndex:0];
- if (CFStringIsSurrogateHighCharacter(c)) {
- if (len <= 1) return c;
- int d = [self characterAtIndex:1];
- if (CFStringIsSurrogateLowCharacter(d)) {
- return (c - 0xd800) * 0x400 + (d - 0xdc00) + 0x10000;
- }
- else {
- return -1;
- }
- }
- return c;
-}
-
-- (int)lastCharCodePoint
-{
- int len = self.length;
- if (len == 0) return -1;
-
- int c = [self characterAtIndex:len-1];
- if (CFStringIsSurrogateLowCharacter(c)) {
- if (len <= 1) return c;
- int d = [self characterAtIndex:len-2];
- if (CFStringIsSurrogateHighCharacter(d)) {
- return (d - 0xd800) * 0x400 + (c - 0xdc00) + 0x10000;
- }
- else {
- return -1;
- }
- }
- return c;
-}
-
static int ctoi(unsigned char c)
{
if ('0' <= c && c <= '9') {
@@ -250,7 +201,7 @@ - (NSString*)safeFileName
return [s stringByReplacingOccurrencesOfString:@":" withString:@"_"];
}
-- (NSString*)stripEffects
+- (NSString*)stripMIRCEffects
{
int len = self.length;
if (len == 0) return self;
@@ -591,11 +542,6 @@ - (NSString*)encodeURIFragment
return [[[NSString alloc] initWithBytes:buf length:dest - buf encoding:NSASCIIStringEncoding] autorelease];
}
-+ (NSString*)bundleString:(NSString*)key
-{
- return [[[NSBundle mainBundle] infoDictionary] objectForKey:key];
-}
-
@end
@implementation NSMutableString (NSMutableStringHelper)
@@ -6,9 +6,6 @@
@interface UnicodeHelper : NSObject
-+ (BOOL)isPrivate:(UniChar)c;
-+ (BOOL)isIdeographic:(UniChar)c;
-+ (BOOL)isIdeographicOrPrivate:(UniChar)c;
+ (BOOL)isAlphabeticalCodePoint:(int)c;
@end
@@ -363,90 +363,6 @@
@implementation UnicodeHelper
-+ (BOOL)isPrivate:(UniChar)c
-{
- /*
- if (0xE000 <= c && c <= 0xF8FF) return CK_PRIVATE_USE_AREA;
- */
-
- return 0xe000 <= c && c <= 0xf8ff;
-}
-
-+ (BOOL)isIdeographic:(UniChar)c
-{
- /*
- if (0x2E80 <= c && c <= 0x2EFF) return CK_CJK_RADICALS_SUPPLEMENT;
- if (0x2F00 <= c && c <= 0x2FDF) return CK_KANGXI_RADICALS;
- if (0x2FF0 <= c && c <= 0x2FFF) return CK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS;
- if (0x3000 <= c && c <= 0x303F) return CK_CJK_SYMBOLS_AND_PUNCTUATION;
- if (0x3040 <= c && c <= 0x309F) return CK_HIRAGANA;
- if (0x30A0 <= c && c <= 0x30FF) return CK_KATAKANA;
- if (0x3100 <= c && c <= 0x312F) return CK_BOPOMOFO;
- if (0x3130 <= c && c <= 0x318F) return CK_HANGUL_COMPATIBILITY_JAMO;
- if (0x3190 <= c && c <= 0x319F) return CK_KANBUN;
- if (0x31A0 <= c && c <= 0x31BF) return CK_BOPOMOFO_EXTENDED;
- if (0x31C0 <= c && c <= 0x31EF) return CK_CJK_STROKES;
- if (0x31F0 <= c && c <= 0x31FF) return CK_KATAKANA_PHONETIC_EXTENSIONS;
- if (0x3200 <= c && c <= 0x32FF) return CK_ENCLOSED_CJK_LETTERS_AND_MONTHS;
- if (0x3300 <= c && c <= 0x33FF) return CK_CJK_COMPATIBILITY;
- if (0x3400 <= c && c <= 0x4DBF) return CK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A;
- if (0x4DC0 <= c && c <= 0x4DFF) return CK_YIJING_HEXAGRAM_SYMBOLS;
- if (0x4E00 <= c && c <= 0x9FFF) return CK_CJK_UNIFIED_IDEOGRAPHS;
-
- if (0xA000 <= c && c <= 0xA48F) return CK_YI_SYLLABLES;
- if (0xA490 <= c && c <= 0xA4CF) return CK_YI_RADICALS;
-
- if (0xF900 <= c && c <= 0xFAFF) return CK_CJK_COMPATIBILITY_IDEOGRAPHS;
-
- if (0xFE30 <= c && c <= 0xFE4F) return CK_CJK_COMPATIBILITY_FORMS;
- if (0xFF00 <= c && c <= 0xFFEF) return CK_HALFWIDTH_AND_FULLWIDTH_FORMS;
- */
-
- return (0x2e80 <= c && c <= 0x9fff)
- || (0xa000 <= c && c <= 0xa4cf)
- || (0xf900 <= c && c <= 0xfaff)
- || (0xfe30 <= c && c <= 0xfe4f)
- || (0xff00 <= c && c <= 0xffef);
-}
-
-+ (BOOL)isIdeographicOrPrivate:(UniChar)c
-{
- /*
- if (0x2E80 <= c && c <= 0x2EFF) return CK_CJK_RADICALS_SUPPLEMENT;
- if (0x2F00 <= c && c <= 0x2FDF) return CK_KANGXI_RADICALS;
- if (0x2FF0 <= c && c <= 0x2FFF) return CK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS;
- if (0x3000 <= c && c <= 0x303F) return CK_CJK_SYMBOLS_AND_PUNCTUATION;
- if (0x3040 <= c && c <= 0x309F) return CK_HIRAGANA;
- if (0x30A0 <= c && c <= 0x30FF) return CK_KATAKANA;
- if (0x3100 <= c && c <= 0x312F) return CK_BOPOMOFO;
- if (0x3130 <= c && c <= 0x318F) return CK_HANGUL_COMPATIBILITY_JAMO;
- if (0x3190 <= c && c <= 0x319F) return CK_KANBUN;
- if (0x31A0 <= c && c <= 0x31BF) return CK_BOPOMOFO_EXTENDED;
- if (0x31C0 <= c && c <= 0x31EF) return CK_CJK_STROKES;
- if (0x31F0 <= c && c <= 0x31FF) return CK_KATAKANA_PHONETIC_EXTENSIONS;
- if (0x3200 <= c && c <= 0x32FF) return CK_ENCLOSED_CJK_LETTERS_AND_MONTHS;
- if (0x3300 <= c && c <= 0x33FF) return CK_CJK_COMPATIBILITY;
- if (0x3400 <= c && c <= 0x4DBF) return CK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A;
- if (0x4DC0 <= c && c <= 0x4DFF) return CK_YIJING_HEXAGRAM_SYMBOLS;
- if (0x4E00 <= c && c <= 0x9FFF) return CK_CJK_UNIFIED_IDEOGRAPHS;
-
- if (0xA000 <= c && c <= 0xA48F) return CK_YI_SYLLABLES;
- if (0xA490 <= c && c <= 0xA4CF) return CK_YI_RADICALS;
-
- if (0xE000 <= c && c <= 0xF8FF) return CK_PRIVATE_USE_AREA;
- if (0xF900 <= c && c <= 0xFAFF) return CK_CJK_COMPATIBILITY_IDEOGRAPHS;
-
- if (0xFE30 <= c && c <= 0xFE4F) return CK_CJK_COMPATIBILITY_FORMS;
- if (0xFF00 <= c && c <= 0xFFEF) return CK_HALFWIDTH_AND_FULLWIDTH_FORMS;
- */
-
- return (0x2e80 <= c && c <= 0x9fff)
- || (0xa000 <= c && c <= 0xa4cf)
- || (0xe000 <= c && c <= 0xfaff)
- || (0xfe30 <= c && c <= 0xfe4f)
- || (0xff00 <= c && c <= 0xffef);
-}
-
+ (BOOL)isAlphabeticalCodePoint:(int)c
{
unsigned* T = 0;
View
@@ -2351,7 +2351,7 @@ - (void)receivePrivmsgAndNotice:(IRCMessage*)m
// CTCP
//
text = [text substringFromIndex:1];
- int n = [text findString:@"\x01"];
+ int n = [text findCharacter:0x1];
if (n >= 0) {
text = [text substringToIndex:n];
}
@@ -64,7 +64,6 @@
782DA88612DB5A3800C07861 /* GTMBase64.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0ED11737F660044E7A1 /* GTMBase64.m */; };
782DA88712DB5A3800C07861 /* GTMNSString+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0F111737F660044E7A1 /* GTMNSString+HTML.m */; };
782DA88812DB5A3800C07861 /* GTMNSString+URLArguments.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0F311737F660044E7A1 /* GTMNSString+URLArguments.m */; };
- 782DA88912DB5A3800C07861 /* NSArrayHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0F511737F660044E7A1 /* NSArrayHelper.m */; };
782DA88A12DB5A3800C07861 /* NSColorHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0F711737F660044E7A1 /* NSColorHelper.m */; };
782DA88B12DB5A3800C07861 /* NSDataHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0F911737F660044E7A1 /* NSDataHelper.m */; };
782DA88C12DB5A3800C07861 /* NSDictionaryHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0FB11737F660044E7A1 /* NSDictionaryHelper.m */; };
@@ -211,7 +210,6 @@
78A8C1B911737F660044E7A1 /* GTMBase64.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0ED11737F660044E7A1 /* GTMBase64.m */; };
78A8C1BA11737F660044E7A1 /* GTMNSString+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0F111737F660044E7A1 /* GTMNSString+HTML.m */; };
78A8C1BB11737F660044E7A1 /* GTMNSString+URLArguments.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0F311737F660044E7A1 /* GTMNSString+URLArguments.m */; };
- 78A8C1BC11737F660044E7A1 /* NSArrayHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0F511737F660044E7A1 /* NSArrayHelper.m */; };
78A8C1BD11737F660044E7A1 /* NSColorHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0F711737F660044E7A1 /* NSColorHelper.m */; };
78A8C1BE11737F660044E7A1 /* NSDataHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0F911737F660044E7A1 /* NSDataHelper.m */; };
78A8C1BF11737F660044E7A1 /* NSDictionaryHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 78A8C0FB11737F660044E7A1 /* NSDictionaryHelper.m */; };
@@ -461,8 +459,6 @@
78A8C0F111737F660044E7A1 /* GTMNSString+HTML.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GTMNSString+HTML.m"; sourceTree = "<group>"; };
78A8C0F211737F660044E7A1 /* GTMNSString+URLArguments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTMNSString+URLArguments.h"; sourceTree = "<group>"; };
78A8C0F311737F660044E7A1 /* GTMNSString+URLArguments.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GTMNSString+URLArguments.m"; sourceTree = "<group>"; };
- 78A8C0F411737F660044E7A1 /* NSArrayHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSArrayHelper.h; sourceTree = "<group>"; };
- 78A8C0F511737F660044E7A1 /* NSArrayHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSArrayHelper.m; sourceTree = "<group>"; };
78A8C0F611737F660044E7A1 /* NSColorHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSColorHelper.h; sourceTree = "<group>"; };
78A8C0F711737F660044E7A1 /* NSColorHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSColorHelper.m; sourceTree = "<group>"; };
78A8C0F811737F660044E7A1 /* NSDataHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDataHelper.h; sourceTree = "<group>"; };
@@ -874,8 +870,6 @@
78A8C10311737F660044E7A1 /* NSStringHelper.m */,
78A8C0FA11737F660044E7A1 /* NSDictionaryHelper.h */,
78A8C0FB11737F660044E7A1 /* NSDictionaryHelper.m */,
- 78A8C0F411737F660044E7A1 /* NSArrayHelper.h */,
- 78A8C0F511737F660044E7A1 /* NSArrayHelper.m */,
78A8C0F811737F660044E7A1 /* NSDataHelper.h */,
78A8C0F911737F660044E7A1 /* NSDataHelper.m */,
78A7B4F41174427C006B324A /* NSData+Kana.h */,
@@ -1310,7 +1304,6 @@
782DA88612DB5A3800C07861 /* GTMBase64.m in Sources */,
782DA88712DB5A3800C07861 /* GTMNSString+HTML.m in Sources */,
782DA88812DB5A3800C07861 /* GTMNSString+URLArguments.m in Sources */,
- 782DA88912DB5A3800C07861 /* NSArrayHelper.m in Sources */,
782DA88A12DB5A3800C07861 /* NSColorHelper.m in Sources */,
782DA88B12DB5A3800C07861 /* NSDataHelper.m in Sources */,
782DA88C12DB5A3800C07861 /* NSDictionaryHelper.m in Sources */,
@@ -1435,7 +1428,6 @@
78A8C1B911737F660044E7A1 /* GTMBase64.m in Sources */,
78A8C1BA11737F660044E7A1 /* GTMNSString+HTML.m in Sources */,
78A8C1BB11737F660044E7A1 /* GTMNSString+URLArguments.m in Sources */,
- 78A8C1BC11737F660044E7A1 /* NSArrayHelper.m in Sources */,
78A8C1BD11737F660044E7A1 /* NSColorHelper.m in Sources */,
78A8C1BE11737F660044E7A1 /* NSDataHelper.m in Sources */,
78A8C1BF11737F660044E7A1 /* NSDictionaryHelper.m in Sources */,
Oops, something went wrong.

0 comments on commit 1bf7f02

Please sign in to comment.