Skip to content

Commit

Permalink
Fix a bunch of warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Gorbach committed Apr 7, 2010
1 parent caf343e commit 42833af
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 22 deletions.
14 changes: 8 additions & 6 deletions IconFamily.m
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ - (BOOL) setAsCustomIconForFile:(NSString*)path withCompatibility:(BOOL)compat
NSString *parentDirectory;

// Before we do anything, get the original modification time for the target file.
NSDate* modificationDate = [[[NSFileManager defaultManager] fileAttributesAtPath:path traverseLink:NO] objectForKey:NSFileModificationDate];
NSDate *modificationDate = [[[NSFileManager defaultManager] attributesOfItemAtPath:path error:nil] objectForKey:NSFileModificationDate];

if ([path isAbsolutePath])
parentDirectory = [path stringByDeletingLastPathComponent];
Expand Down Expand Up @@ -789,7 +789,8 @@ - (BOOL) setAsCustomIconForFile:(NSString*)path withCompatibility:(BOOL)compat

// Now set the modification time back to when the file was actually last modified.
NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys:modificationDate, NSFileModificationDate, nil];
[[NSFileManager defaultManager] changeFileAttributes:attributes atPath:path];
[[NSFileManager defaultManager] setAttributes:attributes ofItemAtPath:path error:nil];


// Notify the system that the directory containing the file has changed, to
// give Finder the chance to find out about the file's new custom icon.
Expand Down Expand Up @@ -890,10 +891,11 @@ - (BOOL) setAsCustomIconForDirectory:(NSString*)path withCompatibility:(BOOL)com

