}
- (id) yieldToSelector:(SEL)selector withObject:(id)object {
- /*return [self performSelector:selector withObject:object];*/
-
volatile bool stopped(false);
NSMutableArray *context([NSMutableArray arrayWithObjects:
metadata->first_ = time;
}
+ bool versioned(false);
+
if (NSDate *date = [package objectForKey:@"LastSeen"]) {
time_t time([date timeIntervalSince1970]);
if (metadata->last_ < time || metadata->last_ == 0) {
metadata->last_ = time;
- goto last;
+ versioned = true;
}
- } else if (metadata->last_ == 0) last: {
- NSString *version([package objectForKey:@"LastVersion"]);
- if (CFStringGetCString((CFStringRef) version, buffer, sizeof(buffer), kCFStringEncodingUTF8)) {
- size_t length(strlen(buffer));
- uint16_t vhash(hashlittle(buffer, length));
+ } else if (metadata->last_ == 0) {
+ metadata->last_ = metadata->first_;
+ if (metadata->version_[0] == '\0')
+ versioned = true;
+ }
- size_t capped(std::min<size_t>(8, length));
- char *latest(buffer + length - capped);
+ if (versioned)
+ if (NSString *version = [package objectForKey:@"LastVersion"])
+ if (CFStringGetCString((CFStringRef) version, buffer, sizeof(buffer), kCFStringEncodingUTF8)) {
+ size_t length(strlen(buffer));
+ uint16_t vhash(hashlittle(buffer, length));
- strncpy(metadata->version_, latest, sizeof(metadata->version_));
- metadata->vhash_ = vhash;
- }
- }
+ size_t capped(std::min<size_t>(8, length));
+ char *latest(buffer + length - capped);
+
+ strncpy(metadata->version_, latest, sizeof(metadata->version_));
+ metadata->vhash_ = vhash;
+ }
}
// }}}
return _not(uint32_t) - value.key;
}
-_finline static void Stifle(uint8_t &value) {
-}
-
uint32_t PackagePrefixRadix(Package *self, void *context) {
size_t offset(reinterpret_cast<size_t>(context));
CYString &name([self cyname]);
uint8_t data[4];
- // 0.607997
-
if (offset == 0 && zeros != 0) {
memset(data, '0', zeros);
memcpy(data + zeros, text, 4 - zeros);
if (metadata->first_ == 0)
metadata->first_ = now_;
+ if (metadata->last_ == 0)
+ metadata->last_ = metadata->first_;
+
if (metadata->vhash_ != vhash || strncmp(metadata->version_, latest, sizeof(metadata->version_)) != 0) {
- metadata->last_ = now_;
+ if (metadata->version_[0] != '\0')
+ metadata->last_ = now_;
strncpy(metadata->version_, latest, sizeof(metadata->version_));
metadata->vhash_ = vhash;
- } else if (metadata->last_ == 0)
- metadata->last_ = metadata->first_;
+ }
_end
_profile(Package$initWithVersion$Section)
- (void) setPage:(CYViewController *)page;
- (void) loadData;
+// XXX: I hate prototypes
+- (id) queueBadgeController;
+
@end
static _finline void _setHomePage(Cydia *self) {
[search_ reloadData];
[(CYNavigationController *)[tabbar_ selectedViewController] reloadData];
+
+ [queueDelegate_ queueStatusDidChange];
+ [[[self queueBadgeController] tabBarItem] setBadgeValue:(Queuing_ ? UCLocalize("Q_D") : nil)];
}
- (int)indexOfTabWithTag:(int)tag {
}
- (void) confirmWithNavigationController:(UINavigationController *)navigation {
+ Queuing_ = false;
+
ProgressController *progress = [[[ProgressController alloc] initWithDatabase:database_ delegate:self] autorelease];
if (navigation != nil) {
@synchronized (self) {
if (clear) {
[database_ clear];
-
- // Stop queuing.
Queuing_ = false;
- [[[self queueBadgeController] tabBarItem] setBadgeValue:nil];
} else {
- // Start queuing.
Queuing_ = true;
- [[[self queueBadgeController] tabBarItem] setBadgeValue:UCLocalize("Q_D")];
}
[self _updateData];
- [queueDelegate_ queueStatusDidChange];
}
}