Skip to content

Commit

Permalink
Updated with changes from OmniGroup svn [290414:291038]
Browse files Browse the repository at this point in the history
General:
- More nullability annotations.

OmniFoundation:
- Marked -[OFBinding initWithObject:keyPath:] as the designated initializer,
 and marked -init as unavailable (especially) so that clients don't
 inadvertently create instances with the inherited empty initializer,
 which is incorrect.

OmniDAV:
- Add some useful DAV operation classes.

OmniSoftwareUpdate:
- When calculating the storage size, we used to loop through all mounted
  partitions using getmntinfo(3), but apfs returns the disk total for multiple
  partitions so that was returning an incorrect total. Perhaps what we really
  want is to look at the size of the filesystem our app's sandbox lives in,
  but for now let's just grab the size of the root filesystem.

OmniUI/iPad:
- More theming support.
- Fixed a paste-o where hideSidebar(atLocation:) tried to present the view
  controller rather than hiding it.
- OUIWrappingViewController now implements preferredStatusBarStyle and returns
  its wrappedViewController's preferredStatusBarStyle.
- Fix some bugs in handlers for move up/down/left/right.

OmniUI/iPad-Document:
- More themeing support.

OmniAppKit:
- Updated NSTableView(OAExtensions) to support `tableView(_:pasteboardWriterForRow:)`.

OmniQuartz:
- Fix a build error when logging is enable.
  • Loading branch information
tjw committed Jul 8, 2017
1 parent d116a42 commit d2ee3d5
Show file tree
Hide file tree
Showing 27 changed files with 963 additions and 125 deletions.
Expand Up @@ -612,7 +612,13 @@ - (BOOL)_canCopyToPasteboard;
}
} else {
id <NSTableViewDataSource> dataSource = self.dataSource;
if (self.numberOfSelectedRows > 0 && [dataSource respondsToSelector:@selector(tableView:writeRowsWithIndexes:toPasteboard:)]) {
if (self.numberOfSelectedRows == 0) {
return NO;
}
if ([dataSource respondsToSelector:@selector(tableView:pasteboardWriterForRow:)]) {
return YES;
}
if ([dataSource respondsToSelector:@selector(tableView:writeRowsWithIndexes:toPasteboard:)]) {
return YES;
}
}
Expand All @@ -625,18 +631,50 @@ - (BOOL)_copyToPasteboard:(NSPasteboard *)pasteboard;
if ([self isKindOfClass:[NSOutlineView class]]) {
NSOutlineView *outlineView = (id)self;
id <NSOutlineViewDataSource> dataSource = outlineView.dataSource;
if (self.numberOfSelectedRows > 0 && [dataSource respondsToSelector:@selector(outlineView:writeItems:toPasteboard:)]) {
return [dataSource outlineView:outlineView writeItems:[outlineView selectedItems] toPasteboard:pasteboard];
} else {
if (self.numberOfSelectedRows == 0) {
return NO;
}
if ([dataSource respondsToSelector:@selector(outlineView:pasteboardWriterForItem:)]) {
NSMutableArray *items = [NSMutableArray array];
[[outlineView selectedItems] enumerateObjectsUsingBlock:^(id item, NSUInteger idx, BOOL * _Nonnull stop) {
id <NSPasteboardWriting> writing = [dataSource outlineView:outlineView pasteboardWriterForItem:item];
if (writing) {
[items addObject:writing];
}
}];
if ([items count] == 0) {
return NO;
}
[pasteboard prepareForNewContentsWithOptions:0];
return [pasteboard writeObjects:items];
}
if ([dataSource respondsToSelector:@selector(outlineView:writeItems:toPasteboard:)]) {
return [dataSource outlineView:outlineView writeItems:[outlineView selectedItems] toPasteboard:pasteboard];
}
return NO;
} else {
id <NSTableViewDataSource> dataSource = self.dataSource;
if (self.numberOfSelectedRows > 0 && [dataSource respondsToSelector:@selector(tableView:writeRowsWithIndexes:toPasteboard:)]) {
return [dataSource tableView:self writeRowsWithIndexes:[self selectedRowIndexes] toPasteboard:pasteboard];
} else {
if (self.numberOfSelectedRows == 0) {
return NO;
}
if ([dataSource respondsToSelector:@selector(tableView:pasteboardWriterForRow:)]) {
NSMutableArray *items = [NSMutableArray array];
[[self selectedRowIndexes] enumerateIndexesUsingBlock:^(NSUInteger row, BOOL * _Nonnull stop) {
id <NSPasteboardWriting> writing = [dataSource tableView:self pasteboardWriterForRow:row];
if (writing) {
[items addObject:writing];
}
}];
if ([items count] == 0) {
return NO;
}
[pasteboard prepareForNewContentsWithOptions:0];
return [pasteboard writeObjects:items];
}
if ([dataSource respondsToSelector:@selector(tableView:writeRowsWithIndexes:toPasteboard:)]) {
return [dataSource tableView:self writeRowsWithIndexes:[self selectedRowIndexes] toPasteboard:pasteboard];
}
return NO;
}
}

Expand Down
Expand Up @@ -21,15 +21,17 @@ extern OFExtent OAFontDescriptorValidFontWeightExtent(void);

#if OMNI_BUILDING_FOR_IOS
#define OAPlatformFontClass UIFont
#import <UIKit/UIFont.h>
#elif OMNI_BUILDING_FOR_MAC
#import <ApplicationServices/ApplicationServices.h> // CoreText lives in this umbrella on the Mac
#import <AppKit/NSFont.h>
#define OAPlatformFontClass NSFont
#endif


#ifdef OAPlatformFontClass

#define OAFontDescriptorPlatformFont OAPlatformFontClass *
typedef OAPlatformFontClass *OAFontDescriptorPlatformFont;
@class OAPlatformFontClass;

@class NSNotification, NSDictionary;
Expand Down

0 comments on commit d2ee3d5

Please sign in to comment.