完善定时提醒稳定性与管理能力

This commit is contained in:
2026-06-02 22:04:09 +08:00
parent c794e32023
commit 6c2926b57a
20 changed files with 1531 additions and 89 deletions
+21
View File
@@ -21,6 +21,7 @@ public:
QVector<ReminderItem> allReminders() const;
QVector<ReminderItem> pendingReminders() const;
ReminderCommand parseCommand(const QString &text) const;
void checkDueRemindersNow();
bool createReminder(
const QString &title,
@@ -28,9 +29,28 @@ public:
const QDateTime &remindAt,
ReminderItem *createdItem = nullptr,
QString *errorMessage = nullptr);
bool createReminder(
const QString &title,
const QString &originalText,
const QDateTime &remindAt,
const ReminderRecurrence &recurrence,
ReminderItem *createdItem = nullptr,
QString *errorMessage = nullptr);
bool snoozeReminder(
const ReminderItem &sourceItem,
int minutes,
ReminderItem *createdItem = nullptr,
QString *errorMessage = nullptr);
bool cancelReminder(const QString &id, QString *errorMessage = nullptr);
bool cancelReminderByQuery(const QString &query, ReminderItem *canceledItem = nullptr, QString *errorMessage = nullptr);
bool clearFinishedReminders(QString *errorMessage = nullptr);
bool pruneFinishedReminders(int retentionDays = 20, QString *errorMessage = nullptr);
bool updateReminder(
const QString &id,
const QString &title,
const QDateTime &remindAt,
const ReminderRecurrence &recurrence,
QString *errorMessage = nullptr);
QString pendingReminderSummary() const;
private:
@@ -44,6 +64,7 @@ private:
ReminderParser m_parser;
QVector<ReminderItem> m_items;
QTimer m_timer;
QTimer m_guardTimer;
TriggeredCallback m_triggeredCallback;
bool m_started = false;
};