/
githubmirror
/
obs-studio
Обзор
Документация
Войти
/
githubmirror
/
obs-studio
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
frontend/utility/OBSUpdateDelegate.mm
45 строк
1 KB
PatTheMav
frontend: Add feedUrlStringForUpdater delegate
09 июн 2026, 01:49
09 июн 2026, 01:49
d91999b
Код
Авторство
О чём код?
#import "OBSUpdateDelegate.h" @implementation OBSUpdateDelegate { } @synthesize branch; - (nonnull NSSet<NSString *> *)allowedChannelsForUpdater:(nonnull SPUUpdater *)updater { return [NSSet setWithObject:branch]; } - (void)observeCanCheckForUpdatesWithAction:(nonnull QAction *)action; { [_updaterController.updater addObserver:self forKeyPath:NSStringFromSelector(@selector(canCheckForUpdates)) options:(NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew) context:(void *) action]; } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey, id> *)change context:(void *)context { if ([keyPath isEqualToString:NSStringFromSelector(@selector(canCheckForUpdates))]) { QAction *menuAction = (QAction *) context; menuAction->setEnabled(_updaterController.updater.canCheckForUpdates); } else { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } } - (NSString *)feedURLStringForUpdater:(SPUUpdater *)updater { return self.feedUrl; } - (void)dealloc { @autoreleasepool { [_updaterController.updater removeObserver:self forKeyPath:NSStringFromSelector(@selector(canCheckForUpdates))]; } } @end