fix: issues running Analyze

This commit is contained in:
relikd
2025-10-26 23:11:15 +01:00
parent bdf9d11853
commit c099c32cca
7 changed files with 14 additions and 17 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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

View File

@@ -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];