Changeset 3219

Show
Ignore:
Timestamp:
04/26/06 23:25:10 (2 years ago)
Author:
timothy
Message:

Code clean up. SOme sidebar fixes, still broken. Added some unit tests, will expanded in the future.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Colloquy.xcodeproj/project.pbxproj

    r3214 r3219  
    5858                1C51B4C7052DE14B00BB459B /* JVStandardCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C3B4D570427BD5200000102 /* JVStandardCommands.m */; }; 
    5959                1C51B4C9052DE14B00BB459B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; 
     60                1C59A92009FDEBA3000682B8 /* JVChatWindowControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C59A91F09FDEBA3000682B8 /* JVChatWindowControllerTests.m */; }; 
    6061                1C5EF35B07B45C1F004E66D3 /* JVChatEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5EF35907B45C1F004E66D3 /* JVChatEvent.m */; }; 
    6162                1C5EF36C07B45FBF004E66D3 /* JVChatSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5EF36A07B45FBF004E66D3 /* JVChatSession.m */; }; 
     
    373374                        remoteInfo = "Python Support Plugin"; 
    374375                }; 
     376                1C59A9A309FDF148000682B8 /* PBXContainerItemProxy */ = { 
     377                        isa = PBXContainerItemProxy; 
     378                        containerPortal = 089C1669FE841209C02AAC07 /* Project object */; 
     379                        proxyType = 1; 
     380                        remoteGlobalIDString = 1CB2CCF5052DDC560094AAA4; 
     381                        remoteInfo = "Colloquy (Application)"; 
     382                }; 
    375383                1C7F30000855456D00D41FB0 /* PBXContainerItemProxy */ = { 
    376384                        isa = PBXContainerItemProxy; 
     
    540548                1C51B89D052DF91E00BB459B /* Info.plist */ = {isa = PBXFileReference; explicitFileType = text.xml; fileEncoding = 4; name = Info.plist; path = Resources/Info.plist; sourceTree = SOURCE_ROOT; }; 
    541549                1C5959010507803F000001C8 /* Generic.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Generic.icns; path = Resources/Generic.icns; sourceTree = SOURCE_ROOT; }; 
     550                1C59A91F09FDEBA3000682B8 /* JVChatWindowControllerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JVChatWindowControllerTests.m; path = Tests/JVChatWindowControllerTests.m; sourceTree = "<group>"; }; 
    542551                1C59BD61059E2E02001487E2 /* ChatPlugIn.scriptSuite */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = ChatPlugIn.scriptSuite; path = Resources/ChatPlugIn.scriptSuite; sourceTree = "<group>"; }; 
    543552                1C59BD63059E2E16001487E2 /* ChatPlugIn.scriptTerminology */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = ChatPlugIn.scriptTerminology; path = Resources/ChatPlugIn.scriptTerminology; sourceTree = "<group>"; }; 
     
    595604                1C77831008FA4EA2006AD8E5 /* topicToggleDown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = topicToggleDown.png; path = Resources/topicToggleDown.png; sourceTree = "<group>"; }; 
    596605                1C77831108FA4EA2006AD8E5 /* topicToggleUp.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = topicToggleUp.png; path = Resources/topicToggleUp.png; sourceTree = "<group>"; }; 
     606                1C7A60B709FDE8560029AC64 /* Colloquy Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Colloquy Tests.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; 
    597607                1C7B83C50668D732004F1EFE /* NSNotificationAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSNotificationAdditions.h; path = Additions/NSNotificationAdditions.h; sourceTree = "<group>"; }; 
    598608                1C7C76E507DBA1C100FB5F83 /* NSCoreSuite.scriptSuite */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = NSCoreSuite.scriptSuite; path = Resources/NSCoreSuite.scriptSuite; sourceTree = "<group>"; }; 
     
    10361046                        runOnlyForDeploymentPostprocessing = 0; 
    10371047                }; 
     1048                1C7A60B409FDE8560029AC64 /* Frameworks */ = { 
     1049                        isa = PBXFrameworksBuildPhase; 
     1050                        buildActionMask = 2147483647; 
     1051                        files = ( 
     1052                        ); 
     1053                        runOnlyForDeploymentPostprocessing = 0; 
     1054                }; 
    10381055                1CB2CD78052DDC560094AAA4 /* Frameworks */ = { 
    10391056                        isa = PBXFrameworksBuildPhase; 
     
    10741091                                F50B0A9F0170C89301A84BDE /* Sources & Headers */, 
    10751092                                F50B0AA00170C89301A84BDE /* Other Sources & Additions */, 
     1093                                1C59A92909FDEBC6000682B8 /* Unit Tests */, 
    10761094                                F5185C82018626F701EE70DE /* Interfaces */, 
    10771095                                F50B0AA10170C89301A84BDE /* Resources */, 
     
    11811199                        ); 
    11821200                        name = "Tabs Interface Images"; 
     1201                        sourceTree = "<group>"; 
     1202                }; 
     1203                1C59A92909FDEBC6000682B8 /* Unit Tests */ = { 
     1204                        isa = PBXGroup; 
     1205                        children = ( 
     1206                                1C59A91F09FDEBA3000682B8 /* JVChatWindowControllerTests.m */, 
     1207                        ); 
     1208                        name = "Unit Tests"; 
    11831209                        sourceTree = "<group>"; 
    11841210                }; 
     
    12431269                                1C51B4CD052DE14B00BB459B /* Standard Commands.plugin */, 
    12441270                                CBF685150820186F00F498FB /* Colloquy.mdimporter */, 
     1271                                1C7A60B709FDE8560029AC64 /* Colloquy Tests.octest */, 
    12451272                        ); 
    12461273                        name = Products; 
     
    18291856                        productType = "com.apple.product-type.bundle"; 
    18301857                }; 
     1858                1C7A60B609FDE8560029AC64 /* Colloquy Tests */ = { 
     1859                        isa = PBXNativeTarget; 
     1860                        buildConfigurationList = 1C7A60BB09FDE8580029AC64 /* Build configuration list for PBXNativeTarget "Colloquy Tests" */; 
     1861                        buildPhases = ( 
     1862                                1C7A60B209FDE8560029AC64 /* Resources */, 
     1863                                1C7A60B309FDE8560029AC64 /* Sources */, 
     1864                                1C7A60B409FDE8560029AC64 /* Frameworks */, 
     1865                                1C7A60B509FDE8560029AC64 /* Run Tests */, 
     1866                        ); 
     1867                        buildRules = ( 
     1868                        ); 
     1869                        buildSettings = { 
     1870                                GCC_ENABLE_FIX_AND_CONTINUE = NO; 
     1871                                GCC_ENABLE_OBJC_EXCEPTIONS = YES; 
     1872                                GCC_MODEL_TUNING = G5; 
     1873                                GCC_PRECOMPILE_PREFIX_HEADER = YES; 
     1874                                GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; 
     1875                                INFOPLIST_FILE = "Colloquy Tests-Info.plist"; 
     1876                                INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 
     1877                                OTHER_LDFLAGS = ( 
     1878                                        "-framework", 
     1879                                        Cocoa, 
     1880                                        "-framework", 
     1881                                        SenTestingKit, 
     1882                                ); 
     1883                                PREBINDING = NO; 
     1884                                PRODUCT_NAME = "Colloquy Tests"; 
     1885                                WRAPPER_EXTENSION = octest; 
     1886                                ZERO_LINK = NO; 
     1887                        }; 
     1888                        dependencies = ( 
     1889                                1C59A9A409FDF148000682B8 /* PBXTargetDependency */, 
     1890                        ); 
     1891                        name = "Colloquy Tests"; 
     1892                        productName = "Colloquy Tests"; 
     1893                        productReference = 1C7A60B709FDE8560029AC64 /* Colloquy Tests.octest */; 
     1894                        productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> 
     1895<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"> 
     1896<plist version=\"1.0\"> 
     1897<dict> 
     1898        <key>CFBundleDevelopmentRegion</key> 
     1899        <string>English</string> 
     1900        <key>CFBundleExecutable</key> 
     1901        <string>${EXECUTABLE_NAME}</string> 
     1902        <key>CFBundleIdentifier</key> 
     1903        <string>com.yourcompany.Colloquy Tests</string> 
     1904        <key>CFBundleInfoDictionaryVersion</key> 
     1905        <string>6.0</string> 
     1906        <key>CFBundlePackageType</key> 
     1907        <string>BNDL</string> 
     1908        <key>CFBundleSignature</key> 
     1909        <string>????</string> 
     1910        <key>CFBundleVersion</key> 
     1911        <string>1.0</string> 
     1912</dict> 
     1913</plist> 
     1914"; 
     1915                        productType = "com.apple.product-type.bundle"; 
     1916                }; 
    18311917                1CB2CCF5052DDC560094AAA4 /* Colloquy (Application) */ = { 
    18321918                        isa = PBXNativeTarget; 
     
    20102096                                1C51B4BB052DE14B00BB459B /* Standard Commands (Plug-In) */, 
    20112097                                CBF685140820186F00F498FB /* Colloquy (Metadata Importer) */, 
     2098                                1C7A60B609FDE8560029AC64 /* Colloquy Tests */, 
    20122099                        ); 
    20132100                }; 
     
    20532140 
    20542141/* Begin PBXResourcesBuildPhase section */ 
     2142                1C7A60B209FDE8560029AC64 /* Resources */ = { 
     2143                        isa = PBXResourcesBuildPhase; 
     2144                        buildActionMask = 2147483647; 
     2145                        files = ( 
     2146                        ); 
     2147                        runOnlyForDeploymentPostprocessing = 0; 
     2148                }; 
    20552149                1CB2CD0F052DDC560094AAA4 /* Resources */ = { 
    20562150                        isa = PBXResourcesBuildPhase; 
     
    22612355 
    22622356/* Begin PBXShellScriptBuildPhase section */ 
     2357                1C7A60B509FDE8560029AC64 /* Run Tests */ = { 
     2358                        isa = PBXShellScriptBuildPhase; 
     2359                        buildActionMask = 2147483647; 
     2360                        files = ( 
     2361                        ); 
     2362                        inputPaths = ( 
     2363                        ); 
     2364                        name = "Run Tests"; 
     2365                        outputPaths = ( 
     2366                        ); 
     2367                        runOnlyForDeploymentPostprocessing = 0; 
     2368                        shellPath = /bin/sh; 
     2369                        shellScript = "\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 
     2370                }; 
    22632371                1C91DEAC06972EC0007C1638 /* Remove Headers */ = { 
    22642372                        isa = PBXShellScriptBuildPhase; 
     
    23162424                        files = ( 
    23172425                                1C51B4C7052DE14B00BB459B /* JVStandardCommands.m in Sources */, 
     2426                        ); 
     2427                        runOnlyForDeploymentPostprocessing = 0; 
     2428                }; 
     2429                1C7A60B309FDE8560029AC64 /* Sources */ = { 
     2430                        isa = PBXSourcesBuildPhase; 
     2431                        buildActionMask = 2147483647; 
     2432                        files = ( 
     2433                                1C59A92009FDEBA3000682B8 /* JVChatWindowControllerTests.m in Sources */, 
    23182434                        ); 
    23192435                        runOnlyForDeploymentPostprocessing = 0; 
     
    24332549                        targetProxy = 1C0A19AE08B041A800324E25 /* PBXContainerItemProxy */; 
    24342550                }; 
     2551                1C59A9A409FDF148000682B8 /* PBXTargetDependency */ = { 
     2552                        isa = PBXTargetDependency; 
     2553                        target = 1CB2CCF5052DDC560094AAA4 /* Colloquy (Application) */; 
     2554                        targetProxy = 1C59A9A309FDF148000682B8 /* PBXContainerItemProxy */; 
     2555                }; 
    24352556                1C7F30010855456D00D41FB0 /* PBXTargetDependency */ = { 
    24362557                        isa = PBXTargetDependency; 
     
    28572978                1C041A650854E97700A5A5BA /* Release */ = { 
    28582979                        isa = XCBuildConfiguration; 
    2859                         baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    28602980                        buildSettings = { 
    28612981                                GCC_PREFIX_HEADER = "Plug-Ins/Standard Commands/Standard Commands.pch"; 
     
    28722992                1C041A660854E97700A5A5BA /* Development */ = { 
    28732993                        isa = XCBuildConfiguration; 
    2874                         baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    28752994                        buildSettings = { 
    2876                                 GCC_OPTIMIZATION_LEVEL = 0; 
    28772995                                GCC_PREFIX_HEADER = "Plug-Ins/Standard Commands/Standard Commands.pch"; 
    28782996                                INFOPLIST_FILE = "Resources/Info-StandardCommands.plist"; 
     
    28883006                1C041A690854E97700A5A5BA /* Release */ = { 
    28893007                        isa = XCBuildConfiguration; 
    2890                         baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    28913008                        buildSettings = { 
    28923009                                GCC_PREFIX_HEADER = Colloquy.pch; 
     
    29123029                1C041A6A0854E97700A5A5BA /* Development */ = { 
    29133030                        isa = XCBuildConfiguration; 
    2914                         baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    29153031                        buildSettings = { 
    2916                                 GCC_ENABLE_FIX_AND_CONTINUE = YES; 
    2917                                 GCC_OPTIMIZATION_LEVEL = 0; 
    29183032                                GCC_PREFIX_HEADER = Colloquy.pch; 
    29193033                                HEADER_SEARCH_PATHS = /usr/include/libxml2; 
     
    29253039                                PRODUCT_NAME = Colloquy; 
    29263040                                WRAPPER_EXTENSION = app; 
    2927                                 ZERO_LINK = YES; 
    29283041                        }; 
    29293042                        name = Development; 
     
    29313044                1C041A6D0854E97700A5A5BA /* Release */ = { 
    29323045                        isa = XCBuildConfiguration; 
    2933                         baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    29343046                        buildSettings = { 
    29353047                                GCC_FAST_OBJC_DISPATCH = YES; 
     
    29443056                1C041A6E0854E97700A5A5BA /* Development */ = { 
    29453057                        isa = XCBuildConfiguration; 
    2946                         baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    29473058                        buildSettings = { 
    29483059                                GCC_FAST_OBJC_DISPATCH = YES; 
     
    29573068                1C041A710854E97700A5A5BA /* Release */ = { 
    29583069                        isa = XCBuildConfiguration; 
     3070                        baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    29593071                        buildSettings = { 
    29603072                        }; 
     
    29633075                1C041A720854E97700A5A5BA /* Development */ = { 
    29643076                        isa = XCBuildConfiguration; 
     3077                        baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    29653078                        buildSettings = { 
    2966                                 GCC_ENABLE_FIX_AND_CONTINUE = YES; 
    29673079                                GCC_OPTIMIZATION_LEVEL = 0; 
    29683080                                GCC_PREPROCESSOR_DEFINITIONS = DEBUG; 
    2969                                 PREBINDING = NO; 
    2970                                 ZERO_LINK = YES; 
    29713081                        }; 
    29723082                        name = Development; 
     
    29743084                1C041DC90855377900A5A5BA /* Release (Universal) */ = { 
    29753085                        isa = XCBuildConfiguration; 
    2976                         baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    29773086                        buildSettings = { 
    29783087                                GCC_PREFIX_HEADER = "Plug-Ins/Standard Commands/Standard Commands.pch"; 
     
    29893098                1C041DCA0855377900A5A5BA /* Release (Universal) */ = { 
    29903099                        isa = XCBuildConfiguration; 
    2991                         baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    29923100                        buildSettings = { 
    29933101                                GCC_PREFIX_HEADER = Colloquy.pch; 
     
    30133121                1C041DCB0855377900A5A5BA /* Release (Universal) */ = { 
    30143122                        isa = XCBuildConfiguration; 
    3015                         baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    30163123                        buildSettings = { 
    30173124                                GCC_FAST_OBJC_DISPATCH = YES; 
     
    30263133                1C041DCC0855377900A5A5BA /* Release (Universal) */ = { 
    30273134                        isa = XCBuildConfiguration; 
     3135                        baseConfigurationReference = 1C6A13ED08666E62009EE6D2 /* Common Settings.xcconfig */; 
    30283136                        buildSettings = { 
    30293137                                ARCHS = ( 
     
    30343142                        }; 
    30353143                        name = "Release (Universal)"; 
     3144                }; 
     3145                1C7A60BC09FDE8580029AC64 /* Release */ = { 
     3146                        isa = XCBuildConfiguration; 
     3147                        buildSettings = { 
     3148                                BUNDLE_LOADER = "$(TEST_HOST)"; 
     3149                                GCC_FAST_OBJC_DISPATCH = YES; 
     3150                                INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 
     3151                                OTHER_LDFLAGS = ( 
     3152                                        "-framework", 
     3153                                        Cocoa, 
     3154                                        "-framework", 
     3155                                        SenTestingKit, 
     3156                                ); 
     3157                                PRODUCT_NAME = "Colloquy Tests"; 
     3158                                TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Colloquy.app/Contents/MacOS/Colloquy"; 
     3159                                WRAPPER_EXTENSION = octest; 
     3160                        }; 
     3161                        name = Release; 
     3162                }; 
     3163                1C7A60BD09FDE8580029AC64 /* Release (Universal) */ = { 
     3164                        isa = XCBuildConfiguration; 
     3165                        buildSettings = { 
     3166                                BUNDLE_LOADER = "$(TEST_HOST)"; 
     3167                                GCC_FAST_OBJC_DISPATCH = YES; 
     3168                                INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 
     3169                                OTHER_LDFLAGS = ( 
     3170                                        "-framework", 
     3171                                        Cocoa, 
     3172                                        "-framework", 
     3173                                        SenTestingKit, 
     3174                                ); 
     3175                                PRODUCT_NAME = "Colloquy Tests"; 
     3176                                TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Colloquy.app/Contents/MacOS/Colloquy"; 
     3177                                WRAPPER_EXTENSION = octest; 
     3178                        }; 
     3179                        name = "Release (Universal)"; 
     3180                }; 
     3181                1C7A60BE09FDE8580029AC64 /* Development */ = { 
     3182                        isa = XCBuildConfiguration; 
     3183                        buildSettings = { 
     3184                                BUNDLE_LOADER = "$(TEST_HOST)"; 
     3185                                GCC_FAST_OBJC_DISPATCH = YES; 
     3186                                INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; 
     3187                                OTHER_LDFLAGS = ( 
     3188                                        "-framework", 
     3189                                        Cocoa, 
     3190                                        "-framework", 
     3191                                        SenTestingKit, 
     3192                                ); 
     3193                                PRODUCT_NAME = "Colloquy Tests"; 
     3194                                TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Colloquy.app/Contents/MacOS/Colloquy"; 
     3195                                WRAPPER_EXTENSION = octest; 
     3196                        }; 
     3197                        name = Development; 
    30363198                }; 
    30373199/* End XCBuildConfiguration section */ 
     
    30783240                        defaultConfigurationName = Release; 
    30793241                }; 
     3242                1C7A60BB09FDE8580029AC64 /* Build configuration list for PBXNativeTarget "Colloquy Tests" */ = { 
     3243                        isa = XCConfigurationList; 
     3244                        buildConfigurations = ( 
     3245                                1C7A60BC09FDE8580029AC64 /* Release */, 
     3246                                1C7A60BD09FDE8580029AC64 /* Release (Universal) */, 
     3247                                1C7A60BE09FDE8580029AC64 /* Development */, 
     3248                        ); 
     3249                        defaultConfigurationIsVisible = 0; 
     3250                        defaultConfigurationName = Release; 
     3251                }; 
    30803252/* End XCConfigurationList section */ 
    30813253        }; 
  • trunk/Controllers/JVChatController.h

    r3072 r3219  
    1515@interface JVChatController : NSObject { 
    1616        @private 
    17         NSMutableArray *_chatWindows; 
    18         NSMutableArray *_chatControllers; 
     17        NSMutableSet *_chatWindows; 
     18        NSMutableSet *_chatControllers; 
    1919        NSArray *_windowRuleSets; 
    2020} 
  • trunk/Controllers/JVChatController.m

    r3206 r3219  
    7979- (id) init { 
    8080        if( ( self = [super init] ) ) { 
    81                 _chatWindows = [[NSMutableArray allocWithZone:nil] init]; 
    82                 _chatControllers = [[NSMutableArray allocWithZone:nil] init]; 
    83  
    84                 _windowRuleSets = nil; 
     81                _chatWindows = [[NSMutableSet allocWithZone:nil] initWithCapacity:5]; 
     82                _chatControllers = [[NSMutableSet allocWithZone:nil] initWithCapacity:50]; 
     83 
    8584                [self _reloadPreferedWindowRuleSets]; 
    8685 
     
    190189 
    191190- (NSSet *) allChatWindowControllers { 
    192         return [NSSet setWithArray:_chatWindows]; 
     191        return [NSSet setWithSet:_chatWindows]; 
    193192} 
    194193 
     
    235234 
    236235- (NSSet *) allChatViewControllers { 
    237         return [NSSet setWithArray:_chatControllers]; 
     236        return [NSSet setWithSet:_chatControllers]; 
    238237} 
    239238 
  • trunk/Controllers/JVChatWindowController.m

    r3214 r3219  
    5050- (id) initWithWindowNibName:(NSString *) windowNibName { 
    5151        if( ( self = [super initWithWindowNibName:windowNibName] ) ) { 
    52                 viewsDrawer = nil; 
    53                 chatViewsOutlineView = nil; 
    54                 viewActionButton = nil; 
    55                 favoritesButton = nil; 
    56                 _activeViewController = nil; 
    57                 _identifier = nil; 
    58                 _views = [[NSMutableArray array] retain]; 
    59                 _usesSmallIcons = NO; 
    60                 _settings = [[NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults] dictionaryForKey:[self userDefaultsPreferencesKey]]] retain]; 
     52                _views = [[NSMutableArray allocWithZone:nil] initWithCapacity:10]; 
     53                _settings = [[NSMutableDictionary allocWithZone:nil] initWithDictionary:[[NSUserDefaults standardUserDefaults] dictionaryForKey:[self userDefaultsPreferencesKey]]]; 
    6154        } 
    6255 
     
    6659- (void) windowDidLoad { 
    6760        NSTableColumn *column = [chatViewsOutlineView outlineTableColumn]; 
    68         JVDetailCell *prototypeCell = [[JVDetailCell new] autorelease]; 
     61        JVDetailCell *prototypeCell = [[JVDetailCell allocWithZone:nil] init]; 
    6962        [prototypeCell setFont:[NSFont toolTipsFontOfSize:11.]]; 
    7063        [column setDataCell:prototypeCell]; 
     64        [prototypeCell release]; 
    7165 
    7266        [chatViewsOutlineView setRefusesFirstResponder:YES]; 
     
    7468        [chatViewsOutlineView setDoubleAction:@selector( _doubleClickedListItem: )]; 
    7569        [chatViewsOutlineView setAutoresizesOutlineColumn:YES]; 
    76         [chatViewsOutlineView setMenu:[[[NSMenu alloc] initWithTitle:@""] autorelease]]; 
    7770        [chatViewsOutlineView registerForDraggedTypes:[NSArray arrayWithObjects:JVChatViewPboardType, NSFilenamesPboardType, nil]]; 
     71        [chatViewsOutlineView setMenu:nil]; 
    7872 
    7973        [favoritesButton setMenu:[MVConnectionsController favoritesMenu]]; 
     
    10498 
    10599- (void) dealloc { 
    106         [[self window] setDelegate:nil]; 
    107         [[self window] setToolbar:nil]; 
    108  
    109         [viewsDrawer setDelegate:nil]; 
    110         [chatViewsOutlineView setDelegate:nil]; 
    111         [chatViewsOutlineView setDataSource:nil]; 
    112         [favoritesButton setMenu:nil]; 
    113  
    114100        [[NSNotificationCenter defaultCenter] removeObserver:self]; 
    115101 
     
    159145 
    160146- (void) setIdentifier:(NSString *) identifier { 
    161         [_identifier autorelease]
     147        id old = _identifier
    162148        _identifier = [identifier copyWithZone:[self zone]]; 
    163  
    164         [_settings autorelease]; 
    165         _settings = [[NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults] dictionaryForKey:[self userDefaultsPreferencesKey]]] retain]; 
     149        [old release]; 
     150 
     151        old = _settings; 
     152        _settings = [[NSMutableDictionary allocWithZone:nil] initWithDictionary:[[NSUserDefaults standardUserDefaults] dictionaryForKey:[self userDefaultsPreferencesKey]]]; 
     153        [old release]; 
    166154 
    167155        if( [[self identifier] length] ) { 
     
    481469 
    482470- (NSToolbarItem *) toggleChatDrawerToolbarItem { 
    483         NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier:JVToolbarToggleChatDrawerItemIdentifier] autorelease]; 
     471        NSToolbarItem *toolbarItem = [[NSToolbarItem alloc] initWithItemIdentifier:JVToolbarToggleChatDrawerItemIdentifier]; 
    484472 
    485473        [toolbarItem setLabel:NSLocalizedString( @"Drawer", "chat panes drawer toolbar item name" )]; 
     
    492480        [toolbarItem setAction:@selector( toggleViewsDrawer: )]; 
    493481 
    494         return toolbarItem
     482        return [toolbarItem autorelease]
    495483} 
    496484 
     
    719707 
    720708        if( [org size].width > maxSideSize || [org size].height > maxSideSize ) { 
    721                 NSImage *ret = [[[item icon] copy] autorelease]; 
     709                NSImage *ret = [[[item icon] copyWithZone:nil] autorelease]; 
    722710                [ret setScalesWhenResized:YES]; 
    723711                [ret setSize:NSMakeSize( maxSideSize, maxSideSize )]; 
     
    804792                id <JVChatViewController> dragedController = nil; 
    805793                [pointerData getBytes:&dragedController]; 
    806  
    807                 [[dragedController retain] autorelease]; 
     794                [dragedController retain]; 
    808795 
    809796                if( [_views containsObject:dragedController] ) { 
     
    817804                else [self insertChatViewController:dragedController atIndex:index]; 
    818805 
     806                [dragedController release]; 
    819807                return YES; 
    820808        } 
     
    868856        id menuItem = nil; 
    869857        NSMenu *menu = [chatViewsOutlineView menu]; 
     858        if( ! menu ) { 
     859                menu = [[NSMenu allocWithZone:nil] initWithTitle:@""]; 
     860                [chatViewsOutlineView setMenu:menu]; 
     861                [menu release]; 
     862        } 
     863 
    870864        NSMenu *newMenu = ( [item respondsToSelector:@selector( menu )] ? [item menu] : nil ); 
    871         NSEnumerator *enumerator = [[[[menu itemArray] copy] autorelease] objectEnumerator]; 
    872  
     865 
     866        NSEnumerator *enumerator = [[[[menu itemArray] copyWithZone:nil] autorelease] objectEnumerator]; 
    873867        while( ( menuItem = [enumerator nextObject] ) ) 
    874868                [menu removeItem:menuItem]; 
    875869 
    876         enumerator = [[[[newMenu itemArray] copy] autorelease] objectEnumerator]; 
     870        enumerator = [[[[newMenu itemArray] copyWithZone:nil] autorelease] objectEnumerator]; 
    877871        while( ( menuItem = [enumerator nextObject] ) ) { 
    878872                [newMenu removeItem:menuItem]; 
     
    925919                        [(NSObject *)item willSelect]; 
    926920 
    927                 [_activeViewController autorelease]
     921                id old = _activeViewController
    928922                _activeViewController = [item retain]; 
     923                [old release]; 
    929924 
    930925                [[self window] setContentView:[_activeViewController view]]; 
     
    937932                        [(NSObject *)_activeViewController didSelect]; 
    938933        } else if( ! [_views count] || ! _activeViewController ) { 
    939                 [[self window] setContentView:[[[NSView alloc] initWithFrame:[[[self window] contentView] frame]] autorelease]]; 
     934                NSView *placeHolder = [[NSView alloc] initWithFrame:[[[self window] contentView] frame]]; 
     935                [[self window] setContentView:placeHolder]; 
     936                [placeHolder release]; 
     937 
    940938                [[[self window] toolbar] setDelegate:nil]; 
    941939                [[self window] setToolbar:nil]; 
  • trunk/Controllers/JVSidebarChatWindowController.h

    r3206 r3219  
    55@interface JVSidebarChatWindowController : JVChatWindowController { 
    66        IBOutlet JVSideSplitView *splitView; 
    7         IBOutlet NSView *sideView; 
    87        IBOutlet NSView *bodyView; 
    9         float _sideWidth; 
    108        BOOL _forceSplitViewPosition; 
    119} 
  • trunk/Controllers/JVSidebarChatWindowController.m

    r3207 r3219  
    33 
    44@interface JVChatWindowController (JVChatWindowControllerPrivate) 
    5 - (void) _claimMenuCommands; 
    6 - (void) _resignMenuCommands; 
    7 - (void) _refreshSelectionMenu; 
    8 - (void) _refreshWindow; 
    95- (void) _refreshWindowTitle; 
    10 - (void) _refreshList; 
    11 - (void) _refreshPreferences; 
    126@end 
    137 
     
    2014 
    2115- (id) initWithWindowNibName:(NSString *) windowNibName { 
    22         if( ( self = [super initWithWindowNibName:windowNibName] ) ) { 
     16        if( ( self = [super initWithWindowNibName:windowNibName] ) ) 
    2317                _forceSplitViewPosition = YES; 
    24         } 
    25  
    2618        return self; 
    2719} 
     
    3022        [super windowDidLoad]; 
    3123 
    32         NSRect sideFrame = [sideView frame]; 
    33         _sideWidth = sideFrame.size.width; 
    34  
    3524        [chatViewsOutlineView setAllowsEmptySelection:NO]; 
    3625 
    37         [splitView adjustSubviews]; 
     26        [splitView setMainSubviewIndex:1]; 
    3827        [splitView setPositionUsingName:@"JVSidebarSplitViewPosition"]; 
    3928} 
     
    4433 
    4534- (void) splitViewDidResizeSubviews:(NSNotification *) notification { 
    46         // Cache the height of the send box so we can keep it constant during window resizes. 
    47         NSRect sideFrame = [sideView frame]; 
    48         _sideWidth = sideFrame.size.width; 
    49  
    5035        if( ! _forceSplitViewPosition ) 
    5136                [splitView savePositionUsingName:@"JVSidebarSplitViewPosition"]; 
    52  
    5337        _forceSplitViewPosition = NO; 
    54 } 
    55  
    56 - (void) splitView:(NSSplitView *) sender resizeSubviewsWithOldSize:(NSSize) oldSize { 
    57         float dividerThickness = [sender dividerThickness]; 
    58         NSRect newFrame = [sender frame]; 
    59  
    60         // Keep the size of the send box constant during window resizes 
    61  
    62         // We need to resize the scroll view frames of the webview and the textview. 
    63         // The scroll views are two superviews up: NSTextView(WebView) -> NSClipView -> NSScrollView 
    64         NSRect sideFrame = [sideView frame]; 
    65         NSRect bodyFrame = [bodyView frame]; 
    66  
    67         // Set size of the web view to the maximum size possible 
    68         bodyFrame.size.height = NSHeight( newFrame ); 
    69         bodyFrame.size.width = NSWidth( newFrame ) - dividerThickness - _sideWidth; 
    70         bodyFrame.origin.x = _sideWidth + dividerThickness; 
    71  
    72         // Keep the send box the same size 
    73         sideFrame.size.height = NSHeight( newFrame ); 
    74         sideFrame.size.width = _sideWidth; 
    75  
    76         // Commit the changes 
    77         [sideView setFrame:sideFrame]; 
    78         [bodyView setFrame:bodyFrame]; 
    7938} 
    8039 
  • trunk/Views/JVSideSplitView.m

    r3206 r3219  
    66} 
    77 
     8- (BOOL) isVertical { 
     9    return YES; 
     10} 
     11 
    812- (void) drawDividerInRect:(NSRect) rect { 
    913        [[NSColor colorWithCalibratedWhite:0.65 alpha:1.] set]; 
  • trunk/Views/JVSideStatusView.m

    r3214 r3219  
    6767        [[self superview] setFrame:newFrame]; 
    6868 
     69        [splitView adjustSubviews]; 
     70 
    6971        [[NSNotificationCenter defaultCenter] postNotificationName:NSSplitViewDidResizeSubviewsNotification object:splitView]; 
    70  
    71         [splitView adjustSubviews]; 
    7272} 
    7373@end 
  • trunk/Views/JVSplitView.h

    r3072 r3219  
    1 @interface JVSplitView : NSSplitView {} 
     1@interface JVSplitView : NSSplitView { 
     2        long _mainSubviewIndex; 
     3
    24- (NSString *) stringWithSavedPosition; 
    35- (void) setPositionFromString:(NSString *) string; 
     
    57- (void) savePositionUsingName:(NSString *) name; 
    68- (BOOL) setPositionUsingName:(NSString *) name; 
     9 
     10- (void) setMainSubviewIndex:(long) index; 
     11- (BOOL) mainSubviewIndex; 
    712@end 
  • trunk/Views/JVSplitView.m

    r3217 r3219  
    5555#pragma amrk - 
    5656 
     57- (void) setMainSubviewIndex:(long) index { 
     58        _mainSubviewIndex = index; 
     59} 
     60 
     61- (BOOL) mainSubviewIndex { 
     62        return _mainSubviewIndex; 
     63} 
     64 
     65#pragma amrk - 
     66 
    5767- (void) resetCursorRects { 
    5868        if( ! [self isPaneSplitter] ) 
     
    7383        } else [super drawDividerInRect:rect]; 
    7484} 
     85 
     86#pragma mark - 
     87 
     88- (void) adjustSubviews { 
     89        if( _mainSubviewIndex == -1 || [[self subviews] count] != 2 ) { 
     90                [super adjustSubviews]; 
     91                return; 
     92        } 
     93 
     94        float dividerThickness = [self dividerThickness]; 
     95        NSRect newFrame = [self frame]; 
     96 
     97        NSView *mainView = [[self subviews] objectAtIndex:_mainSubviewIndex]; 
     98        NSView *otherView = ( _mainSubviewIndex ? [[self subviews] objectAtIndex:0] : [[self subviews] objectAtIndex:1] ); 
     99 
     100        NSRect mainFrame = [mainView frame]; 
     101        NSRect otherFrame = [otherView frame]; 
     102 
     103        if( [self isVertical] ) { 
     104                mainFrame.size.width = NSWidth( newFrame ) - dividerThickness - NSWidth( otherFrame ); 
     105                mainFrame.size.height = NSHeight( newFrame ); 
     106                mainFrame.origin.x = ( _mainSubviewIndex ? NSWidth( otherFrame ) + dividerThickness : 0. ); 
     107                mainFrame.origin.y = 0.; 
     108        } else { 
     109                mainFrame.size.width = NSWidth( newFrame ); 
     110                mainFrame.size.height = NSHeight( newFrame ) - dividerThickness - NSHeight( otherFrame ); 
     111                mainFrame.origin.x = 0.; 
     112                mainFrame.origin.y = ( _mainSubviewIndex ? NSHeight( otherFrame ) + dividerThickness : 0. ); 
     113        } 
     114 
     115        if( [self isVertical] ) { 
     116                otherFrame.size.width = NSWidth( otherFrame ); 
     117                otherFrame.size.height = NSHeight( newFrame ); 
     118                otherFrame.origin.x = ( _mainSubviewIndex ? 0. : NSWidth( mainFrame ) + dividerThickness ); 
     119                otherFrame.origin.y = 0.; 
     120        } else { 
     121                otherFrame.size.width = NSWidth( newFrame ); 
     122                otherFrame.size.height = NSHeight( otherFrame ); 
     123                otherFrame.origin.x = 0.; 
     124                otherFrame.origin.y = ( _mainSubviewIndex ? 0. : NSWidth( mainFrame ) + dividerThickness ); 
     125        } 
     126 
     127        [mainView setFrame:mainFrame]; 
     128