Subscribe to checkForUpdatesCommand's return value.
This commit is contained in:
parent
73ec7783af
commit
8ee1e1d208
1 changed files with 29 additions and 29 deletions
|
@ -37,6 +37,12 @@ void AutoUpdater::SetFeedURL(const std::string& feed) {
|
|||
NSURL* url = [NSURL URLWithString:base::SysUTF8ToNSString(feed)];
|
||||
NSURLRequest* urlRequest = [NSURLRequest requestWithURL:url];
|
||||
g_updater = [[SQRLUpdater alloc] initWithUpdateRequest:urlRequest];
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void AutoUpdater::CheckForUpdates() {
|
||||
RACSignal* signal = [g_updater.checkForUpdatesCommand execute:nil];
|
||||
|
||||
AutoUpdaterDelegate* delegate = GetDelegate();
|
||||
if (!delegate)
|
||||
|
@ -44,7 +50,7 @@ void AutoUpdater::SetFeedURL(const std::string& feed) {
|
|||
|
||||
// Subscribe to events.
|
||||
__block bool has_update = false;
|
||||
[g_updater.updates subscribeNext:^(SQRLDownloadedUpdate* downloadedUpdate) {
|
||||
[signal subscribeNext:^(SQRLDownloadedUpdate* downloadedUpdate) {
|
||||
has_update = true;
|
||||
|
||||
// There is a new update that has been downloaded.
|
||||
|
@ -66,11 +72,5 @@ void AutoUpdater::SetFeedURL(const std::string& feed) {
|
|||
has_update = false;
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void AutoUpdater::CheckForUpdates() {
|
||||
[g_updater.checkForUpdatesCommand execute:nil];
|
||||
}
|
||||
|
||||
} // namespace auto_updater
|
||||
|
|
Loading…
Add table
Reference in a new issue