From c830b4b669929f2e1ffed934008f162e9ab2dbe6 Mon Sep 17 00:00:00 2001 From: Wilhelm Schuermann Date: Thu, 2 Apr 2015 12:55:20 +0200 Subject: [PATCH] TW-1287: default.* values applied to synced tasks - Tasks that arrive through "task sync" no longer have defaults applied to them. --- ChangeLog | 1 + src/TDB2.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d95b5e280..a523a41bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2.4.3 () - - TW-1279 Make default.* not apply to recurring tasks. +- TW-1287 Make default.* not apply to synced tasks. - TW-1578 Bash tab completion problems on first run (thanks to Renato Alves and Ptolemarch). - TW-1580 "modified" attribute no longer updated (thanks to David Patrick). diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 7c25747d0..3c02e565b 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -569,7 +569,9 @@ void TDB2::set_location (const std::string& location) void TDB2::add (Task& task, bool add_to_backlog /* = true */) { // Ensure the task is consistent, and provide defaults if necessary. - task.validate (); + // bool argument to validate() is "applyDefault". Pass add_to_backlog through + // in order to not apply defaults to synchronized tasks. + task.validate (add_to_backlog); std::string uuid = task.get ("uuid"); // If the tasks are loaded, then verify that this uuid is not already in @@ -588,7 +590,7 @@ void TDB2::add (Task& task, bool add_to_backlog /* = true */) //////////////////////////////////////////////////////////////////////////////// void TDB2::modify (Task& task, bool add_to_backlog /* = true */) { - // Ensure the task is consistent, and provide defaults if necessary. + // Ensure the task is consistent. task.validate (false); std::string uuid = task.get ("uuid");