Changeset 9327


Ignore:
Timestamp:
Oct 19, 2009, 3:14:49 AM (12 years ago)
Author:
livings124
Message:

on 10.6, use the new copying methods in the message window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.m

    r9326 r9327  
    250250- (void) copy: (id) sender
    251251{
    252     NSPasteboard * pb = [NSPasteboard generalPasteboard];
    253     [pb declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: self];
    254    
    255252    NSIndexSet * indexes = [fMessageTable selectedRowIndexes];
    256253    NSMutableArray * messageStrings = [NSMutableArray arrayWithCapacity: [indexes count]];
     
    259256        [messageStrings addObject: [self stringForMessage: message]];
    260257   
    261     [pb setString: [messageStrings componentsJoinedByString: @"\n"] forType: NSStringPboardType];
     258    NSString * messageString = [messageStrings componentsJoinedByString: @"\n"];
     259   
     260    NSPasteboard * pb = [NSPasteboard generalPasteboard];
     261    if ([NSApp isOnSnowLeopardOrBetter])
     262    {
     263        [pb clearContents];
     264        [pb writeObjects: [NSArray arrayWithObject: messageString]];
     265    }
     266    else
     267    {
     268        [pb declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: nil];
     269        [pb setString: messageString forType: NSStringPboardType];
     270    }
    262271}
    263272
Note: See TracChangeset for help on using the changeset viewer.