Changes in / [30:20]

Show
Ignore:
Files:
562 added
9 removed
5 modified

Legend:

Unmodified
Added
Removed
  • /Trunk/AILogSizeSort.h

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

    r28 r19  
    2020 */ 
    2121 
    22 #import <Adium/AIPlugin.h> 
     22#import "AILogSizeSort.h" 
     23#import "AILoggerPlugin.h" 
     24 
    2325#import <Adium/AISharedAdium.h> 
    2426 
     27#import <AIUtilities/AITigerCompatibility.h>  
    2528#import <AIUtilities/AIStringUtilities.h> 
    2629 
     
    3538#import <Adium/AIContentMessage.h> 
    3639 
    37 #import "AILogSizeSort.h" 
    38 #import "AILoggerPlugin.h" 
    39  
    4040@implementation AILogSizeSort 
    4141 
     
    5252         
    5353        // Listen for content addition notifications 
    54         [[NSNotificationCenter defaultCenter] addObserver:self  
    55                                                                                         selector:@selector(contentObjectAdded:)  
    56                                                                                                 name:Content_ContentObjectAdded  
    57                                                                                           object:nil]; 
     54        [[adium notificationCenter] addObserver:self  
     55                                                                  selector:@selector(contentObjectAdded:)  
     56                                                                          name:Content_ContentObjectAdded  
     57                                                                        object:nil]; 
    5858} 
    5959 
     
    160160                id contact; 
    161161                 
    162                 NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact uniqueContainedObjects] objectEnumerator]; 
     162                NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact listContacts] objectEnumerator]; 
    163163                 
    164164                while(contact = [contactEnumerator nextObject]) 
     
    229229                unsigned long long size = 0; 
    230230                 
    231                 NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact uniqueContainedObjects] objectEnumerator]; 
     231                NSEnumerator *contactEnumerator = [[(AIMetaContact *)listContact listContacts] objectEnumerator]; 
    232232 
    233233                while(contact = [contactEnumerator nextObject]) 
     
    272272 * @brief Sort by log size 
    273273 */ 
    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)) 
     274int logSizeSort(id objectA, id objectB, BOOL groups) 
     275{ 
     276        if(groups) 
    281277        { 
    282278                // Keep groups in manual order (borrowed from ESStatusSort) 
    283                 if ([container orderIndexForObject:objectA] > [container orderIndexForObject:objectB]) 
     279                if ([objectA orderIndex] > [objectB orderIndex]) 
    284280                { 
    285281                        return NSOrderedDescending; 
     
    289285                        return NSOrderedAscending; 
    290286                } 
    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; 
    301287        } 
    302288         
    303289        // Get a reference to one and only AILogSizeSort instance.  If this sorting method is being 
    304290        // called, it should always be the case that AILogSizeSort is the active sort controller. 
    305         AISortController *sortController = [AISortController activeSortController]; 
     291        AISortController *sortController = [[adium contactController] activeSortController]; 
    306292         
    307293        unsigned long long sizeA = 0; 
  • /Trunk/SortByLogSizePlugin.xcodeproj/project.pbxproj

    r28 r9  
    88 
    99/* Begin PBXBuildFile section */ 
     10                8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 
    1011                8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; 
    1112                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 */; }; 
    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>"; }; 
    2122                089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; 
    2223                1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 
     
    2829                FC19835F0E900AF10021C71E /* AILogSizeSort.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AILogSizeSort.m; sourceTree = "<group>"; }; 
    2930                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>"; }; 
    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>"; }; 
    4136/* End PBXFileReference section */ 
    4237 
     
    4742                        files = ( 
    4843                                8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */, 
    49                                 FC22EC220FD36AAD00754E18 /* Adium.framework in Frameworks */, 
    50                                 FC22EC230FD36AAD00754E18 /* AIUtilities.framework in Frameworks */, 
    51                                 FC22EC270FD36ACF00754E18 /* FriBidi.framework in Frameworks */, 
     44                                FCB319640E8FF7A200D88232 /* Adium.framework in Frameworks */, 
     45                                FCB319650E8FF7A200D88232 /* AIUtilities.framework in Frameworks */, 
     46                                FCB319660E8FF7A200D88232 /* FriBidi.framework in Frameworks */, 
    5247                        ); 
    5348                        runOnlyForDeploymentPostprocessing = 0; 
     
    7166                        isa = PBXGroup; 
    7267                        children = ( 
    73                                 FC22EC260FD36ACF00754E18 /* FriBidi.framework */, 
    74                                 FC22EC200FD36AAD00754E18 /* Adium.framework */, 
    75                                 FC22EC210FD36AAD00754E18 /* AIUtilities.framework */, 
     68                                FCB319610E8FF7A200D88232 /* Adium.framework */, 
     69                                FCB319620E8FF7A200D88232 /* AIUtilities.framework */, 
     70                                FCB319630E8FF7A200D88232 /* FriBidi.framework */, 
    7671                                1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */, 
    7772                                1058C7AEFEA557BF11CA2CBB /* Other Frameworks */, 
     
    8479                        children = ( 
    8580                                8D5B49B7048680CD000E48DA /* Info.plist */, 
    86                                 FC2CD0D30FD4A09E009FD00C /* Localizable.strings */, 
     81                                089C167DFE841241C02AAC07 /* InfoPlist.strings */, 
    8782                        ); 
    8883                        name = Resources; 
     
    164159                        compatibilityVersion = "Xcode 3.1"; 
    165160                        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                         ); 
    178161                        mainGroup = 089C166AFE841209C02AAC07 /* SortByLogSizePlugin */; 
    179162                        projectDirPath = ""; 
     
    190173                        buildActionMask = 2147483647; 
    191174                        files = ( 
    192                                 FC2CD0D40FD4A09E009FD00C /* Localizable.strings in Resources */, 
     175                                8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */, 
    193176                        ); 
    194177                        runOnlyForDeploymentPostprocessing = 0; 
     
    209192 
    210193/* Begin PBXVariantGroup section */ 
    211                 FC2CD0D30FD4A09E009FD00C /* Localizable.strings */ = { 
     194                089C167DFE841241C02AAC07 /* InfoPlist.strings */ = { 
    212195                        isa = PBXVariantGroup; 
    213196                        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; 
    222200                        sourceTree = "<group>"; 
    223201                }; 
     
    233211                                        "$(inherited)", 
    234212                                        "\"$(SRCROOT)\"", 
    235                                         "\"$(SRCROOT)/../adium-1.4/build/Debug\"", 
    236213                                ); 
    237214                                GCC_DYNAMIC_NO_PIC = NO; 
     
    249226                                ); 
    250227                                PRODUCT_NAME = SortByLogSizePlugin; 
    251                                 SDKROOT = macosx10.5; 
    252228                                WRAPPER_EXTENSION = AdiumPlugin; 
    253229                        }; 
     
    262238                                        "$(inherited)", 
    263239                                        "\"$(SRCROOT)\"", 
    264                                         "\"$(SRCROOT)/../adium-1.4/build/Debug\"", 
    265240                                ); 
    266241                                GCC_MODEL_TUNING = G5; 
     
    275250                                ); 
    276251                                PRODUCT_NAME = SortByLogSizePlugin; 
    277                                 SDKROOT = macosx10.5; 
    278252                                WRAPPER_EXTENSION = AdiumPlugin; 
    279253                        }; 
     
    290264                                ONLY_ACTIVE_ARCH = YES; 
    291265                                PREBINDING = NO; 
    292                                 SDKROOT = macosx10.5; 
     266                                SDKROOT = macosx10.4; 
    293267                        }; 
    294268                        name = Debug; 
     
    302276                                GCC_WARN_UNUSED_VARIABLE = YES; 
    303277                                PREBINDING = NO; 
    304                                 SDKROOT = macosx10.5; 
     278                                SDKROOT = macosx10.4; 
    305279                        }; 
    306280                        name = Release; 
  • /Trunk/ABSortByLogSizePlugin.m

    r28 r18  
    2323#import "AILogSizeSort.h" 
    2424 
     25#import <AIUtilities/AITigerCompatibility.h>  
     26 
    2527#import <Adium/AISharedAdium.h> 
    2628#import <Adium/AIContactControllerProtocol.h> 
    27 #import <AIUtilities/AIStringUtilities.h> 
    2829 
    2930@implementation ABSortByLogSizePlugin 
     
    3132- (void)installPlugin 
    3233{ 
    33         [AISortController registerSortController:[[[AILogSizeSort alloc] init] autorelease]]; 
     34        [[adium contactController] registerListSortController:[[[AILogSizeSort alloc] init] autorelease]]; 
    3435} 
    3536 
     
    4546- (NSString *)pluginVersion 
    4647{ 
    47         return @"1.2.1"; 
     48        return @"1.1"; 
    4849} 
    4950 
    5051- (NSString *)pluginDescription 
    5152{ 
    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."; 
    5354} 
    5455 
  • /Trunk/AILoggerPlugin.h

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