Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/SynchronizationManger.java24
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataDiff.java17
2 files changed, 20 insertions, 21 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/SynchronizationManger.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/SynchronizationManger.java
index cbdfd1592..f3d6be684 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/SynchronizationManger.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/SynchronizationManger.java
@@ -68,7 +68,6 @@ public class SynchronizationManger {
it.remove();
}
}
- diff.setHasChanged(diff.getChangedAttributes().size() > 0 || diff.getNewComments().size() > 0);
}
}
@@ -93,8 +92,8 @@ public class SynchronizationManger {
List<String> attributeIds = new ArrayList<String>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint connectorsExtensionPoint = registry.getExtensionPoint(ITasksCoreConstants.ID_PLUGIN
- + ".synchronizationParticipants"); //$NON-NLS-1$
+ IExtensionPoint connectorsExtensionPoint = registry
+ .getExtensionPoint(ITasksCoreConstants.ID_PLUGIN + ".synchronizationParticipants"); //$NON-NLS-1$
IExtension[] extensions = connectorsExtensionPoint.getExtensions();
for (IExtension extension : extensions) {
IConfigurationElement[] elements = extension.getConfigurationElements();
@@ -109,20 +108,15 @@ public class SynchronizationManger {
participant.setId(element.getAttribute("id")); //$NON-NLS-1$
participants.add(participant);
} else {
- status.add(new Status(
- IStatus.ERROR,
- ITasksCoreConstants.ID_PLUGIN,
- NLS.bind(
- "Connector core ''{0}'' does not extend expected class for extension contributed by {1}", //$NON-NLS-1$
- object.getClass().getCanonicalName(), element.getContributor()
- .getName())));
+ status.add(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, NLS.bind(
+ "Connector core ''{0}'' does not extend expected class for extension contributed by {1}", //$NON-NLS-1$
+ object.getClass().getCanonicalName(), element.getContributor().getName())));
}
} catch (Throwable e) {
- status.add(new Status(
- IStatus.ERROR,
- ITasksCoreConstants.ID_PLUGIN,
- NLS.bind(
- "Connector core failed to load for extension contributed by {0}", element.getContributor().getName()), e)); //$NON-NLS-1$
+ status.add(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN,
+ NLS.bind("Connector core failed to load for extension contributed by {0}", //$NON-NLS-1$
+ element.getContributor().getName()),
+ e));
}
}
} else if ("suppressIncoming".equals(element.getName())) { //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataDiff.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataDiff.java
index 74fefffa4..83fb7c4b6 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataDiff.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataDiff.java
@@ -38,12 +38,12 @@ public class TaskDataDiff implements ITaskDataDiff {
private final Set<ITaskComment> newComments = new LinkedHashSet<ITaskComment>();
+ private final Set<TaskAttribute> newAttachments = new LinkedHashSet<TaskAttribute>();
+
private final Set<ITaskAttributeDiff> changedAttributes = new LinkedHashSet<ITaskAttributeDiff>();
private final RepositoryModel repositoryModel;
- public boolean hasChanged;
-
private final TaskRepository repository;
public TaskDataDiff(RepositoryModel repositoryModel, TaskData newTaskData, TaskData oldTaskData) {
@@ -53,16 +53,16 @@ public class TaskDataDiff implements ITaskDataDiff {
this.repository = newTaskData.getAttributeMapper().getTaskRepository();
this.newTaskData = newTaskData;
this.oldTaskData = oldTaskData;
- this.hasChanged = true;
parse();
}
public boolean hasChanged() {
- return hasChanged;
+ return !changedAttributes.isEmpty() || !newComments.isEmpty() || !newAttachments.isEmpty();
}
+ @Deprecated
public void setHasChanged(boolean hasChanged) {
- this.hasChanged = hasChanged;
+
}
public TaskRepository getRepository() {
@@ -81,6 +81,10 @@ public class TaskDataDiff implements ITaskDataDiff {
return newComments;
}
+ public Collection<TaskAttribute> getNewAttachments() {
+ return newAttachments;
+ }
+
public Collection<ITaskAttributeDiff> getChangedAttributes() {
return changedAttributes;
}
@@ -127,6 +131,8 @@ public class TaskDataDiff implements ITaskDataDiff {
String type = attribute.getMetaData().getType();
if (TaskAttribute.TYPE_COMMENT.equals(type)) {
addChangedComment(oldAttribute, newAttribute);
+ } else if (TaskAttribute.TYPE_ATTACHMENT.equals(type)) {
+ newAttachments.add(attribute);
} else if (TaskAttribute.TYPE_OPERATION.equals(type)) {
// ignore
} else if (ignoreKind || attribute.getMetaData().getKind() != null) {
@@ -145,5 +151,4 @@ public class TaskDataDiff implements ITaskDataDiff {
}
}
}
-
}

Back to the top