adium 3519:02154adc3253: Fixed many deprecated and other warning...

commits at adium.im commits at adium.im
Sun Nov 14 16:00:47 UTC 2010


details:	http://hg.adium.im/adium/rev/02154adc3253
revision:	3519:02154adc3253
author:		Evan Schoenberg
date:		Sun Nov 14 10:00:18 2010 -0600

Fixed many deprecated and other warnings. Patch from an anonymous source with minor modifications by me

diffs (281 lines):

diff -r 971dfe1ffbc0 -r 02154adc3253 Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.m	Sun Nov 14 10:00:18 2010 -0600
@@ -471,7 +471,7 @@
 {
 	NSPasteboard	*pb = [NSPasteboard generalPasteboard];
 	NSString		*type = [pb availableTypeFromArray:
-		[NSArray arrayWithObjects:NSTIFFPboardType, NSPDFPboardType, NSPICTPboardType,nil]];
+		[NSArray arrayWithObjects:NSTIFFPboardType, NSPDFPboardType,nil]];
 	BOOL			success = NO;
 
     NSData			*imageData = (type ? [pb dataForType:type] : nil);
diff -r 971dfe1ffbc0 -r 02154adc3253 Frameworks/Adium Framework/Source/AIInterfaceControllerProtocol.h
--- a/Frameworks/Adium Framework/Source/AIInterfaceControllerProtocol.h	Sun Nov 14 09:43:36 2010 -0600
+++ b/Frameworks/Adium Framework/Source/AIInterfaceControllerProtocol.h	Sun Nov 14 10:00:18 2010 -0600
@@ -106,6 +106,13 @@
  */
 - (IBAction)closeContactList:(id)sender;
 /*!
+ * @brief Toggle the contact list
+ *
+ * Show the contact list if it's closed, bring it to the front if it's open but not in the front,
+ * or close it if it's active.
+ */
+- (IBAction)toggleContactList:(id)sender;
+/*!
  * @returns YES if contact list is visible and selected, otherwise NO
  */
 @property (nonatomic, readonly) BOOL contactListIsVisibleAndMain;
diff -r 971dfe1ffbc0 -r 02154adc3253 Frameworks/Adium Framework/Source/AIMessageEntryTextView.m
--- a/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m	Sun Nov 14 10:00:18 2010 -0600
@@ -65,7 +65,7 @@
 #define KEY_MAX_NUMBER_OF_CHARACTERS			@"Maximum Number Of Characters"
 
 #define FILES_AND_IMAGES_TYPES [NSArray arrayWithObjects: \
-	NSFilenamesPboardType, AIiTunesTrackPboardType, NSTIFFPboardType, NSPDFPboardType, NSPICTPboardType, nil]
+	NSFilenamesPboardType, AIiTunesTrackPboardType, NSTIFFPboardType, NSPDFPboardType, nil]
 
 #define PASS_TO_SUPERCLASS_DRAG_TYPE_ARRAY [NSArray arrayWithObjects: \
 	NSRTFPboardType, NSStringPboardType, nil]
@@ -567,7 +567,7 @@
 
 	NSArray *supportedTypes =
 		[NSArray arrayWithObjects:NSURLPboardType, NSRTFDPboardType, NSRTFPboardType, NSHTMLPboardType, NSStringPboardType, 
-			NSFilenamesPboardType, NSTIFFPboardType, NSPDFPboardType, NSPICTPboardType, nil];
+			NSFilenamesPboardType, NSTIFFPboardType, NSPDFPboardType, nil];
 
 	type = [[NSPasteboard generalPasteboard] availableTypeFromArray:supportedTypes];
 	
