Revision: 28459
          http://sourceforge.net/p/bibdesk/svn/28459
Author:   hofman
Date:     2023-11-20 22:59:42 +0000 (Mon, 20 Nov 2023)
Log Message:
-----------
No need to observe updater for changes, as we are the only ones making changes

Modified Paths:
--------------
    trunk/bibdesk/BibPref_General.m

Modified: trunk/bibdesk/BibPref_General.m
===================================================================
--- trunk/bibdesk/BibPref_General.m     2023-11-20 22:17:24 UTC (rev 28458)
+++ trunk/bibdesk/BibPref_General.m     2023-11-20 22:59:42 UTC (rev 28459)
@@ -43,9 +43,7 @@
 #import "BDSKPreferenceController.h"
 #import <Sparkle/Sparkle.h>
 
-static char BDSKBibPrefGeneralUpdaterObservationContext;
 
-
 @interface BibPref_General ()
 @property (nonatomic, readonly) SPUUpdater *updater;
 - (void)updateUpdaterUI;
@@ -64,8 +62,6 @@
     [super viewDidLoad];
     
     [self addObserverForUserDefaultsKey:BDSKStartupBehaviorKey];
-    [[self updater] addObserver:self 
forKeyPath:@"automaticallyChecksForUpdates" options:0 
context:&BDSKBibPrefGeneralUpdaterObservationContext];
-    [[self updater] addObserver:self forKeyPath:@"updateCheckInterval" 
options:0 context:&BDSKBibPrefGeneralUpdaterObservationContext];
     [self updateEmailTemplateUI];
     [self updateDefaultBibFileUI];
        [self updateUpdaterUI];
@@ -164,11 +160,6 @@
 }
 
 - (void)dealloc{
-    @try {
-        [[self updater] removeObserver:self 
forKeyPath:@"automaticallyChecksForUpdates" 
context:&BDSKBibPrefGeneralUpdaterObservationContext];
-        [[self updater] removeObserver:self forKeyPath:@"updateCheckInterval" 
context:&BDSKBibPrefGeneralUpdaterObservationContext];
-    }
-    @catch (id e) {}
     [[NSNotificationCenter defaultCenter] removeObserver:self];
     [super dealloc];
 }
@@ -200,13 +191,4 @@
         [self chooseAutoOpenFile:nil];
 }
 
-- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object 
change:(NSDictionary *)change context:(void *)context {
-    if (context == &BDSKBibPrefGeneralUpdaterObservationContext) {
-        if ([self isViewLoaded])
-            [self updateUpdaterUI];
-    } else {
-        [super observeValueForKeyPath:keyPath ofObject:object change:change 
context:context];
-    }
-}
-
 @end

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to