Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2014-05-09 17:13:40 -0400
committerMarc-Andre Laperle2014-05-12 10:28:56 -0400
commitac922221fbff1901d22d2d3770fab2abea8ff689 (patch)
treed1cd9ee6aac178669709922e8a20fd071986c7dd
parent2773a5db6028c9be788b8f93b54d7c3a2b8a8395 (diff)
downloadorg.eclipse.linuxtools-ac922221fbff1901d22d2d3770fab2abea8ff689.tar.gz
org.eclipse.linuxtools-ac922221fbff1901d22d2d3770fab2abea8ff689.tar.xz
org.eclipse.linuxtools-ac922221fbff1901d22d2d3770fab2abea8ff689.zip
tmf: Fix the progress monitor in package export and import
Change-Id: I0d126a78904e84bae80ff789dc6410d6f727eb48 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Reviewed-on: https://git.eclipse.org/r/26314 Tested-by: Hudson CI Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com> Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/wizards/tracepkg/AbstractTracePackageOperation.java5
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/wizards/tracepkg/importexport/TracePackageExportOperation.java4
2 files changed, 5 insertions, 4 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/wizards/tracepkg/AbstractTracePackageOperation.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/wizards/tracepkg/AbstractTracePackageOperation.java
index 4a3f5d4be6..6e5a415b56 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/wizards/tracepkg/AbstractTracePackageOperation.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/wizards/tracepkg/AbstractTracePackageOperation.java
@@ -152,8 +152,9 @@ abstract public class AbstractTracePackageOperation {
protected int getNbCheckedElements(TracePackageElement[] elements) {
int totalWork = 0;
for (TracePackageElement tracePackageElement : elements) {
- if (tracePackageElement.getChildren() != null) {
- totalWork += getNbCheckedElements(tracePackageElement.getChildren());
+ TracePackageElement[] children = tracePackageElement.getChildren();
+ if (children != null && children.length > 0) {
+ totalWork += getNbCheckedElements(children);
} else if (tracePackageElement.isChecked()) {
++totalWork;
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/wizards/tracepkg/importexport/TracePackageExportOperation.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/wizards/tracepkg/importexport/TracePackageExportOperation.java
index c85e72a9d0..86347a33c4 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/wizards/tracepkg/importexport/TracePackageExportOperation.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/wizards/tracepkg/importexport/TracePackageExportOperation.java
@@ -196,7 +196,7 @@ public class TracePackageExportOperation extends AbstractTracePackageOperation {
// project/.traceExport/.tracing/A/B
IFolder folder = fExportFolder.getFolder(relativeToExportFolder.removeLastSegments(1));
- TraceUtils.createFolder(folder, monitor);
+ TraceUtils.createFolder(folder, new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
res.refreshLocal(0, new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
createExportResource(folder, res);
@@ -222,7 +222,7 @@ public class TracePackageExportOperation extends AbstractTracePackageOperation {
// project/.traceExport/A/B
IFolder folder = fExportFolder.getFolder(relativeToExportFolder.removeLastSegments(1));
- TraceUtils.createFolder(folder, monitor);
+ TraceUtils.createFolder(folder, new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
createExportResource(folder, resource);
Element fileElement = doc.createElement(ITracePackageConstants.TRACE_FILE_ELEMENT);

Back to the top