From 0747cc38aaed5ae005345b73842a8ca74043f501 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 28 Jul 2015 00:20:28 -0400 Subject: [PATCH] CmdImport: Removed unused method --- src/commands/CmdImport.cpp | 58 -------------------------------------- src/commands/CmdImport.h | 1 - 2 files changed, 59 deletions(-) diff --git a/src/commands/CmdImport.cpp b/src/commands/CmdImport.cpp index e75d84824..04861e6ef 100644 --- a/src/commands/CmdImport.cpp +++ b/src/commands/CmdImport.cpp @@ -96,64 +96,6 @@ int CmdImport::execute (std::string& output) return rc; } -//////////////////////////////////////////////////////////////////////////////// -int CmdImport::import (std::vector & lines) -{ - int count = 0; - for (auto& line : lines) - { - std::string object = trimLeft ( - trimRight ( - trimRight ( - trim (line), - ","), - "]"), - "["); - - // Skip blanks. May be caused by the trim calls above. - if (! object.length ()) - continue; - - // Parse the whole thing. - Task task (object); - - // Check whether the imported task is new or a modified existing task. - Task before; - if (context.tdb2.get (task.get ("uuid"), before)) - { - // "modified:" is automatically set to the current time when a task is - // changed. If the imported task has a modification timestamp we need - // to ignore it in taskDiff() in order to check for meaningful - // differences. Setting it to the previous value achieves just that. - task.set ("modified", before.get ("modified")); - if (taskDiff (before, task)) - { - CmdModify modHelper; - modHelper.checkConsistency (before, task); - count += modHelper.modifyAndUpdate (before, task); - std::cout << " mod "; - } - else - { - std::cout << " skip "; - } - } - else - { - context.tdb2.add (task); - std::cout << " add "; - ++count; - } - - std::cout << task.get ("uuid") - << " " - << task.get ("description") - << "\n"; - } - - return count; -} - //////////////////////////////////////////////////////////////////////////////// int CmdImport::import (const std::string& input) { diff --git a/src/commands/CmdImport.h b/src/commands/CmdImport.h index 877340895..efef274e1 100644 --- a/src/commands/CmdImport.h +++ b/src/commands/CmdImport.h @@ -38,7 +38,6 @@ public: int execute (std::string&); private: - int import (std::vector &); int import (const std::string&); void importSingleTask (json::object*); };