summaryrefslogtreecommitdiffstats
path: root/src/mainwindow.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.h')
-rw-r--r--src/mainwindow.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 0912520..19635dd 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -390,6 +390,17 @@ private:
/// Redraws the unsynced-edits indicator from pendingEditCount().
void updatePendingIndicator();
+ /// Arms the debounce that syncs a confirmed tag edit out on its own
+ /// (item 71). Does nothing when the delay is negative, when no sync command
+ /// is configured, or when nothing is actually pending.
+ void scheduleAutoSync();
+
+ /// Starts the debounced automatic sync, unless a sync is already running
+ /// (local or external) or the edits it would carry are already gone.
+ ///
+ /// Q_INVOKABLE so a test can fire the debounce without waiting it out.
+ Q_INVOKABLE void runAutoSync();
+
/// Records one confirmed (message, tag) change, cancelling it against an
/// opposite change already outstanding for the same pair.
void recordPendingEdit(const QString &messageId, const QString &tag,
@@ -756,6 +767,14 @@ private:
/// nothing rather than marking the wrong one.
QString m_markReadThreadId;
+ /// Debounces the automatic sync that follows a tag edit (item 71).
+ ///
+ /// Single-shot and RESTARTED by every confirmed edit, for the same reason
+ /// m_markReadTimer is: tagging a multi-row selection confirms one write per
+ /// thread, and one sync per thread is exactly what a debounce exists to
+ /// prevent.
+ QTimer *m_autoSyncTimer = nullptr;
+
/// The optimistic update awaiting confirmation, kept so a worker error can
/// put the model back. Only the most recent one: mutations are sent from
/// the UI thread one user action at a time.