Revision: 14654
          http://sourceforge.net/p/skim-app/code/14654
Author:   hofman
Date:     2024-11-07 15:13:54 +0000 (Thu, 07 Nov 2024)
Log Message:
-----------
Save recentdocumentInfo always in windowWillClose: and not in 
removeWindowController:, workaround is not necessary as windowWillClose: will 
now always be called before removeWindowController:

Modified Paths:
--------------
    trunk/SKMainDocument.m
    trunk/SKMainWindowController_UI.m

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2024-11-07 10:04:17 UTC (rev 14653)
+++ trunk/SKMainDocument.m      2024-11-07 15:13:54 UTC (rev 14654)
@@ -228,15 +228,8 @@
 }
 
 - (void)removeWindowController:(NSWindowController *)windowController {
-    if ([windowController isEqual:mainWindowController]) {
-        // if the window delegate is nil, windowWillClose: has already cleaned 
up, and should have called saveRecentDocumentInfo
-        // otherwise, windowWillClose: comes after this (as it did on Tiger) 
and we need to do this now
-        if ([mainWindowController isWindowLoaded] && [[mainWindowController 
window] delegate]) {
-            [mainWindowController setRecentInfoNeedsUpdate:YES];
-            [self saveRecentDocumentInfo];
-        }
+    if ([windowController isEqual:mainWindowController])
         mainWindowController = nil;
-    }
     [super removeWindowController:windowController];
 }
 

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2024-11-07 10:04:17 UTC (rev 14653)
+++ trunk/SKMainWindowController_UI.m   2024-11-07 15:13:54 UTC (rev 14654)
@@ -249,12 +249,8 @@
 
 - (void)windowWillClose:(NSNotification *)notification {
     if ([[notification object] isEqual:[self window]]) {
-        // if we were not yet removed in removeWindowController: we should 
save our document info now
-        // otherwise [self document] is nil so this is safe
-        if ([self document]) {
-            [self setRecentInfoNeedsUpdate:YES];
-            [[self document] saveRecentDocumentInfo];
-        }
+        [self setRecentInfoNeedsUpdate:YES];
+        [[self document] saveRecentDocumentInfo];
         if ([[pdfView document] isFinding])
             [[pdfView document] cancelFindString];
         if ((mwcFlags.isEditingTable || [pdfView isEditing]) && [self 
commitEditing] == NO)

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