From 9fefd4f283b6f0614cd9bf625d60f2b3aee8ee95 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 30 Aug 2011 00:21:56 -0400 Subject: [PATCH] TDB2 - Converted 'edit' command to TDB2. --- src/commands/CmdEdit.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 17947f0ea..d5bfe0350 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -56,24 +56,18 @@ int CmdEdit::execute (std::string& output) { int rc = 0; - // Get all the tasks. - std::vector tasks; - context.tdb.lock (context.config.getBoolean ("locking")); + // Filter the tasks. handleRecurrence (); - context.tdb.load (tasks); - - // Apply filter. std::vector filtered; - filter (tasks, filtered); + filter (filtered); // Find number of matching tasks. Skip recurring parent tasks. std::vector ::iterator task; for (task = filtered.begin (); task != filtered.end (); ++task) if (editFile (*task)) - context.tdb.update (*task); + context.tdb2.modify (*task); - context.tdb.commit (); - context.tdb.unlock (); + context.tdb2.commit (); return rc; }