Permalink
Browse files

Fixes 243884

Made Sparkle.h no longer a massive multi-headed abomination: now only SUAppcastItem, SUAppcast and SUUpdater (and SUVersionComparisonProtocol because it's part of the delegate protocol) are public.

COMPATIBILITY ISSUE:
This means there's no longer a public SUProbingUpdateDriver or a checkForUpdatesWithDriver: method. Now use checkForUpdateInformation. I may change that API before release, though. I'm thinking it might be better to give the delegate the opportunity to reject a potential update instead: then you'd just call checkForUpdatesInBackground and override that delegate method to always return NO. We'll see.
  • Loading branch information...
andymatuschak committed Jul 24, 2008
1 parent de9be8b commit f815eec2c0411c3bad526a1e70c9b7756ab21500
View
@@ -9,7 +9,6 @@
#ifndef SUAPPCASTITEM_H
#define SUAPPCASTITEM_H
-
@interface SUAppcastItem : NSObject {
NSString *title;
NSDate *date;
View
@@ -6,9 +6,10 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
#import "SUAutomaticUpdateAlert.h"
+#import "SUHost.h"
+
@implementation SUAutomaticUpdateAlert
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost delegate:del;
@@ -7,7 +7,9 @@
//
#import "SUAutomaticUpdateDriver.h"
-#import "Sparkle.h"
+
+#import "SUAutomaticUpdateAlert.h"
+#import "SUHost.h"
@implementation SUAutomaticUpdateDriver
View
@@ -6,10 +6,13 @@
// Copyright 2008 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
#import "SUBasicUpdateDriver.h"
+#import "SUHost.h"
#import "SUDSAVerifier.h"
+#import "SUInstaller.h"
+#import "SUStandardVersionComparator.h"
+#import "SUUnarchiver.h"
@implementation SUBasicUpdateDriver
View
@@ -5,7 +5,9 @@
// Copyright 2008 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
+#import "SUHost.h"
+
+#import "SUSystemProfiler.h"
#import <sys/mount.h> // For statfs for isRunningOnReadOnlyVolume
@implementation SUHost
View
@@ -9,6 +9,7 @@
#ifndef SUSYSTEMPROFILER_H
#define SUSYSTEMPROFILER_H
+@class SUHost;
@interface SUSystemProfiler : NSObject {}
+ (SUSystemProfiler *)sharedSystemProfiler;
- (NSMutableArray *)systemProfileArrayForHost:(SUHost *)host;
View
@@ -7,9 +7,9 @@
// Adapted from Sparkle+, by Tom Harrington.
//
-#import "Sparkle.h"
#import "SUSystemProfiler.h"
+#import "SUHost.h"
#import <sys/sysctl.h>
@implementation SUSystemProfiler
View
@@ -7,7 +7,10 @@
//
#import "SUUIBasedUpdateDriver.h"
-#import "Sparkle.h"
+
+#import "SUUpdateAlert.h"
+#import "SUHost.h"
+#import "SUStatusController.h"
@implementation SUUIBasedUpdateDriver
View
@@ -6,9 +6,9 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
#import "SUUpdateAlert.h"
+#import "SUHost.h"
#import <WebKit/WebKit.h>
@implementation SUUpdateAlert
@@ -9,7 +9,7 @@
#ifndef SUUPDATEPERMISSIONPROMPT_H
#define SUUPDATEPERMISSIONPROMPT_H
-#import "Sparkle.h"
+#import "SUWindowController.h"
typedef enum {
SUAutomaticallyCheck,
@@ -8,6 +8,7 @@
#import "SUUpdatePermissionPrompt.h"
+#import "SUHost.h"
@implementation SUUpdatePermissionPrompt
@@ -69,7 +70,7 @@ - (NSString *)promptDescription
- (NSArray *)systemProfileInformationArray
{
- return [[SUSystemProfiler sharedSystemProfiler] systemProfileArrayForHost:host];
+ return [host systemProfile];
}
- (IBAction)toggleMoreInfo:(id)sender
View
@@ -9,10 +9,9 @@
#ifndef SUUPDATER_H
#define SUUPDATER_H
-#import "SUUpdateAlert.h"
-#import "SUVersionComparisonProtocol.h"
+#import <Sparkle/SUVersionComparisonProtocol.h>
-@class SUUpdateDriver, SUAppcastItem, SUAppcast;
+@class SUUpdateDriver, SUAppcastItem, SUHost, SUAppcast;
@interface SUUpdater : NSObject {
NSTimer *checkTimer;
SUUpdateDriver *driver;
@@ -37,8 +36,9 @@
// update is found, it will be downloaded and prepped for installation.
- (void)checkForUpdatesInBackground;
-// This forces an update to begin with a particular driver (see SU*UpdateDriver.h)
-- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)driver;
+// This begins a "probing" check for updates which will not actually offer to update to that version. The delegate methods, though,
+// (up to updater:didFindValidUpdate: and updaterDidNotFindUpdate:), are called, so you can use that information in your UI.
+- (void)checkForUpdateInformation;
// Call this to appropriately schedule or cancel the update checking timer according to the preferences for time interval and automatic checks.
- (void)resetUpdateCycle;
View
@@ -6,10 +6,18 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
-#import "Sparkle.h"
#import "SUUpdater.h"
+#import "SUHost.h"
+#import "SUUpdatePermissionPrompt.h"
+
+#import "SUAutomaticUpdateDriver.h"
+#import "SUProbingUpdateDriver.h"
+#import "SUUserInitiatedUpdateDriver.h"
+#import "SUScheduledUpdateDriver.h"
+
@interface SUUpdater (Private)
+- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)updateDriver;
- (NSArray *)feedParameters;
- (BOOL)automaticallyUpdates;
- (BOOL)shouldScheduleUpdateCheck;
@@ -162,6 +170,11 @@ - (IBAction)checkForUpdates:sender
[self checkForUpdatesWithDriver:[[[SUUserInitiatedUpdateDriver alloc] init] autorelease]];
}
+- (void)checkForUpdateInformation
+{
+ [self checkForUpdatesWithDriver:[[[SUProbingUpdateDriver alloc] init] autorelease]];
+}
+
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)d
{
if ([self updateInProgress]) { return; }
@@ -7,7 +7,9 @@
//
#import "SUUserInitiatedUpdateDriver.h"
-#import "Sparkle.h"
+
+#import "SUStatusController.h"
+#import "SUHost.h"
@implementation SUUserInitiatedUpdateDriver
View
@@ -6,47 +6,15 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//
-//
-// Prefix header for all source files of the 'Sparkle' target in the 'Sparkle' project.
-//
-
#ifndef SPARKLE_H
#define SPARKLE_H
-#define SULocalizedString(key,comment) NSLocalizedStringFromTableInBundle(key, @"Sparkle", [NSBundle bundleWithIdentifier:@"org.andymatuschak.Sparkle"], comment)
-#define SUAbstractFail() NSAssert2(nil, @"Can't call %@ on an instance of %@; this is an abstract method!", __PRETTY_FUNCTION__, [self class]);
-
-#ifdef __OBJC__
-#import <Cocoa/Cocoa.h>
-#import "SUConstants.h"
-#endif
-
-
// This list should include the shared headers. It doesn't matter if some of them aren't shared (unless
// there are name-space collisions) so we can list all of them to start with:
-#import "NTSynchronousTask.h"
-#import "SUAppcast.h"
-#import "SUAppcastItem.h"
-#import "SUAutomaticUpdateAlert.h"
-#import "SUAutomaticUpdateDriver.h"
-#import "SUBasicUpdateDriver.h"
-#import "SUConstants.h"
-#import "SUHost.h"
-#import "SUInstaller.h"
-#import "SUProbingUpdateDriver.h"
-#import "SUScheduledUpdateDriver.h"
-#import "SUStandardVersionComparator.h"
-#import "SUStatusController.h"
-#import "SUSystemProfiler.h"
-#import "SUUIBasedUpdateDriver.h"
-#import "SUUnarchiver.h"
-#import "SUUpdateAlert.h"
-#import "SUUpdateDriver.h"
-#import "SUUpdater.h"
-#import "SUUpdatePermissionPrompt.h"
-#import "SUUserInitiatedUpdateDriver.h"
-#import "SUVersionComparisonProtocol.h"
-#import "SUWindowController.h"
+#import <Sparkle/SUAppcast.h>
+#import <Sparkle/SUAppcastItem.h>
+#import <Sparkle/SUUpdater.h>
+#import <Sparkle/SUVersionComparisonProtocol.h>
#endif
View
@@ -0,0 +1,15 @@
+//
+// Sparkle.pch
+// Sparkle
+//
+// Created by Andy Matuschak on 7/23/08.
+// Copyright 2008 Andy Matuschak. All rights reserved.
+//
+
+#define SULocalizedString(key,comment) NSLocalizedStringFromTableInBundle(key, @"Sparkle", [NSBundle bundleWithIdentifier:@"org.andymatuschak.Sparkle"], comment)
+#define SUAbstractFail() NSAssert2(nil, @"Can't call %@ on an instance of %@; this is an abstract method!", __PRETTY_FUNCTION__, [self class]);
+
+#ifdef __OBJC__
+#import <Cocoa/Cocoa.h>
+#import "SUConstants.h"
+#endif
Oops, something went wrong.

0 comments on commit f815eec

Please sign in to comment.