- Files:
-
- 562 added
- 9 removed
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
/Trunk/AILogSizeSort.h
r24 r19 20 20 */ 21 21 22 #import <AIUtilities/AITigerCompatibility.h> 23 22 24 #import <Adium/AISortController.h> 23 25 #import <Adium/AIListContact.h> -
/Trunk/AILogSizeSort.m
r28 r19 20 20 */ 21 21 22 #import <Adium/AIPlugin.h> 22 #import "AILogSizeSort.h" 23 #import "AILoggerPlugin.h" 24 23 25 #import <Adium/AISharedAdium.h> 24 26 27 #import <AIUtilities/AITigerCompatibility.h> 25 28 #import <AIUtilities/AIStringUtilities.h> 26 29 … … 35 38 #import <Adium/AIContentMessage.h> 36 39 37 #import "AILogSizeSort.h"38 #import "AILoggerPlugin.h"39 40 40 @implementation AILogSizeSort 41 41 … … 52 52 53 53 // Listen for content addition notifications 54 [[ NSNotificationCenter defaultCenter] addObserver:self55 56 57 54 [[adium notificationCenter] addObserver:self 55 selector:@selector(contentObjectAdded:) 56 name:Content_ContentObjectAdded 57 object:nil]; 58 58 } 59 59 … … 160 160 id contact; 161 161 162 NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact uniqueContainedObjects] objectEnumerator];162 NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact listContacts] objectEnumerator]; 163 163 164 164 while(contact = [contactEnumerator nextObject]) … … 229 229 unsigned long long size = 0; 230 230 231 NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact uniqueContainedObjects] objectEnumerator];231 NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact listContacts] objectEnumerator]; 232 232 233 233 while(contact = [contactEnumerator nextObject]) … … 272 272 * @brief Sort by log size 273 273 */ 274 NSComparisonResult logSizeSort(id objectA, id objectB, BOOL groups, id<AIContainingObject> container) 275 { 276 // Borrowed from AISortController.m 277 BOOL objectAIsGroup = [objectA isKindOfClass:[AIListGroup class]]; 278 BOOL objectBIsGroup = [objectB isKindOfClass:[AIListGroup class]]; 279 280 if(groups || (objectAIsGroup && objectBIsGroup)) 274 int logSizeSort(id objectA, id objectB, BOOL groups) 275 { 276 if(groups) 281 277 { 282 278 // Keep groups in manual order (borrowed from ESStatusSort) 283 if ([ container orderIndexForObject:objectA] > [container orderIndexForObject:objectB])279 if ([objectA orderIndex] > [objectB orderIndex]) 284 280 { 285 281 return NSOrderedDescending; … … 289 285 return NSOrderedAscending; 290 286 } 291 }292 293 // Catch cases where only one of the objects is a group294 if(objectAIsGroup && !objectBIsGroup)295 {296 return NSOrderedAscending;297 }298 else if(!objectAIsGroup && objectBIsGroup)299 {300 return NSOrderedDescending;301 287 } 302 288 303 289 // Get a reference to one and only AILogSizeSort instance. If this sorting method is being 304 290 // called, it should always be the case that AILogSizeSort is the active sort controller. 305 AISortController *sortController = [ AISortControlleractiveSortController];291 AISortController *sortController = [[adium contactController] activeSortController]; 306 292 307 293 unsigned long long sizeA = 0; -
/Trunk/SortByLogSizePlugin.xcodeproj/project.pbxproj
r28 r9 8 8 9 9 /* Begin PBXBuildFile section */ 10 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 10 11 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; 11 12 FC1983600E900AF10021C71E /* AILogSizeSort.m in Sources */ = {isa = PBXBuildFile; fileRef = FC19835F0E900AF10021C71E /* AILogSizeSort.m */; }; 12 FC22EC220FD36AAD00754E18 /* Adium.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC22EC200FD36AAD00754E18 /* Adium.framework */; }; 13 FC22EC230FD36AAD00754E18 /* AIUtilities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC22EC210FD36AAD00754E18 /* AIUtilities.framework */; }; 14 FC22EC270FD36ACF00754E18 /* FriBidi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC22EC260FD36ACF00754E18 /* FriBidi.framework */; }; 15 FC2CD0D40FD4A09E009FD00C /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = FC2CD0D30FD4A09E009FD00C /* Localizable.strings */; }; 13 FCB319640E8FF7A200D88232 /* Adium.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FCB319610E8FF7A200D88232 /* Adium.framework */; }; 14 FCB319650E8FF7A200D88232 /* AIUtilities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FCB319620E8FF7A200D88232 /* AIUtilities.framework */; }; 15 FCB319660E8FF7A200D88232 /* FriBidi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FCB319630E8FF7A200D88232 /* FriBidi.framework */; }; 16 16 FCB319740E8FF80C00D88232 /* ABSortByLogSizePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = FCB319730E8FF80C00D88232 /* ABSortByLogSizePlugin.m */; }; 17 17 /* End PBXBuildFile section */ … … 19 19 /* Begin PBXFileReference section */ 20 20 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; }; 21 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 21 22 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; 22 23 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; … … 28 29 FC19835F0E900AF10021C71E /* AILogSizeSort.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AILogSizeSort.m; sourceTree = "<group>"; }; 29 30 FC1985880E90600B0021C71E /* AILoggerPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AILoggerPlugin.h; sourceTree = "<group>"; }; 30 FC22EC200FD36AAD00754E18 /* Adium.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Adium.framework; path = "../adium-1.4/build/Debug/Adium.framework"; sourceTree = SOURCE_ROOT; }; 31 FC22EC210FD36AAD00754E18 /* AIUtilities.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AIUtilities.framework; path = "../adium-1.4/build/Debug/AIUtilities.framework"; sourceTree = SOURCE_ROOT; }; 32 FC22EC260FD36ACF00754E18 /* FriBidi.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FriBidi.framework; path = "../adium-1.4/build/Debug/FriBidi.framework"; sourceTree = SOURCE_ROOT; }; 33 FC2CD0D50FD4A0AF009FD00C /* en */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; }; 31 FCB319610E8FF7A200D88232 /* Adium.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Adium.framework; sourceTree = "<group>"; }; 32 FCB319620E8FF7A200D88232 /* AIUtilities.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AIUtilities.framework; sourceTree = "<group>"; }; 33 FCB319630E8FF7A200D88232 /* FriBidi.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FriBidi.framework; sourceTree = "<group>"; }; 34 34 FCB319720E8FF80C00D88232 /* ABSortByLogSizePlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABSortByLogSizePlugin.h; sourceTree = "<group>"; }; 35 35 FCB319730E8FF80C00D88232 /* ABSortByLogSizePlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ABSortByLogSizePlugin.m; sourceTree = "<group>"; }; 36 FCDC9E790FD4B9F300B2F353 /* es */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };37 FCDC9E7A0FD4BA0B00B2F353 /* fr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };38 FCDC9E7B0FD4BA1700B2F353 /* is */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = is; path = is.lproj/Localizable.strings; sourceTree = "<group>"; };39 FCDC9E7E0FD4BA7100B2F353 /* sv */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = "<group>"; };40 FCDC9E7F0FD4BA8600B2F353 /* de */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };41 36 /* End PBXFileReference section */ 42 37 … … 47 42 files = ( 48 43 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */, 49 FC 22EC220FD36AAD00754E18/* Adium.framework in Frameworks */,50 FC 22EC230FD36AAD00754E18/* AIUtilities.framework in Frameworks */,51 FC 22EC270FD36ACF00754E18/* FriBidi.framework in Frameworks */,44 FCB319640E8FF7A200D88232 /* Adium.framework in Frameworks */, 45 FCB319650E8FF7A200D88232 /* AIUtilities.framework in Frameworks */, 46 FCB319660E8FF7A200D88232 /* FriBidi.framework in Frameworks */, 52 47 ); 53 48 runOnlyForDeploymentPostprocessing = 0; … … 71 66 isa = PBXGroup; 72 67 children = ( 73 FC 22EC260FD36ACF00754E18 /* FriBidi.framework */,74 FC 22EC200FD36AAD00754E18 /* Adium.framework */,75 FC 22EC210FD36AAD00754E18 /* AIUtilities.framework */,68 FCB319610E8FF7A200D88232 /* Adium.framework */, 69 FCB319620E8FF7A200D88232 /* AIUtilities.framework */, 70 FCB319630E8FF7A200D88232 /* FriBidi.framework */, 76 71 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */, 77 72 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */, … … 84 79 children = ( 85 80 8D5B49B7048680CD000E48DA /* Info.plist */, 86 FC2CD0D30FD4A09E009FD00C /* Localizable.strings */,81 089C167DFE841241C02AAC07 /* InfoPlist.strings */, 87 82 ); 88 83 name = Resources; … … 164 159 compatibilityVersion = "Xcode 3.1"; 165 160 hasScannedForEncodings = 1; 166 knownRegions = (167 English,168 Japanese,169 French,170 German,171 en,172 fr,173 de,174 es,175 is,176 sv,177 );178 161 mainGroup = 089C166AFE841209C02AAC07 /* SortByLogSizePlugin */; 179 162 projectDirPath = ""; … … 190 173 buildActionMask = 2147483647; 191 174 files = ( 192 FC2CD0D40FD4A09E009FD00C /* Localizable.strings in Resources */,175 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */, 193 176 ); 194 177 runOnlyForDeploymentPostprocessing = 0; … … 209 192 210 193 /* Begin PBXVariantGroup section */ 211 FC2CD0D30FD4A09E009FD00C /* Localizable.strings */ = {194 089C167DFE841241C02AAC07 /* InfoPlist.strings */ = { 212 195 isa = PBXVariantGroup; 213 196 children = ( 214 FCDC9E7F0FD4BA8600B2F353 /* de */, 215 FC2CD0D50FD4A0AF009FD00C /* en */, 216 FCDC9E790FD4B9F300B2F353 /* es */, 217 FCDC9E7A0FD4BA0B00B2F353 /* fr */, 218 FCDC9E7B0FD4BA1700B2F353 /* is */, 219 FCDC9E7E0FD4BA7100B2F353 /* sv */, 220 ); 221 name = Localizable.strings; 197 089C167EFE841241C02AAC07 /* English */, 198 ); 199 name = InfoPlist.strings; 222 200 sourceTree = "<group>"; 223 201 }; … … 233 211 "$(inherited)", 234 212 "\"$(SRCROOT)\"", 235 "\"$(SRCROOT)/../adium-1.4/build/Debug\"",236 213 ); 237 214 GCC_DYNAMIC_NO_PIC = NO; … … 249 226 ); 250 227 PRODUCT_NAME = SortByLogSizePlugin; 251 SDKROOT = macosx10.5;252 228 WRAPPER_EXTENSION = AdiumPlugin; 253 229 }; … … 262 238 "$(inherited)", 263 239 "\"$(SRCROOT)\"", 264 "\"$(SRCROOT)/../adium-1.4/build/Debug\"",265 240 ); 266 241 GCC_MODEL_TUNING = G5; … … 275 250 ); 276 251 PRODUCT_NAME = SortByLogSizePlugin; 277 SDKROOT = macosx10.5;278 252 WRAPPER_EXTENSION = AdiumPlugin; 279 253 }; … … 290 264 ONLY_ACTIVE_ARCH = YES; 291 265 PREBINDING = NO; 292 SDKROOT = macosx10. 5;266 SDKROOT = macosx10.4; 293 267 }; 294 268 name = Debug; … … 302 276 GCC_WARN_UNUSED_VARIABLE = YES; 303 277 PREBINDING = NO; 304 SDKROOT = macosx10. 5;278 SDKROOT = macosx10.4; 305 279 }; 306 280 name = Release; -
/Trunk/ABSortByLogSizePlugin.m
r28 r18 23 23 #import "AILogSizeSort.h" 24 24 25 #import <AIUtilities/AITigerCompatibility.h> 26 25 27 #import <Adium/AISharedAdium.h> 26 28 #import <Adium/AIContactControllerProtocol.h> 27 #import <AIUtilities/AIStringUtilities.h>28 29 29 30 @implementation ABSortByLogSizePlugin … … 31 32 - (void)installPlugin 32 33 { 33 [ AISortController registerSortController:[[[AILogSizeSort alloc] init] autorelease]];34 [[adium contactController] registerListSortController:[[[AILogSizeSort alloc] init] autorelease]]; 34 35 } 35 36 … … 45 46 - (NSString *)pluginVersion 46 47 { 47 return @"1. 2.1";48 return @"1.1"; 48 49 } 49 50 50 51 - (NSString *)pluginDescription 51 52 { 52 return AILocalizedString(@"Allows the Adium contact list to be sorted by chat transcript file size.", nil);53 return @"Allows the Adium contact list to be sorted by chat transcript file size."; 53 54 } 54 55 -
/Trunk/AILoggerPlugin.h
r25 r4 15 15 */ 16 16 17 #import <Adium/AIPlugin.h> 17 18 18 19 #define PATH_LOGS @"/Logs" … … 45 46 NSMenuItem *viewContactLogsMenuItem; 46 47 NSMenuItem *viewContactLogsContextMenuItem; 47 NSMenuItem *viewGroupLogsContextMenuItem;48 48 49 49 //Log content search index … … 67 67 68 68 //Indexing progress 69 NSIntegerlogsToIndex;70 NSIntegerlogsIndexed;71 NSIntegerlogIndexingPauses;69 int logsToIndex; 70 int logsIndexed; 71 int logIndexingPauses; 72 72 73 73 } … … 81 81 82 82 //Log viewer 83 - (void)showLogViewerAndReindex:(id)sender;84 83 - (void)showLogViewerToSelectedContact:(id)sender; 85 84 - (void)showLogViewerToSelectedContextContact:(id)sender; … … 92 91 - (void)markLogDirtyAtPath:(NSString *)path forChat:(AIChat *)chat; 93 92 - (void)markLogDirtyAtPath:(NSString *)path; 94 - (BOOL)getIndexingProgress:( NSUInteger *)complete outOf:(NSUInteger*)total;93 - (BOOL)getIndexingProgress:(int *)complete outOf:(int *)total; 95 94 95 // 96 96 - (void)stopIndexingThreads; 97 97 - (void)dirtyAllLogs;