diff options
| author | Paul Buetow <paul@buetow.org> | 2008-06-02 00:21:43 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-06-02 00:21:43 +0000 |
| commit | 378c2674fc704b2a6bbf0e6a01b721a7aea7c2e2 (patch) | |
| tree | ae228c2fb8c1387d2667322f60a649032c52c152 /sources/core/VSTask.java | |
| parent | a24f52761a623afa3c041b7823004952d8c5286e (diff) | |
saveing seems work, but may have bugs
Diffstat (limited to 'sources/core/VSTask.java')
| -rw-r--r-- | sources/core/VSTask.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java index a903868..1b8f744 100644 --- a/sources/core/VSTask.java +++ b/sources/core/VSTask.java @@ -119,7 +119,7 @@ public class VSTask implements Comparable, VSSerializable { this.process = process; this.taskTime = taskTime > 0 ? taskTime : 0; /* May be not null if called from deserialization */ - if (event == null) + if (this.event == null) this.event = event; this.prefs = process.getPrefs(); this.isGlobalTimed = !isLocal; @@ -286,6 +286,11 @@ public class VSTask implements Comparable, VSSerializable { buffer.append(event.toString()); buffer.append("; PID: "); buffer.append(process.getProcessID()); + /* + if (isProgrammed()) { + buffer.append("; Programmed"); + } + */ return buffer.toString(); } @@ -385,25 +390,27 @@ public class VSTask implements Comparable, VSSerializable { String eventClassname = (String) objectInputStream.readObject(); int eventID = ((Integer) objectInputStream.readObject()).intValue(); - VSAbstractEvent event = (VSAbstractEvent) - serialize.getObject(eventID, "event"); + VSAbstractEvent event = null; + + if (serialize.objectExists(eventID, "event")) { + event = (VSAbstractEvent) serialize.getObject(eventID, "event"); - if (event == null) { + } else { event = VSRegisteredEvents. createEventInstanceByClassname(eventClassname, process); serialize.setObject(eventID, "event", event); } + event.deserialize(serialize, objectInputStream); + int taskNum = ((Integer) objectInputStream.readObject()).intValue(); long taskTime = ((Long) objectInputStream.readObject()).longValue(); Boolean isGlobalTimed = (Boolean) objectInputStream.readObject(); Boolean isProgrammed = (Boolean) objectInputStream.readObject(); serialize.setObject(taskNum, "task", this); - init(taskTime, process, event, !isGlobalTimed.booleanValue()); - this.isProgrammed = isProgrammed.booleanValue(); } } |
