From f07ea0a26a331adf249471084e5aca21afbd8422 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 30 Aug 2011 00:27:27 -0400 Subject: [PATCH] TDB2 - Converted 'duplicate' to TDB2. --- src/commands/CmdDuplicate.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/commands/CmdDuplicate.cpp b/src/commands/CmdDuplicate.cpp index fe8c2fdda..300f8fa64 100644 --- a/src/commands/CmdDuplicate.cpp +++ b/src/commands/CmdDuplicate.cpp @@ -54,14 +54,9 @@ int CmdDuplicate::execute (std::string& output) int count = 0; std::stringstream out; - std::vector tasks; - context.tdb.lock (context.config.getBoolean ("locking")); - context.tdb.loadPending (tasks); - // Apply filter. std::vector filtered; - filter (tasks, filtered); - + filter (filtered); if (filtered.size () == 0) { context.footnote (STRING_FEEDBACK_NO_TASKS_SP); @@ -100,7 +95,7 @@ int CmdDuplicate::execute (std::string& output) // Only allow valid tasks. dup.validate (); - context.tdb.add (dup); + context.tdb2.add (dup); ++count; if (context.config.getBoolean ("echo.command")) @@ -116,13 +111,9 @@ int CmdDuplicate::execute (std::string& output) context.footnote (onProjectChange (dup)); } - if (count) - context.tdb.commit (); - - context.tdb.unlock (); - // TODO Add count summary, like the 'done' command. + context.tdb2.commit (); output = out.str (); return rc; }