move IsEmpty() into a separate file.
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/CWCommonUtils.h Thu Sep 24 23:15:28 2009 -0400
1.3 @@ -0,0 +1,7 @@
1.4 +// Check if any object is empty:
1.5 +static inline BOOL IsEmpty(id object)
1.6 +{
1.7 + return (object == nil) ||
1.8 + ([object respondsToSelector:@selector(length)] && [(NSData *)object length] == 0) ||
1.9 + ([object respondsToSelector:@selector(count)] && [(NSArray *)object count] == 0);
1.10 +}
2.1 --- a/DragController.m Thu Sep 24 22:23:44 2009 -0400
2.2 +++ b/DragController.m Thu Sep 24 23:15:28 2009 -0400
2.3 @@ -12,6 +12,7 @@
2.4
2.5 #import "DragController.h"
2.6 #import "NSTreeController_Extensions.h"
2.7 +#import "CWCommonUtils.h"
2.8
2.9
2.10 @implementation DragController
3.1 --- a/TMDuration.h Thu Sep 24 22:23:44 2009 -0400
3.2 +++ b/TMDuration.h Thu Sep 24 23:15:28 2009 -0400
3.3 @@ -19,5 +19,4 @@
3.4
3.5 - (NSDate *)durationUsingInTime:(NSCalendarDate *)timeIn outTime:(NSCalendarDate *)timeOut breakDuration:(NSCalendarDate *)breakDuration round:(int)roundNum;
3.6
3.7 -inline BOOL IsEmpty(id thing);
3.8 @end
4.1 --- a/TMDuration.m Thu Sep 24 22:23:44 2009 -0400
4.2 +++ b/TMDuration.m Thu Sep 24 23:15:28 2009 -0400
4.3 @@ -25,10 +25,6 @@
4.4 return self;
4.5 }
4.6
4.7 -inline BOOL IsEmpty(id thing){
4.8 - return thing == nil || ([thing respondsToSelector:@selector(length)] && [(NSData *)thing length] == 0) || ([thing respondsToSelector:@selector(count)] && [(NSArray *)thing count] == 0);
4.9 -}
4.10 -
4.11 - (NSDate *)durationUsingInTime:(NSCalendarDate *)timeIn outTime:(NSCalendarDate *)timeOut breakDuration:(NSCalendarDate *)breakDuration round:(int)roundNum{
4.12 if (breakDuration == nil)
4.13 breakDuration = blankTime;
5.1 --- a/TMHistoryView.m Thu Sep 24 22:23:44 2009 -0400
5.2 +++ b/TMHistoryView.m Thu Sep 24 23:15:28 2009 -0400
5.3 @@ -12,6 +12,7 @@
5.4
5.5 #import "TMHistoryView.h"
5.6 #import "TMNotesPanel.h"
5.7 +#import "CWCommonUtils.h"
5.8
5.9
5.10 @implementation TMHistoryView
6.1 --- a/TMNotesPanel.m Thu Sep 24 22:23:44 2009 -0400
6.2 +++ b/TMNotesPanel.m Thu Sep 24 23:15:28 2009 -0400
6.3 @@ -14,6 +14,7 @@
6.4 #import "TMDuration.h"
6.5 #import "TMPreferences.h"
6.6 #import "NSDate_Extensions.h"
6.7 +#import "CWCommonUtils.h"
6.8
6.9
6.10 @implementation TMNotesPanel
7.1 --- a/TimeMon.m Thu Sep 24 22:23:44 2009 -0400
7.2 +++ b/TimeMon.m Thu Sep 24 23:15:28 2009 -0400
7.3 @@ -20,6 +20,7 @@
7.4 #import "ImageAndTextCell.h"
7.5 #import "TMUndoManager.h"
7.6 #import "NSDate_Extensions.h"
7.7 +#import "CWCommonUtils.h"
7.8
7.9 @implementation TimeMon
7.10
8.1 --- a/TimeMon.xcodeproj/project.pbxproj Thu Sep 24 22:23:44 2009 -0400
8.2 +++ b/TimeMon.xcodeproj/project.pbxproj Thu Sep 24 23:15:28 2009 -0400
8.3 @@ -169,6 +169,7 @@
8.4 5AD959150CDF9BF700B696D1 /* CalendarStore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CalendarStore.framework; path = /System/Library/Frameworks/CalendarStore.framework; sourceTree = "<absolute>"; };
8.5 5AEA47F2106C5949008C8B41 /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
8.6 5AEA47F3106C5949008C8B41 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
8.7 + 5AEA4955106C6AE9008C8B41 /* CWCommonUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CWCommonUtils.h; sourceTree = "<group>"; };
8.8 5AF60F760DD68514005B58DA /* ImageAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageAndTextCell.h; sourceTree = "<group>"; };
8.9 5AF60F770DD68514005B58DA /* ImageAndTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageAndTextCell.m; sourceTree = "<group>"; };
8.10 5AF9607F0D1DFD6D00E6926A /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Japanese; path = Japanese.lproj/Localizable.strings; sourceTree = "<group>"; };
8.11 @@ -261,6 +262,7 @@
8.12 5A061E220E47C11E000C0FF1 /* TMUndoManager.m */,
8.13 5A823DA21002F2B400245AB8 /* NSDate_Extensions.h */,
8.14 5A823DA31002F2B400245AB8 /* NSDate_Extensions.m */,
8.15 + 5AEA4955106C6AE9008C8B41 /* CWCommonUtils.h */,
8.16 CEB65DCC09C4D16800ADFD25 /* Table Sources */,
8.17 012E50500A37A3DC000F4614 /* Prefs */,
8.18 );