| Summary: | [Pin&Clone] Pinned view shows wrong content for multiple selection | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Nobody - feel free to take it <nobody> | ||||
| Component: | cdt-debug-dsf-gdb | Assignee: | Patrick Chuong <pchuong> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Marc Khouzam <marc.khouzam> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | cdtdoug, pawel.1.piech, pchuong | ||||
| Version: | 8.0 | Flags: | pchuong:
iplog-
|
||||
| Target Milestone: | 8.1.0 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Nobody - feel free to take it
I think we use the first context of a multi-select. I don't believe we ever considered how to properly handled a multi-selection case. (In reply to comment #1) > I think we use the first context of a multi-select. I don't believe we ever > considered how to properly handled a multi-selection case. It seems the first element of the selection is passed from the platform. I thought the second view wouldn't react to it because it is pinned to another context. Perhaps we should blank out the view if there is a context that is not pinned to the view instance, or filter the selection before firing the event to the pinned view. I am still behind on git :), need to catch up on git for creating patch and commit it back to head.
Anyway, if you replace DebugEventFilterService#debugContextChanged with this piece of code, you won't see the second view change.
public void debugContextChanged(DebugContextEvent event) {
ISelection eventContext = event.getContext();
if (eventContext instanceof IStructuredSelection) {
List<Object> filteredContextList = new ArrayList<Object>();
List<?> eventContextList = ((IStructuredSelection)eventContext).toList();
for (Object o : eventContextList) {
if (fProvider.isPinnedTo(o)) {
if (fProvider != event.getDebugContextProvider()) {
filteredContextList.add(o);
}
}
}
if (filteredContextList.size() > 0) {
fProvider.delegateEvent(new DebugContextEvent(fProvider, new StructuredSelection(filteredContextList), event.getFlags()));
}
}
}
(In reply to comment #4) Thanks Patrick, I'll try it. Created attachment 208443 [details]
fix
Mikhail, can you try out this patch?
Works fine. Thanks Patrick. Verified by Mikhail. Committed to master. *** cdt git genie on behalf of Patrick Chuong ***
Bug 358135 - [Pin&Clone] Pinned view shows wrong content for multiple
selection
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=349cdb089d6d56c6e7a8d8b2b5e86e608885b48c
|