diff options
Diffstat (limited to 'sources/core/VSTask.java')
| -rw-r--r-- | sources/core/VSTask.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java index dbac3e9..bbc9cec 100644 --- a/sources/core/VSTask.java +++ b/sources/core/VSTask.java @@ -28,6 +28,7 @@ import java.io.*; import events.*; import events.implementations.*; import events.internal.*; +import exceptions.*; import prefs.VSPrefs; import protocols.VSAbstractProtocol; import serialize.*; @@ -101,9 +102,20 @@ public class VSTask implements Comparable, VSSerializable { * @param task the task to copy */ public VSTask(VSTask task) { + VSAbstractEvent event = task.getEvent(); + + try { + VSAbstractEvent copy = event.getCopy(); + // Use the copy of the event object + event = copy; + } catch (VSEventNotCopyableException e) { + // Use the original event object + System.out.println(e); + } + init(task.getTaskTime(), task.getProcess(), - task.getEvent(), + event, !task.isGlobalTimed()); } @@ -296,6 +308,17 @@ public class VSTask implements Comparable, VSSerializable { } /** + * Sets the process. + * + * @param process the process + */ + public void setProcess(VSProcess process) { + this.process = process; + // TODO:: use the process' specific event object + //this.event = null; + } + + /** * Gets the event. * * @return the event |
