fix: issues running Analyze
This commit is contained in:
@@ -189,7 +189,8 @@
|
||||
- (NSUInteger)countUnread {
|
||||
NSUInteger count = 0;
|
||||
for (FeedArticle *article in self.articles) {
|
||||
count += article.unread;
|
||||
if (article.unread)
|
||||
count += 1;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// Unread articles list & mark articled read
|
||||
+ (NSArray<FeedArticle*>*)articlesAtPath:(nullable NSString*)path isFeed:(BOOL)feedFlag sorted:(BOOL)sortFlag unread:(BOOL)readFlag inContext:(NSManagedObjectContext*)moc limit:(NSUInteger)limit;
|
||||
+ (NSArray<NSString*>*)updateArticles:(NSArray<FeedArticle*>*)list markRead:(BOOL)markRead andOpen:(BOOL)openLinks inContext:(NSManagedObjectContext*)moc;
|
||||
+ (nullable NSArray<NSString*>*)updateArticles:(NSArray<FeedArticle*>*)list markRead:(BOOL)markRead andOpen:(BOOL)openLinks inContext:(NSManagedObjectContext*)moc;
|
||||
|
||||
// Restore sound state
|
||||
+ (void)cleanupAndShowAlert:(BOOL)flag;
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
|
||||
@return @c notificationID for all articles that were opened (empty if @c openLinks=NO or open failed).
|
||||
*/
|
||||
+ (NSArray<NSString*>*)updateArticles:(NSArray<FeedArticle*>*)list markRead:(BOOL)markRead andOpen:(BOOL)openLinks inContext:(NSManagedObjectContext*)moc {
|
||||
+ (nullable NSArray<NSString*>*)updateArticles:(NSArray<FeedArticle*>*)list markRead:(BOOL)markRead andOpen:(BOOL)openLinks inContext:(NSManagedObjectContext*)moc {
|
||||
if (openLinks) {
|
||||
NSMutableArray<NSURL*> *urls = [NSMutableArray arrayWithCapacity:list.count];
|
||||
for (FeedArticle *fa in list) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@import Cocoa;
|
||||
|
||||
CGMutablePathRef tinySVG_path(CGFloat scale, const char * code);
|
||||
void svgAddPath(CGContextRef context, CGFloat scale, const char * path);
|
||||
void svgAddCircle(CGContextRef context, CGFloat scale, CGFloat x, CGFloat y, CGFloat radius, bool clockwise);
|
||||
void svgAddRect(CGContextRef context, CGFloat scale, CGRect rect, CGFloat cornerRadius);
|
||||
|
||||
@@ -83,10 +83,7 @@ inline static void continueNum(char chr, struct SVGState *state) {
|
||||
# pragma mark - Parser
|
||||
|
||||
/// very basic svg path parser.
|
||||
/// @returns @c CGMutablePathRef which must be released with @c CGPathRelease()
|
||||
CGMutablePathRef tinySVG_path(CGFloat scale, const char * code) {
|
||||
CGMutablePathRef path = CGPathCreateMutable();
|
||||
|
||||
static void tinySVG_parse(const char * code, CGFloat scale, CGMutablePathRef path) {
|
||||
struct SVGState state = {
|
||||
.scale = scale,
|
||||
.op = '_',
|
||||
@@ -139,17 +136,17 @@ CGMutablePathRef tinySVG_path(CGFloat scale, const char * code) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
# pragma mark - External API
|
||||
|
||||
/// calls @c tinySVG_path and handles @c CGPath creation and release.
|
||||
void svgAddPath(CGContextRef context, CGFloat scale, const char * path) {
|
||||
CGMutablePathRef tmp = tinySVG_path(scale, path);
|
||||
CGContextAddPath(context, tmp);
|
||||
CGPathRelease(tmp);
|
||||
void svgAddPath(CGContextRef context, CGFloat scale, const char * code) {
|
||||
CGMutablePathRef path = CGPathCreateMutable();
|
||||
tinySVG_parse(code, scale, path);
|
||||
CGContextAddPath(context, path);
|
||||
CGPathRelease(path);
|
||||
}
|
||||
|
||||
/// calls @c CGPathAddArc with full circle
|
||||
|
||||
@@ -102,8 +102,8 @@ static NotificationType notifyType;
|
||||
/// @param identifier Used to identify a specific instance (and dismiss a previously shown notification).
|
||||
+ (void)send:(NSString *)identifier title:(nullable NSString *)title body:(nullable NSString *)body {
|
||||
UNMutableNotificationContent *msg = [UNMutableNotificationContent new];
|
||||
msg.title = title;
|
||||
msg.body = body;
|
||||
if (title) msg.title = title;
|
||||
if (body) msg.body = body;
|
||||
// common settings:
|
||||
// TODO: make sound configurable?
|
||||
msg.sound = [UNNotificationSound defaultSound];
|
||||
|
||||
Reference in New Issue
Block a user