From 32392b8650a0d54ba232ecf253d1212f94deed46 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 2 Jul 2011 09:59:50 -0400 Subject: [PATCH] Edit - reenabled - Reenabled the edit command with the new filtering mechanism. --- src/commands/CmdEdit.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 2c58d77c5..fdbace39b 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -56,29 +56,24 @@ int CmdEdit::execute (std::string& output) { int rc = 0; -/* - std::stringstream out; - + // Get all the tasks. std::vector tasks; context.tdb.lock (context.config.getBoolean ("locking")); handleRecurrence (); - Filter filter; - context.tdb.loadPending (tasks, filter); + context.tdb.load (tasks); - // Filter sequence. - std::vector all = tasks; - context.filter.applySequence (tasks, context.sequence); + // Apply filter. + std::vector filtered; + filter (tasks, filtered); + // Find number of matching tasks. Skip recurring parent tasks. std::vector ::iterator task; - for (task = tasks.begin (); task != tasks.end (); ++task) + for (task = filtered.begin (); task != filtered.end (); ++task) if (editFile (*task)) context.tdb.update (*task); context.tdb.commit (); context.tdb.unlock (); - - output = out.str (); -*/ return rc; }