Please make SUConstants.h, SUScheduledUpdateDriver.h checkForUpdatesWithDriver "Public" again.

Asked by dwood

I've updated to the latest "bzr clone lp:sparkle" (since it looks like a whole bunch of bugfixes were just landed, and I want a pretty stable version before you re-architect things) and I found that several header files are no longer public. This must be a mistake, yes? Our app (and I'm sure many other apps) need to make use of the various keys. We need, for example:

SUEnableAutomaticChecksKey -- to know whether to put up our dialog asking if we should check for updates; to use in preferences window, etc.

SUFeedURLKey -- we use this to modify and turn into an online release notes

Also, we were doing this per your advice to just do a check right away:
[[[NSApp delegate] sparkleUpdater] checkForUpdatesWithDriver:[[[SUScheduledUpdateDriver alloc] init] autorelease]];

The problem is that SUScheduledUpdateDriver are no longer exposed in the headers. (In fact, the method checkForUpdatesWithDriver is now a *private* method!)

Question information

Language:
English Edit question
Status:
Answered
For:
Sparkle Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
dwood (dwood-karelia) said :
#1

Ah I see you already merged in the big experimental branch you were tweeting about. I was trying to get the code *before* you did that merge. Well I will look at the code diffs for revision 0x0100 and see if I can figure out if there are workarounds what you did, or if there is really a problem of things being missing.

Revision history for this message
Andy Matuschak (andymatuschak) said :
#2

I decided that the client shouldn't directly know about things like pref keys and drivers.

For SUEnableAutomaticChecksKey, SUUpdater is KVC/KVO-compliant for automaticallyChecksForUpdates.

For SUFeedURLKey, SUUpdater is KVC/KVO-compliant for feedURL.

For [[[NSApp delegate] sparkleUpdater] checkForUpdatesWithDriver:[[[SUScheduledUpdateDriver alloc] init] autorelease]], use SUUpdater's -checkForUpdatesInBackground.

Revision history for this message
Andy Matuschak (andymatuschak) said :
#3

I thought this answer might be useful to others.

Revision history for this message
dwood (dwood-karelia) said :
#4

I was using NSUserDefaults to determine if a value had been set for SUEnableAutomaticChecksKey, (by check if objectForKey: was non-nil) so I would know whether or not to ask. If you just ask [SUUpdater automaticallyChecksForUpdates], it doesn't look like there is a way to know if a preference has been set yet. Can you think of a workaround or a way to expose that?

Also -- I want to check for updates immediately after user has set prefs to automatically check for updates. should I just invoke checkForUpdatesInBackground right afterwards, or will turning on "automaticallyChecksForUpdates" automatically do an immediate check?

Revision history for this message
Andy Matuschak (andymatuschak) said :
#5

We're chatting about the set state of the automatic checks key over in the comments on https://bugs.launchpad.net/sparkle/+bug/243884; take a look over there and see what you think!

As for the second question, if you just call setAutomaticallyChecksForUpdates:YES, it will automatically schedule the next check for the appropriate time. This is not necessarily immediate: if your check interval is a day, and it's been 23 hours, it'll schedule it for an hour from then. So if you really want to do that, go ahead and invoke checkForUpdatesInBackground right setting the value; that'll do the right thing.

Can you help with this problem?

Provide an answer of your own, or ask dwood for more information if necessary.

To post a message you must log in.