aboutsummaryrefslogtreecommitdiff
path: root/QSThingsPlugin/Parsers/QSThingsAppSectionsParser.m
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-09-11 17:13:17 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-09-11 17:13:17 +0200
commit5870e5cf03ceaff7080174b573618631a413110e (patch)
tree1bbd9d0c441a7316bcd1e7997b917a17ab5de978 /QSThingsPlugin/Parsers/QSThingsAppSectionsParser.m
parentce8b86a7522bda8896115ca7d0118c9d574f3a3f (diff)
Add tags and sections
Diffstat (limited to 'QSThingsPlugin/Parsers/QSThingsAppSectionsParser.m')
-rw-r--r--QSThingsPlugin/Parsers/QSThingsAppSectionsParser.m52
1 files changed, 52 insertions, 0 deletions
diff --git a/QSThingsPlugin/Parsers/QSThingsAppSectionsParser.m b/QSThingsPlugin/Parsers/QSThingsAppSectionsParser.m
new file mode 100644
index 0000000..70a37ae
--- /dev/null
+++ b/QSThingsPlugin/Parsers/QSThingsAppSectionsParser.m
@@ -0,0 +1,52 @@
+#import "Constants.h"
+#import "QSThingsAppSectionsParser.h"
+#import "SQLHelper.h"
+
+@implementation QSThingsAppSectionsParser
+- (BOOL)validParserForPath:(NSString *)path {
+ return [[path lastPathComponent] isEqualToString:@"main.sqlite"];
+}
+
+// This is not really a parser, but having the sqlite helps us
+// confirm that this makes sense.
+- (NSArray *)objectsFromPath:(NSString *)path withSettings:(NSDictionary *)settings {
+ NSMutableArray *objects = [NSMutableArray array];
+
+ // Inbox
+ QSObject *inbox = [QSObject
+ makeObjectWithIdentifier: ThingsAppSectionKeyInbox];
+ [inbox setName:@"Inbox"];
+ [inbox setPrimaryType:kAppSectionType];
+ [objects addObject:inbox];
+
+ // Today
+ QSObject *today = [QSObject
+ makeObjectWithIdentifier: ThingsAppSectionKeyToday];
+ [today setName:@"Today"];
+ [today setPrimaryType:kAppSectionType];
+ [objects addObject:today];
+
+ // Upcoming
+ QSObject *upcoming = [QSObject
+ makeObjectWithIdentifier: ThingsAppSectionKeyUpcoming];
+ [upcoming setName:@"Upcoming"];
+ [upcoming setPrimaryType:kAppSectionType];
+ [objects addObject:upcoming];
+
+ // Anytime
+ QSObject *anytime = [QSObject
+ makeObjectWithIdentifier: ThingsAppSectionKeyAnytime];
+ [anytime setName:@"Anytime"];
+ [anytime setPrimaryType:kAppSectionType];
+ [objects addObject:anytime];
+
+ // Anytime
+ QSObject *someday = [QSObject
+ makeObjectWithIdentifier: ThingsAppSectionKeySomeday];
+ [someday setName:@"Someday"];
+ [someday setPrimaryType:kAppSectionType];
+ [objects addObject:someday];
+
+ return objects;
+}
+@end