From 1922c4f6a43dacc7c0bcbe82cdeb6b9944c028da Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 12 Apr 2014 14:01:48 -0400 Subject: [PATCH] TW-1257 - TW-1257 The 'Syncing with :' message ignores verbosity tokens. --- ChangeLog | 1 + doc/man/taskrc.5.in | 2 +- src/commands/CmdSync.cpp | 34 +++++++++++++++++++--------------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7bccf8541..6f0ff1020 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,7 @@ Weber) - TW-261 Easy to create "not deletable" task (thanks to Jan Kunder). - TW-1255 New testing framework (thanks to Renato Alves). +- TW-1257 The 'Syncing with :' message ignores verbosity tokens. - TW-1258 Portuguese Localization (thanks to Renato Alves). - TW-1260 New virtual tags YESTERDAY, TOMORROW. - TW-1261 Migrate test bug.360.t to new unit testing framework (thanks to diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 44a3e138f..b57163a1e 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -253,7 +253,7 @@ control specific occasions when output is generated. This list may contain: edit Used the verbose template for the 'edit' command special Feedback when applying special tags project Feedback about project status changes - sync Feedback about the need for sync + sync Feedback about sync Note that the "on" setting is equivalent to all the tokens being specified, and the "nothing" setting is equivalent to none of the tokens being specified. diff --git a/src/commands/CmdSync.cpp b/src/commands/CmdSync.cpp index 618d2279c..3b042d369 100644 --- a/src/commands/CmdSync.cpp +++ b/src/commands/CmdSync.cpp @@ -149,8 +149,9 @@ int CmdSync::execute (std::string& output) request.setPayload (payload); - out << format (STRING_CMD_SYNC_PROGRESS, connection) - << "\n"; + if (context.verbose ("sync")) + out << format (STRING_CMD_SYNC_PROGRESS, connection) + << "\n"; // Ignore harmful signals. signal (SIGHUP, SIG_IGN); @@ -196,22 +197,24 @@ int CmdSync::execute (std::string& output) Task dummy; if (context.tdb2.get (uuid, dummy)) { - out << " " - << colorChanged.colorize ( - format (STRING_CMD_SYNC_MOD, - uuid, - from_server.get ("description"))) - << "\n"; + if (context.verbose ("sync")) + out << " " + << colorChanged.colorize ( + format (STRING_CMD_SYNC_MOD, + uuid, + from_server.get ("description"))) + << "\n"; context.tdb2.modify (from_server, false); } else { - out << " " - << colorAdded.colorize ( - format (STRING_CMD_SYNC_ADD, - uuid, - from_server.get ("description"))) - << "\n"; + if (context.verbose ("sync")) + out << " " + << colorAdded.colorize ( + format (STRING_CMD_SYNC_ADD, + uuid, + from_server.get ("description"))) + << "\n"; context.tdb2.add (from_server, false); } } @@ -297,7 +300,8 @@ int CmdSync::execute (std::string& output) status = 1; } - out << "\n"; + if (context.verbose ("sync")) + out << "\n"; output = out.str (); // Restore signal handling.