Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2006-01-13 20:38:29 -0500
committermkersten2006-01-13 20:38:29 -0500
commitfeedd9dfcebfc8b02303d9b269b05ccf45ac327f (patch)
treedaf0dfb8190250111971612eeb4582ccb7fcc3da
parent232a743f1a56a6f7e50c4332b1ba1fddeeb2e3e6 (diff)
downloadorg.eclipse.mylyn.tasks-feedd9dfcebfc8b02303d9b269b05ccf45ac327f.tar.gz
org.eclipse.mylyn.tasks-feedd9dfcebfc8b02303d9b269b05ccf45ac327f.tar.xz
org.eclipse.mylyn.tasks-feedd9dfcebfc8b02303d9b269b05ccf45ac327f.zip
Fixed context handle bug
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskDataExportTest.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskListManager.java6
2 files changed, 6 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskDataExportTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskDataExportTest.java
index b33154b83..0219c2201 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskDataExportTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskDataExportTest.java
@@ -77,7 +77,7 @@ public class TaskDataExportTest extends AbstractContextTest {
MylarPlugin.getContextManager().contextActivated(mockContext);
// Save the context file and check that it exists
- MylarPlugin.getContextManager().saveContext(mockContext.getId());
+ MylarPlugin.getContextManager().saveContext(mockContext.getHandleIdentifier());
File taskFile = MylarPlugin.getContextManager().getFileForContext(task1.getHandleIdentifier());
assertTrue(MylarPlugin.getContextManager().hasContext(task1.getHandleIdentifier()));
assertTrue(taskFile.exists());
@@ -91,7 +91,7 @@ public class TaskDataExportTest extends AbstractContextTest {
destinationDir.delete();
assertFalse(destinationDir.exists());
- MylarPlugin.getContextManager().contextDeactivated(mockContext.getId());
+ MylarPlugin.getContextManager().contextDeactivated(mockContext.getHandleIdentifier());
MylarTaskListPlugin.getRepositoryManager().removeRepository(repository);
super.tearDown();
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskListManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskListManager.java
index 95f99d5d4..d4b593f95 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskListManager.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/TaskListManager.java
@@ -87,8 +87,10 @@ public class TaskListManager {
}
taskListInitialized = true;
for (ITaskActivityListener listener : listeners) listener.tasklistRead();
- for (ITask active: taskList.getActiveTasks()) {
- activateTask(active);
+ // only activate the first task to avoid confusion of mutliple active tasks on startup
+ List<ITask> activeTasks = taskList.getActiveTasks();
+ if (activeTasks.size() > 0) {
+ activateTask(activeTasks.get(0));
}
} catch (Exception e) {
MylarStatusHandler.log(e, "Could not read task list");

Back to the top