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