// Remove and re-create any existing "Icon\r" file in the directory, and get an FSRef for it.
iconrPath = [path stringByAppendingPathComponent:@"Icon\r"];
if( [fm fileExistsAtPath:iconrPath] )
if([fm fileExistsAtPath:iconrPath])
{
if( ![fm removeFileAtPath:iconrPath handler:nil] )
return NO;
if(![fm removeItemAtPath:path error:nil]) {
return NO;
}
}
if( ![iconrPath getFSRef:&iconrFSRef createFileIfNecessary:YES] )
return NO;
Expand Down Expand Up @@ -1066,7 +1068,7 @@ + (NSImage*) resampleImage:(NSImage*)image toIconWidth:(int)iconWidth usingImage
workingImage = [image copyWithZone:[image zone]];
[workingImage setScalesWhenResized:YES];
size = [workingImage size];
workingImageRep = [workingImage bestRepresentationForDevice:nil];
workingImageRep = [workingImage bestRepresentationForRect:NSZeroRect context:nil hints:nil];
if ([workingImageRep isKindOfClass:[NSBitmapImageRep class]]) {
pixelSize.width = [workingImageRep pixelsWide];
pixelSize.height = [workingImageRep pixelsHigh];
Expand Down
1 change: 1 addition & 0 deletions MFClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#import "MFCore.h"
#import "MFLogReader.h"
#import "MFLogging.h"
#import "MFSecurity.h"

#define ORDERING_FILE_PATH @"~/Library/Application Support/Macfusion/Ordering.plist"

Expand Down
2 changes: 1 addition & 1 deletion MFClientFS.m
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ - (void)setIconImage:(NSImage *)image {
// Write Black and White image
NSString *fullBWImagePath = [iconDirPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.tiff", self.uuid]];
if ([[NSFileManager defaultManager] fileExistsAtPath:fullBWImagePath]) {
[[NSFileManager defaultManager] removeFileAtPath: fullBWImagePath handler:nil];
[[NSFileManager defaultManager] removeItemAtPath:fullBWImagePath error:nil];
}

CIFilter *bwFilter = [CIFilter filterWithName:@"CIColorControls"];
Expand Down
2 changes: 0 additions & 2 deletions MFCommunicationServer.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ - (id) init {
}

- (void)vendDisributedObject {
NSLog(@"Vending distribution object ... %@", self);
NSConnection *connection = [NSConnection new];
[connection setRootObject:self];
if ([connection registerName:kMFDistributedObjectName] == YES) {
NSLog(@"Connection registered!");
} else {
MFLogS(self, @"Failed to register connection name");
exit(-1);
Expand Down
2 changes: 1 addition & 1 deletion MFLogViewerController.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#import <Cocoa/Cocoa.h>
@class MFLogReader, MFClientFS;

@interface MFLogViewerController : NSWindowController <NSMenuDelegate> {
@interface MFLogViewerController : NSWindowController <NSMenuDelegate, NSToolbarDelegate> {
IBOutlet NSTableView *logTableView;
IBOutlet NSArrayController *logArrayController;
IBOutlet NSPopUpButton *filesystemFilterPopup;
Expand Down
2 changes: 1 addition & 1 deletion MFLogViewerTableView.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#import <Cocoa/Cocoa.h>


@interface MFLogViewerTableView : NSTableView {
@interface MFLogViewerTableView : NSTableView <NSTableViewDelegate, NSTableViewDataSource> {
NSArray* _logMessages;
}

Expand Down
6 changes: 3 additions & 3 deletions MFLogViewerTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ - (id)initWithCoder:(NSCoder *)decoder {
return self;
}

- (int)numberOfRowsInTableView:(NSTableView *)tableView {
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
return [_logMessages count];
}

- (id)tableView:(NSTableView *) tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row {
- (id)tableView:(NSTableView *) tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
return [(NSDictionary *)[_logMessages objectAtIndex:row] objectForKey:[NSString stringWithUTF8String:ASL_KEY_MSG]];
}

- (void)tableView:(NSTableView *)tableView willDisplayCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn row:(int)row {
- (void)tableView:(NSTableView *)tableView willDisplayCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
[cell setRepresentedObject:[_logMessages objectAtIndex:row]];
}

Expand Down
2 changes: 1 addition & 1 deletion MFPreferencesController.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#import <Cocoa/Cocoa.h>
@class MFClient, MFPreferences;

@interface MFPreferencesController : NSWindowController {
@interface MFPreferencesController : NSWindowController <NSToolbarDelegate> {
IBOutlet NSButton *agentLoginItemButton;
IBOutlet NSButton *menuLoginItemButton;
IBOutlet NSTextField *fuseVersionTextField;
Expand Down
8 changes: 4 additions & 4 deletions MFServerFS.m
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ - (BOOL)setupMountPoint {
pathExists = [fm fileExistsAtPath:mountPath isDirectory:&isDir];
if (pathExists && isDir == YES) {
// directory already exists
BOOL empty = ([[fm directoryContentsAtPath:mountPath] count] == 0);
BOOL empty = ([[fm contentsOfDirectoryAtPath:mountPath error:nil] count] == 0);
BOOL writeable = [fm isWritableFileAtPath:mountPath];
if (!empty) {
errorDescription = @"Mount path directory in use.";
Expand All @@ -318,7 +318,7 @@ - (BOOL)setupMountPoint {
errorDescription = @"Mount path is a file, not a directory.";
returnValue = NO;
} else {
if ([fm createDirectoryAtPath:mountPath attributes:nil]) {
if ([fm createDirectoryAtPath:mountPath withIntermediateDirectories:YES attributes:nil error:nil]) {
returnValue = YES;
} else {
errorDescription = @"Mount path could not be created.";
Expand All @@ -343,8 +343,8 @@ - (void)removeMountPoint {
removexattr([mountPath cStringUsingEncoding:NSUTF8StringEncoding],[@"org.mgorbach.macfusion.xattr.uuid" cStringUsingEncoding:NSUTF8StringEncoding],0);

pathExists = [fm fileExistsAtPath:mountPath isDirectory:&isDir];
if (pathExists && isDir && ([[fm directoryContentsAtPath:mountPath] count] == 0)) {
[fm removeFileAtPath:mountPath handler:nil];
if (pathExists && isDir && ([[fm contentsOfDirectoryAtPath:mountPath error:nil] count] == 0)) {
[fm removeItemAtPath:mountPath error:nil];
}
}

Expand Down
2 changes: 1 addition & 1 deletion Settings/MFFilesystemTableView.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#import <Cocoa/Cocoa.h>
@class MFSettingsController, MFClientFS;

@interface MFFilesystemTableView : NSTableView
@interface MFFilesystemTableView : NSTableView <NSTableViewDelegate>
{
NSMutableArray* filesystems;
MFSettingsController* controller;
Expand Down
4 changes: 2 additions & 2 deletions Settings/MFFilesystemTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ - (id) initWithCoder: (NSCoder *) decoder
{
if (self = [super initWithCoder:decoder])
{
[self setDelegate: self];
[self setDelegate:self];
self.filesystems = [NSMutableArray array];
MFFilesystemCell* cell = [MFFilesystemCell new];
[[[self tableColumns] objectAtIndex:0] setDataCell: cell];
Expand Down Expand Up @@ -72,7 +72,7 @@ - (MFClientFS*)clickedFilesystem
- (void) tableView: (NSTableView *) tableView
willDisplayCell: (NSCell*) cell
forTableColumn: (NSTableColumn *) tableColumn
row: (int) row
row: (NSInteger) row
{
MFClientFS* fs = [self.filesystems objectAtIndex: row];
if ([[tableColumn identifier] isEqualTo: @"main"])
Expand Down

0 comments on commit 42833af

Please sign in to comment.