Import: Reuse CmdModify's checks

- Make updating tasks with "task import" run the same checks and update
  the same things as "task modify" would.
This commit is contained in:
Wilhelm Schuermann 2015-05-31 16:05:54 +02:00
parent 9067194390
commit f4361d5c65
2 changed files with 7 additions and 2 deletions

View file

@ -34,6 +34,7 @@
#include <i18n.h>
#include <main.h>
#include <CmdImport.h>
#include <CmdModify.h>
extern Context context;
@ -122,9 +123,10 @@ int CmdImport::import (std::vector <std::string>& lines)
task.set ("modified", before.get ("modified"));
if (taskDiff (before, task))
{
context.tdb2.modify (task);
CmdModify modHelper;
modHelper.checkConsistency (before, task);
count += modHelper.modifyAndUpdate (before, task);
std::cout << " mod ";
++count;
}
else
{