Changes in / [20:30]

Show
Ignore:
Files:
638 added
4 removed
5 modified

Legend:

Unmodified
Added
Removed
  • /Trunk/AILogSizeSort.h

    r19 r24  
    2020 */ 
    2121 
    22 #import <AIUtilities/AITigerCompatibility.h>  
    23  
    2422#import <Adium/AISortController.h> 
    2523#import <Adium/AIListContact.h> 
  • /Trunk/AILogSizeSort.m

    r19 r28  
    2020 */ 
    2121 
    22 #import "AILogSizeSort.h" 
    23 #import "AILoggerPlugin.h" 
    24  
     22#import <Adium/AIPlugin.h> 
    2523#import <Adium/AISharedAdium.h> 
    2624 
    27 #import <AIUtilities/AITigerCompatibility.h>  
    2825#import <AIUtilities/AIStringUtilities.h> 
    2926 
     
    3835#import <Adium/AIContentMessage.h> 
    3936 
     37#import "AILogSizeSort.h" 
     38#import "AILoggerPlugin.h" 
     39 
    4040@implementation AILogSizeSort 
    4141 
     
    5252         
    5353        // Listen for content addition notifications 
    54         [[adium notificationCenter] addObserver:self  
    55                                                                   selector:@selector(contentObjectAdded:)  
    56                                                                           name:Content_ContentObjectAdded  
    57                                                                         object:nil]; 
     54        [[NSNotificationCenter defaultCenter] addObserver:self  
     55                                                                                        selector:@selector(contentObjectAdded:)  
     56                                                                                                name:Content_ContentObjectAdded  
     57                                                                                          object:nil]; 
    5858} 
    5959 
     
    160160                id contact; 
    161161                 
    162                 NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact listContacts] objectEnumerator]; 
     162                NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact uniqueContainedObjects] objectEnumerator]; 
    163163                 
    164164                while(contact = [contactEnumerator nextObject]) 
     
    229229                unsigned long long size = 0; 
    230230                 
    231                 NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact listContacts] objectEnumerator]; 
     231                NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact uniqueContainedObjects] objectEnumerator]; 
    232232 
    233233                while(contact = [contactEnumerator nextObject]) 
     
    272272 * @brief Sort by log size 
    273273 */ 
    274 int logSizeSort(id objectA, id objectB, BOOL groups) 
    275 { 
    276         if(groups) 
     274NSComparisonResult 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)) 
    277281        { 
    278282                // Keep groups in manual order (borrowed from ESStatusSort) 
    279                 if ([objectA orderIndex] > [objectB orderIndex]) 
     283                if ([container orderIndexForObject:objectA] > [container orderIndexForObject:objectB]) 
    280284                { 
    281285                        return NSOrderedDescending; 
     
    285289                        return NSOrderedAscending; 
    286290                } 
     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; 
    287301        } 
    288302         
    289303        // Get a reference to one and only AILogSizeSort instance.  If this sorting method is being 
    290304        // 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]; 
    292306         
    293307        unsigned long long sizeA = 0; 
  • /Trunk/SortByLogSizePlugin.xcodeproj/project.pbxproj

    r9 r28  
    88 
    99/* Begin PBXBuildFile section */ 
    10                 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 
    1110                8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; 
    1211                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 */; }; 
    1616                FCB319740E8FF80C00D88232 /* ABSortByLogSizePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = FCB319730E8FF80C00D88232 /* ABSortByLogSizePlugin.m */; }; 
    1717/* End PBXBuildFile section */ 
     
    1919/* Begin PBXFileReference section */ 
    2020                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>"; }; 
    2221                089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; 
    2322                1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 
     
    2928                FC19835F0E900AF10021C71E /* AILogSizeSort.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AILogSizeSort.m; sourceTree = "<group>"; }; 
    3029                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>"; }; 
    3434                FCB319720E8FF80C00D88232 /* ABSortByLogSizePlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABSortByLogSizePlugin.h; sourceTree = "<group>"; }; 
    3535                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>"; }; 
    3641/* End PBXFileReference section */ 
    3742 
     
    4247                        files = ( 
    4348                                8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */, 
    44                                 FCB319640E8FF7A200D88232 /* Adium.framework in Frameworks */, 
    45                                 FCB319650E8FF7A200D88232 /* AIUtilities.framework in Frameworks */, 
    46                                 FCB319660E8FF7A200D88232 /* FriBidi.framework in Frameworks */, 
     49                                FC22EC220FD36AAD00754E18 /* Adium.framework in Frameworks */, 
     50                                FC22EC230FD36AAD00754E18 /* AIUtilities.framework in Frameworks */, 
     51                                FC22EC270FD36ACF00754E18 /* FriBidi.framework in Frameworks */, 
    4752                        ); 
    4853                        runOnlyForDeploymentPostprocessing = 0; 
     
    6671                        isa = PBXGroup; 
    6772                        children = ( 
    68                                 FCB319610E8FF7A200D88232 /* Adium.framework */, 
    69                                 FCB319620E8FF7A200D88232 /* AIUtilities.framework */, 
    70                                 FCB319630E8FF7A200D88232 /* FriBidi.framework */, 
     73                                FC22EC260FD36ACF00754E18 /* FriBidi.framework */, 
     74                                FC22EC200FD36AAD00754E18 /* Adium.framework */, 
     75                                FC22EC210FD36AAD00754E18 /* AIUtilities.framework */, 
    7176                                1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */, 
    7277                                1058C7AEFEA557BF11CA2CBB /* Other Frameworks */, 
     
    7984                        children = ( 
    8085                                8D5B49B7048680CD000E48DA /* Info.plist */, 
    81                                 089C167DFE841241C02AAC07 /* InfoPlist.strings */, 
     86                                FC2CD0D30FD4A09E009FD00C /* Localizable.strings */, 
    8287                        ); 
    8388                        name = Resources; 
     
    159164                        compatibilityVersion = "Xcode 3.1"; 
    160165                        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                        ); 
    161178                        mainGroup = 089C166AFE841209C02AAC07 /* SortByLogSizePlugin */; 
    162179                        projectDirPath = ""; 
     
    173190                        buildActionMask = 2147483647; 
    174191                        files = ( 
    175                                 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */, 
     192                                FC2CD0D40FD4A09E009FD00C /* Localizable.strings in Resources */, 
    176193                        ); 
    177194                        runOnlyForDeploymentPostprocessing = 0; 
     
    192209 
    193210/* Begin PBXVariantGroup section */ 
    194                 089C167DFE841241C02AAC07 /* InfoPlist.strings */ = { 
     211                FC2CD0D30FD4A09E009FD00C /* Localizable.strings */ = { 
    195212                        isa = PBXVariantGroup; 
    196213                        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; 
    200222                        sourceTree = "<group>"; 
    201223                }; 
     
    211233                                        "$(inherited)", 
    212234                                        "\"$(SRCROOT)\"", 
     235                                        "\"$(SRCROOT)/../adium-1.4/build/Debug\"", 
    213236                                ); 
    214237                                GCC_DYNAMIC_NO_PIC = NO; 
     
    226249                                ); 
    227250                                PRODUCT_NAME = SortByLogSizePlugin; 
     251                                SDKROOT = macosx10.5; 
    228252                                WRAPPER_EXTENSION = AdiumPlugin; 
    229253                        }; 
     
    238262                                        "$(inherited)", 
    239263                                        "\"$(SRCROOT)\"", 
     264                                        "\"$(SRCROOT)/../adium-1.4/build/Debug\"", 
    240265                                ); 
    241266                                GCC_MODEL_TUNING = G5; 
     
    250275                                ); 
    251276                                PRODUCT_NAME = SortByLogSizePlugin; 
     277                                SDKROOT = macosx10.5; 
    252278                                WRAPPER_EXTENSION = AdiumPlugin; 
    253279                        }; 
     
    264290                                ONLY_ACTIVE_ARCH = YES; 
    265291                                PREBINDING = NO; 
    266                                 SDKROOT = macosx10.4; 
     292                                SDKROOT = macosx10.5; 
    267293                        }; 
    268294                        name = Debug; 
     
    276302                                GCC_WARN_UNUSED_VARIABLE = YES; 
    277303                                PREBINDING = NO; 
    278                                 SDKROOT = macosx10.4; 
     304                                SDKROOT = macosx10.5; 
    279305                        }; 
    280306                        name = Release; 
  • /Trunk/ABSortByLogSizePlugin.m

    r18 r28  
    2323#import "AILogSizeSort.h" 
    2424 
    25 #import <AIUtilities/AITigerCompatibility.h>  
    26  
    2725#import <Adium/AISharedAdium.h> 
    2826#import <Adium/AIContactControllerProtocol.h> 
     27#import <AIUtilities/AIStringUtilities.h> 
    2928 
    3029@implementation ABSortByLogSizePlugin 
     
    3231- (void)installPlugin 
    3332{ 
    34         [[adium contactController] registerListSortController:[[[AILogSizeSort alloc] init] autorelease]]; 
     33        [AISortController registerSortController:[[[AILogSizeSort alloc] init] autorelease]]; 
    3534} 
    3635 
     
    4645- (NSString *)pluginVersion 
    4746{ 
    48         return @"1.1"; 
     47        return @"1.2.1"; 
    4948} 
    5049 
    5150- (NSString *)pluginDescription 
    5251{ 
    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); 
    5453} 
    5554 
  • /Trunk/AILoggerPlugin.h

    r4 r25  
    1515 */ 
    1616 
    17 #import <Adium/AIPlugin.h> 
    1817 
    1918#define PATH_LOGS                       @"/Logs" 
     
    4645    NSMenuItem                          *viewContactLogsMenuItem; 
    4746    NSMenuItem                          *viewContactLogsContextMenuItem; 
     47        NSMenuItem                                                      *viewGroupLogsContextMenuItem; 
    4848 
    4949    //Log content search index 
     
    6767     
    6868    //Indexing progress 
    69     int                                 logsToIndex; 
    70     int                                 logsIndexed; 
    71         int                                     logIndexingPauses; 
     69    NSInteger                                   logsToIndex; 
     70    NSInteger                                   logsIndexed; 
     71        NSInteger                                       logIndexingPauses; 
    7272     
    7373} 
     
    8181 
    8282//Log viewer 
     83- (void)showLogViewerAndReindex:(id)sender; 
    8384- (void)showLogViewerToSelectedContact:(id)sender; 
    8485- (void)showLogViewerToSelectedContextContact:(id)sender; 
     
    9192- (void)markLogDirtyAtPath:(NSString *)path forChat:(AIChat *)chat; 
    9293- (void)markLogDirtyAtPath:(NSString *)path; 
    93 - (BOOL)getIndexingProgress:(int *)complete outOf:(int *)total; 
     94- (BOOL)getIndexingProgress:(NSUInteger *)complete outOf:(NSUInteger *)total; 
    9495 
    95 // 
    9696- (void)stopIndexingThreads; 
    9797- (void)dirtyAllLogs;