Revision: 14694
          http://sourceforge.net/p/skim-app/code/14694
Author:   hofman
Date:     2024-11-15 18:51:11 +0000 (Fri, 15 Nov 2024)
Log Message:
-----------
make infoForDocument: a class method so we don't need to create the shared 
instance

Modified Paths:
--------------
    trunk/NSDocument_SKExtensions.m
    trunk/SKInfoWindowController.h
    trunk/SKInfoWindowController.m
    trunk/SKMainDocument.m

Modified: trunk/NSDocument_SKExtensions.m
===================================================================
--- trunk/NSDocument_SKExtensions.m     2024-11-15 18:38:36 UTC (rev 14693)
+++ trunk/NSDocument_SKExtensions.m     2024-11-15 18:51:11 UTC (rev 14694)
@@ -367,7 +367,7 @@
 - (NSInteger)presentationNotesOffset { return 0; }
 
 - (NSDictionary *)documentAttributes {
-    return [[SKInfoWindowController sharedInstance] infoForDocument:self];
+    return [SKInfoWindowController infoForDocument:self];
 }
 
 - (NSDictionary *)scriptingInfo {

Modified: trunk/SKInfoWindowController.h
===================================================================
--- trunk/SKInfoWindowController.h      2024-11-15 18:38:36 UTC (rev 14693)
+++ trunk/SKInfoWindowController.h      2024-11-15 18:51:11 UTC (rev 14694)
@@ -57,7 +57,7 @@
 
 @property (class, nonatomic, readonly) SKInfoWindowController *sharedInstance;
 
-- (NSDictionary<NSString *, id> *)infoForDocument:(NSDocument *)doc;
++ (NSDictionary<NSString *, id> *)infoForDocument:(NSDocument *)doc;
 
 @end
 

Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m      2024-11-15 18:38:36 UTC (rev 14693)
+++ trunk/SKInfoWindowController.m      2024-11-15 18:51:11 UTC (rev 14694)
@@ -134,7 +134,7 @@
 }
 
 - (void)updateForDocument:(NSDocument *)doc {
-    [self setInfo:[self infoForDocument:doc]];
+    [self setInfo:[[self class] infoForDocument:doc]];
     [summaryTableView reloadData];
     [attributesTableView reloadData];
 }
@@ -251,7 +251,7 @@
         return [NSString stringWithFormat:@"%.1f x %.1f %@  (%.1f x %.1f %@)", 
size.width * factor, size.height * factor, units, altSize.width * factor, 
altSize.height * factor, units];
 }
 
-- (NSDictionary *)infoForDocument:(NSDocument *)doc {
++ (NSDictionary *)infoForDocument:(NSDocument *)doc {
     NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
     PDFDocument *pdfDoc;
     unsigned long long logicalSize = 0, physicalSize = 0;

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2024-11-15 18:38:36 UTC (rev 14693)
+++ trunk/SKMainDocument.m      2024-11-15 18:51:11 UTC (rev 14694)
@@ -59,7 +59,6 @@
 #import "SKTemplateParser.h"
 #import "SKApplicationController.h"
 #import "PDFSelection_SKExtensions.h"
-#import "SKInfoWindowController.h"
 #import "SKApplicationController.h"
 #import "NSFileManager_SKExtensions.h"
 #import "SKFDFParser.h"
@@ -610,7 +609,7 @@
         name = [name stringByAppendingString:@"1"];
     NSData *data;
     NSFileWrapper *fileWrapper = [[NSFileWrapper alloc] 
initDirectoryWithFileWrappers:@{}];
-    NSDictionary *info = [[SKInfoWindowController sharedInstance] 
infoForDocument:self];
+    NSDictionary *info = [self documentAttributes];
     NSDictionary *options = [self presentationOptions];
     if (options) {
         info = [info mutableCopy];

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

Reply via email to