diff -r 971dfe1ffbc0 -r 02154adc3253 Frameworks/Adium Framework/Source/AITextAttachmentExtension.m
--- a/Frameworks/Adium Framework/Source/AITextAttachmentExtension.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Frameworks/Adium Framework/Source/AITextAttachmentExtension.m	Sun Nov 14 10:00:18 2010 -0600
@@ -182,7 +182,7 @@
 	BOOL attachesAnImage = (image != nil);
 	
 	if (!attachesAnImage && path) {
-		OSType			HFSTypeCode = [[[NSFileManager defaultManager] fileAttributesAtPath:path traverseLink:YES] fileHFSTypeCode];
+		OSType			HFSTypeCode = [[[NSFileManager defaultManager] attributesOfItemAtPath:path error:NULL] fileHFSTypeCode];
 		
 		attachesAnImage = [self consideredImageForHFSType:HFSTypeCode
 											pathExtension:[path pathExtension]];
diff -r 971dfe1ffbc0 -r 02154adc3253 Plugins/Bonjour/AWBonjourAccount.h
--- a/Plugins/Bonjour/AWBonjourAccount.h	Sun Nov 14 09:43:36 2010 -0600
+++ b/Plugins/Bonjour/AWBonjourAccount.h	Sun Nov 14 10:00:18 2010 -0600
@@ -25,7 +25,7 @@
 #import <Adium/AIAccount.h>
 #import "AWEzv.h"
 
- at interface AWBonjourAccount : AIAccount <AWEzvClientProtocol, AIAccount_Files, NSTextInputClient> {
+ at interface AWBonjourAccount : AIAccount <AWEzvClientProtocol, AIAccount_Files> {
     AWEzv				*libezv;
     NSMutableSet		*libezvContacts;
     NSString			*savedAwayMessage;
diff -r 971dfe1ffbc0 -r 02154adc3253 Plugins/Bonjour/libezv/Classes/EKEzvIncomingFileTransfer.m
--- a/Plugins/Bonjour/libezv/Classes/EKEzvIncomingFileTransfer.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Plugins/Bonjour/libezv/Classes/EKEzvIncomingFileTransfer.m	Sun Nov 14 10:00:18 2010 -0600
@@ -112,7 +112,10 @@
 		}
 	}
 
-	if (![fileManager createDirectoryAtPath:localFilename attributes:[self posixAttributesFromString:posixFlags]]) {
+	if (![fileManager createDirectoryAtPath:localFilename
+                withIntermediateDirectories:YES
+                                 attributes:[self posixAttributesFromString:posixFlags]
+                                      error:NULL]) {
 		[[[[self manager] client] client] reportError:@"There was an error creating the root directory for the file tranfer" ofLevel:AWEzvError];
 		[[[[self manager] client] client] remoteCanceledFileTransfer:self];
 		return;
@@ -200,7 +203,10 @@
 		NSFileManager *defaultManager = [NSFileManager defaultManager];
 		NSString *newPath = [rootPath stringByAppendingPathComponent:name];
 
-		if (![defaultManager createDirectoryAtPath:newPath attributes:[self posixAttributesFromString:posixFlags]]) {
+		if (![defaultManager createDirectoryAtPath:newPath
+                       withIntermediateDirectories:YES
+                                        attributes:[self posixAttributesFromString:posixFlags]
+                                             error:NULL]) {
 			[[[[self manager] client] client] reportError:@"Could not create directory for transfer." ofLevel: AWEzvError];
 			
 			return NO;	
@@ -268,7 +274,7 @@
 	while ((path = [enumerator nextObject])) {
 		/* code that uses the returned key */
 		attributes = [permissionsToApply valueForKey:path];		
-		if (![defaultManager changeFileAttributes:attributes atPath:path]) {
+		if (![defaultManager setAttributes:attributes ofItemAtPath:path error:NULL]) {
 			[[[manager client] client] reportError:[NSString stringWithFormat:@"Error applying permissions of %@ to file at %@", attributes, path] ofLevel: AWEzvError];
 			[[[manager client] client] remoteCanceledFileTransfer:self];
 			[permissionsToApply release]; permissionsToApply = nil;
diff -r 971dfe1ffbc0 -r 02154adc3253 Plugins/Bonjour/libezv/Classes/EKEzvOutgoingFileTransfer.m
--- a/Plugins/Bonjour/libezv/Classes/EKEzvOutgoingFileTransfer.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Plugins/Bonjour/libezv/Classes/EKEzvOutgoingFileTransfer.m	Sun Nov 14 10:00:18 2010 -0600
@@ -270,7 +270,7 @@
 	NSMutableArray *children = [NSMutableArray arrayWithCapacity:10];
 	NSFileManager *fileManager = [NSFileManager defaultManager];
 
-	for (NSString *file in [fileManager directoryContentsAtPath:basePath]){
+	for (NSString *file in [fileManager contentsOfDirectoryAtPath:basePath error:NULL]){
 		NSString *newPath = [basePath stringByAppendingPathComponent:file];
 		BOOL exists = NO;
 		BOOL directory = NO;
@@ -488,7 +488,7 @@
 - (NSString *)posixFlagsForPath:(NSString *)filePath
 {
 	NSString *posixFlags = nil;
-	NSDictionary *attributes = [[NSFileManager defaultManager] fileAttributesAtPath:filePath traverseLink:NO];
+	NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:NULL];
 	if (attributes && [attributes objectForKey:NSFilePosixPermissions]) {
 		NSNumber *posixInfo = [attributes objectForKey:NSFilePosixPermissions];
 		posixFlags = [NSString stringWithFormat:@"%X", [posixInfo longValue]];
@@ -514,7 +514,7 @@
 - (NSString *)sizeForPath:(NSString *)filePath
 {
 	NSString *fileSize = nil;
-	NSDictionary *attributes = [[NSFileManager defaultManager] fileAttributesAtPath:filePath traverseLink:NO];
+	NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:NULL];
 	if (attributes && [attributes objectForKey:NSFileSize]) {
 		NSNumber *fileSizeNumber = [attributes objectForKey:NSFileSize];
 		fileSize = [NSString stringWithFormat:@"%qu", [fileSizeNumber unsignedLongLongValue]];
@@ -526,7 +526,7 @@
 - (NSNumber *)sizeNumberForPath:(NSString *)filePath
 {
 	NSNumber *fileSize = nil;
-	NSDictionary *attributes = [[NSFileManager defaultManager] fileAttributesAtPath:filePath traverseLink:NO];
+	NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:NULL];
 	if (attributes && [attributes objectForKey:NSFileSize]) {
 		fileSize = [attributes objectForKey:NSFileSize];
 	}
diff -r 971dfe1ffbc0 -r 02154adc3253 Plugins/Dual Window Interface/AIMessageWindowController.m
--- a/Plugins/Dual Window Interface/AIMessageWindowController.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Plugins/Dual Window Interface/AIMessageWindowController.m	Sun Nov 14 10:00:18 2010 -0600
@@ -966,7 +966,7 @@
 //Allow dragging of text
 - (NSArray *)allowedDraggedTypesForTabView:(NSTabView *)aTabView
 {
-	return [NSArray arrayWithObjects:NSRTFPboardType, NSStringPboardType, NSFilenamesPboardType, NSTIFFPboardType, NSPDFPboardType, NSPICTPboardType, nil];
+	return [NSArray arrayWithObjects:NSRTFPboardType, NSStringPboardType, NSFilenamesPboardType, NSTIFFPboardType, NSPDFPboardType, nil];
 }
 
 //Accept dragged text
diff -r 971dfe1ffbc0 -r 02154adc3253 Plugins/WebKit Message View/AIWebKitMessageViewController.m
--- a/Plugins/WebKit Message View/AIWebKitMessageViewController.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewController.m	Sun Nov 14 10:00:18 2010 -0600
@@ -336,7 +336,6 @@
 			AIiTunesTrackPboardType,
 			NSTIFFPboardType,
 			NSPDFPboardType,
-			NSPICTPboardType,
 			NSHTMLPboardType,
 			NSFileContentsPboardType,
 			NSRTFPboardType,
@@ -1048,7 +1047,7 @@
 - (BOOL)shouldHandleDragWithPasteboard:(NSPasteboard *)pasteboard
 {
 	/*
-	return (![pasteboard availableTypeFromArray:[NSArray arrayWithObjects:NSTIFFPboardType,NSPDFPboardType,NSPICTPboardType,nil]] &&
+	return (![pasteboard availableTypeFromArray:[NSArray arrayWithObjects:NSTIFFPboardType,NSPDFPboardType,nil]] &&
 			[pasteboard availableTypeFromArray:[NSArray arrayWithObject:NSFilenamesPboardType]]);
 	 */
 	return NO;
diff -r 971dfe1ffbc0 -r 02154adc3253 Source/AIPreferenceContainer.m
--- a/Source/AIPreferenceContainer.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Source/AIPreferenceContainer.m	Sun Nov 14 10:00:18 2010 -0600
@@ -159,7 +159,7 @@
 						   [error domain], [error code], [error userInfo]);
 		if ([[NSFileManager defaultManager] fileExistsAtPath:objectPrefsPath]) {
 			while (!data) {
-				AILogWithSignature(@"Preferences file %@'s attributes: %@. Reattempting to read the file...", globalPrefsName, [[NSFileManager defaultManager] fileAttributesAtPath:objectPrefsPath traverseLink:NO]);
+				AILogWithSignature(@"Preferences file %@'s attributes: %@. Reattempting to read the file...", globalPrefsName, [[NSFileManager defaultManager] attributesOfItemAtPath:objectPrefsPath error:NULL]);
 				data = [NSData dataWithContentsOfFile:objectPrefsPath
 											  options:NSUncachedRead
 												error:&error];
diff -r 971dfe1ffbc0 -r 02154adc3253 Source/AIStandardListWindowController.m
--- a/Source/AIStandardListWindowController.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Source/AIStandardListWindowController.m	Sun Nov 14 10:00:18 2010 -0600
@@ -53,6 +53,7 @@
 - (void)updateImagePicker;
 - (void)updateNameView;
 - (void)repositionImagePickerToPosition:(ContactListImagePickerPosition)desiredImagePickerPosition;
+- (void)listObjectAttributesChanged:(NSNotification *)inNotification;
 @end
 
 @implementation AIStandardListWindowController
diff -r 971dfe1ffbc0 -r 02154adc3253 Source/ESEventSoundAlertDetailPane.m
--- a/Source/ESEventSoundAlertDetailPane.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Source/ESEventSoundAlertDetailPane.m	Sun Nov 14 10:00:18 2010 -0600
@@ -245,7 +245,7 @@
         [openPanel 
             beginSheetForDirectory:nil
                               file:nil
-                             types:[NSSound soundUnfilteredFileTypes] //allow all the sounds NSSound understands
+                             types:[NSSound soundUnfilteredTypes] //allow all the sounds NSSound understands
                     modalForWindow:[view window]
                      modalDelegate:self
                     didEndSelector:@selector(concludeOtherPanel:returnCode:contextInfo:)
diff -r 971dfe1ffbc0 -r 02154adc3253 Source/ESFileTransferController.m
--- a/Source/ESFileTransferController.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Source/ESFileTransferController.m	Sun Nov 14 10:00:18 2010 -0600
@@ -391,8 +391,8 @@
 			}
 			
 			if (inPath) {
-				long fileSize = [[[defaultManager fileAttributesAtPath:inPath
-														  traverseLink:YES] objectForKey:NSFileSize] longValue];
+				long fileSize = [[[defaultManager attributesOfItemAtPath:inPath
+                                                                   error:NULL] objectForKey:NSFileSize] longValue];
 				if (fileSize > 0) {
 					ESFileTransfer	*fileTransfer;
 
diff -r 971dfe1ffbc0 -r 02154adc3253 Source/GBFireLogImporter.m
--- a/Source/GBFireLogImporter.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/Source/GBFireLogImporter.m	Sun Nov 14 10:00:18 2010 -0600
@@ -157,7 +157,7 @@
 			NSString *outputFileDir = [[outputBasePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", service, account]] stringByAppendingPathComponent:user];
 			NSString *outputFile = [outputFileDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@ (%@).adiumLog", user, [date descriptionWithCalendarFormat:@"%Y-%m-%dT%H.%M.%S%z" timeZone:nil locale:nil]]];
 			[fm createDirectoryAtPath:outputFileDir withIntermediateDirectories:YES attributes:nil error:NULL];
-			[fm copyPath:fullInputPath toPath:outputFile handler:self];
+			[fm copyItemAtPath:fullInputPath toPath:outputFile error:NULL];
 		}
 		else if([extension isEqualToString:@"session2"])
 		{
@@ -167,7 +167,7 @@
 			NSString *outputFileDir = [[outputBasePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", service, account]] stringByAppendingPathComponent:user];
 			NSString *outputFile = [outputFileDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@ (%@).AdiumHTMLLog", user, [date descriptionWithCalendarFormat:@"%Y-%m-%dT%H.%M.%S%z" timeZone:nil locale:nil]]];
 			[fm createDirectoryAtPath:outputFileDir withIntermediateDirectories:YES attributes:nil error:NULL];
-			[fm copyPath:fullInputPath toPath:outputFile handler:self];
+			[fm copyItemAtPath:fullInputPath toPath:outputFile error:NULL];
 		}
 		else if([extension isEqualToString:@"xhtml"])
 		{
@@ -185,7 +185,7 @@
 				NSString *realOutputFileDir = [[outputBasePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", service, account]] stringByAppendingPathComponent:user];
 				NSString *realOutputFile = [realOutputFileDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@ (%@).chatlog", user, [date descriptionWithCalendarFormat:@"%Y-%m-%dT%H.%M.%S%z" timeZone:nil locale:nil]]];
 				[fm createDirectoryAtPath:realOutputFileDir withIntermediateDirectories:YES attributes:nil error:NULL];
-				[fm movePath:outputFile toPath:realOutputFile handler:self];
+				[fm moveItemAtPath:outputFile toPath:realOutputFile error:NULL];
 			}
 			[xmlLog release];
 		}
diff -r 971dfe1ffbc0 -r 02154adc3253 UnitTests/TestRichTextCoercion.m
--- a/UnitTests/TestRichTextCoercion.m	Sun Nov 14 09:43:36 2010 -0600
+++ b/UnitTests/TestRichTextCoercion.m	Sun Nov 14 10:00:18 2010 -0600
@@ -18,7 +18,7 @@
 #warning 64BIT: Check formatting arguments
 	NSString *scriptSuitesFolder = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"AdiumTest-%u-ScriptSuites", getpid()]];
 	NSLog(@"scriptSuitesFolder: %@", scriptSuitesFolder);
-	if([mgr createDirectoryAtPath:scriptSuitesFolder attributes:nil]) {
+	if([mgr createDirectoryAtPath:scriptSuitesFolder withIntermediateDirectories:YES attributes:nil error:NULL]) {
 		NSArray *args = [NSArray arrayWithObjects:
 			//scriptSuite format.
 			@"-f", @"s",
@@ -54,7 +54,7 @@
 #warning 64BIT: Check formatting arguments
 	NSString *scriptTerminologiesFolder = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"AdiumTest-%u-ScriptTerminologies", getpid()]];
 	NSLog(@"scriptTerminologiesFolder: %@", scriptTerminologiesFolder);
-	if([mgr createDirectoryAtPath:scriptTerminologiesFolder attributes:nil]) {
+	if([mgr createDirectoryAtPath:scriptTerminologiesFolder withIntermediateDirectories:YES attributes:nil error:NULL]) {
 		NSArray *args = [NSArray arrayWithObjects:
 			//scriptTerminology format.
 			@"-f", @"t",




More information about the commits mailing list