Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2007-06-07 14:23:04 -0400
committerrelves2007-06-07 14:23:04 -0400
commit464b52416a18c50d737625b2baab0817cb8671e6 (patch)
treedd717050b8449094885285fa1bc5cbf8b7784b75
parent0f301b3a53988ccbaf4782fb3dce11143af4386a (diff)
downloadorg.eclipse.mylyn.tasks-464b52416a18c50d737625b2baab0817cb8671e6.tar.gz
org.eclipse.mylyn.tasks-464b52416a18c50d737625b2baab0817cb8671e6.tar.xz
org.eclipse.mylyn.tasks-464b52416a18c50d737625b2baab0817cb8671e6.zip
ASSIGNED - bug 189066: [api] updateTaskFromTaskData() should not block
https://bugs.eclipse.org/bugs/show_bug.cgi?id=189066
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java58
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java26
2 files changed, 43 insertions, 41 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
index a6e1a2b37..3b0a32e6d 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskList.java
@@ -149,28 +149,52 @@ public class TaskList {
* @param container task container, query or parent task
*/
public void addTask(ITask task, AbstractTaskContainer container) {
-
- if (!tasks.containsKey(task.getHandleIdentifier())) {
- tasks.put(task.getHandleIdentifier(), task);
- archiveContainer.add(task);
- task.setContainer(archiveContainer);
- } else {
- task = tasks.get(task.getHandleIdentifier());
+
+ ITask newTask = tasks.get(task.getHandleIdentifier());
+
+ if (newTask == null) {
+ newTask = task;
+ tasks.put(newTask.getHandleIdentifier(), newTask);
+ archiveContainer.add(newTask);
+ newTask.setContainer(archiveContainer);
+ for (ITaskListChangeListener listener : changeListeners) {
+ listener.taskAdded(newTask);
+ }
}
-
+
if (container != null) {
- container.add(task);
+ container.add(newTask);
if (!(container instanceof ITask) && !(container instanceof AbstractRepositoryQuery)) {
- task.setContainer(container);
+ newTask.setContainer(container);
}
} else {
- uncategorizedCategory.add(task);
- task.setContainer(uncategorizedCategory);
- }
- for (ITaskListChangeListener listener : changeListeners) {
- listener.taskAdded(task);
- }
- }
+ uncategorizedCategory.add(newTask);
+ newTask.setContainer(uncategorizedCategory);
+ }
+ }
+// public void addTask(ITask task, AbstractTaskContainer container) {
+//
+// if (!tasks.containsKey(task.getHandleIdentifier())) {
+// tasks.put(task.getHandleIdentifier(), task);
+// archiveContainer.add(task);
+// task.setContainer(archiveContainer);
+// } else {
+// task = tasks.get(task.getHandleIdentifier());
+// }
+//
+// if (container != null) {
+// container.add(task);
+// if (!(container instanceof ITask) && !(container instanceof AbstractRepositoryQuery)) {
+// task.setContainer(container);
+// }
+// } else {
+// uncategorizedCategory.add(task);
+// task.setContainer(uncategorizedCategory);
+// }
+// for (ITaskListChangeListener listener : changeListeners) {
+// listener.taskAdded(task);
+// }
+// }
public void refactorRepositoryUrl(String oldRepositoryUrl, String newRepositoryUrl) {
for (ITask task : tasks.values()) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java
index 59c7b4ff2..81cd12707 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/SynchronizeQueryJob.java
@@ -119,32 +119,10 @@ class SynchronizeQueryJob extends Job {
QueryHitCollector.MAX_HITS_REACHED + "\n" + repositoryQuery.getSummary(), this);
}
- // Notification state code
- // Set<AbstractRepositoryTask> oldHits = repositoryQuery.getHits();
- // for (AbstractRepositoryTask oldHit : oldHits) {
- // collector.getTaskHits().
- // int index = newHits.indexOf(oldHit);
- // if (index != -1) {
- // newHits.get(index).setNotified(oldHit.isNotified());
- // }
- // }
- // for (AbstractQueryHit hit : newHits) {
- // this.addHit(hit);
- // }
-
-// repositoryQuery.clear();
-// for (AbstractRepositoryTask hit : collector.getTaskHits()) {
-// taskList.addTask(hit, repositoryQuery);
-// }
-
-
- Set<AbstractRepositoryTask> hits = collector.getTaskHits();
- hits.removeAll(repositoryQuery.getChildren());
- //repositoryQuery.clear();
- for (AbstractRepositoryTask hit : hits) {
+ repositoryQuery.clear();
+ for (AbstractRepositoryTask hit : collector.getTaskHits()) {
taskList.addTask(hit, repositoryQuery);
}
-
if (synchChangedTasks) {
repositories.add(repository);

Back to the top