Revision: 14695
http://sourceforge.net/p/skim-app/code/14695
Author: hofman
Date: 2024-11-15 19:07:47 +0000 (Fri, 15 Nov 2024)
Log Message:
-----------
make keys for info a class method
Modified Paths:
--------------
trunk/NSDocument_SKExtensions.m
trunk/SKInfoWindowController.h
trunk/SKInfoWindowController.m
Modified: trunk/NSDocument_SKExtensions.m
===================================================================
--- trunk/NSDocument_SKExtensions.m 2024-11-15 18:51:11 UTC (rev 14694)
+++ trunk/NSDocument_SKExtensions.m 2024-11-15 19:07:47 UTC (rev 14695)
@@ -372,7 +372,7 @@
- (NSDictionary *)scriptingInfo {
NSMutableDictionary *info = [NSMutableDictionary dictionary];
- for (NSString *key in [[SKInfoWindowController sharedInstance] keys])
+ for (NSString *key in [SKInfoWindowController keys])
[info setObject:[NSNull null] forKey:key];
[info addEntriesFromDictionary:[self documentAttributes]];
return info;
Modified: trunk/SKInfoWindowController.h
===================================================================
--- trunk/SKInfoWindowController.h 2024-11-15 18:51:11 UTC (rev 14694)
+++ trunk/SKInfoWindowController.h 2024-11-15 19:07:47 UTC (rev 14695)
@@ -53,10 +53,10 @@
@property (nonatomic, nullable, strong) IBOutlet NSTableView
*summaryTableView, *attributesTableView;
@property (nonatomic, nullable, strong) IBOutlet NSTabView *tabView;
@property (nonatomic, nullable, copy) NSDictionary<NSString *, id> *info;
-@property (weak, nonatomic, readonly) NSArray<NSString *> *keys;
@property (class, nonatomic, readonly) SKInfoWindowController *sharedInstance;
+@property (class, nonatomic, readonly) NSArray<NSString *> *keys;
+ (NSDictionary<NSString *, id> *)infoForDocument:(NSDocument *)doc;
@end
Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m 2024-11-15 18:51:11 UTC (rev 14694)
+++ trunk/SKInfoWindowController.m 2024-11-15 19:07:47 UTC (rev 14695)
@@ -76,7 +76,6 @@
@implementation SKInfoWindowController
@synthesize summaryTableView, attributesTableView, tabView, info;
-@dynamic keys;
static SKInfoWindowController *sharedInstance = nil;
@@ -285,10 +284,27 @@
return dictionary;
}
-- (NSArray *)keys {
- return [attributesKeys arrayByAddingObjectsFromArray:summaryKeys];
++ (NSArray *)keys {
+ return @[
+ PDFDocumentTitleAttribute,
+ PDFDocumentAuthorAttribute,
+ PDFDocumentSubjectAttribute,
+ PDFDocumentCreatorAttribute,
+ PDFDocumentProducerAttribute,
+ PDFDocumentCreationDateAttribute,
+ PDFDocumentModificationDateAttribute,
+ SKInfoKeywordsStringKey,
+ SKInfoFileNameKey,
+ SKInfoFileSizeKey,
+ SKInfoPageSizeKey,
+ SKInfoPageCountKey,
+ SKInfoVersionKey,
+ SKInfoEncryptedKey,
+ SKInfoAllowsPrintingKey,
+ SKInfoAllowsCopyingKey,
+ SKInfoAllowsCommentingKey];
}
-
+
- (void)handleViewFrameDidChangeNotification:(NSNotification *)notification {
[attributesTableView noteHeightOfRowsWithIndexesChanged:[NSIndexSet
indexSetWithIndex:[attributesKeys count] - 1]];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit