mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Fix issue with core build launch desc deletion.
When projects were deleted, sometimes the descriptors would not. We were creating our own core build launch descs which didn't have an equals method causing duplicate entries to be created. Arduino uses launch bar's project launch descs. This change does the same for core build. Change-Id: I2a6f60e92aaa20892d6c1d8331ded903b226984f
This commit is contained in:
parent
193cb87bfa
commit
4eb76a4ede
2 changed files with 2 additions and 49 deletions
|
@ -12,6 +12,7 @@ import org.eclipse.core.resources.IProject;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.launchbar.core.ILaunchDescriptor;
|
||||
import org.eclipse.launchbar.core.ILaunchDescriptorType;
|
||||
import org.eclipse.launchbar.core.ProjectLaunchDescriptor;
|
||||
import org.eclipse.launchbar.core.internal.Activator;
|
||||
|
||||
/**
|
||||
|
@ -25,7 +26,7 @@ public class CoreBuildLaunchDescriptorType implements ILaunchDescriptorType {
|
|||
// Make sure it's a new style build
|
||||
IProject project = (IProject) launchObject;
|
||||
if (Activator.getService(ICBuildConfigurationManager.class).supports(project)) {
|
||||
return new CoreBuildProjectLaunchDescriptor(this, project);
|
||||
return new ProjectLaunchDescriptor(this, project);
|
||||
}
|
||||
}
|
||||
// TODO IBinary
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2016 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.internal.core.launch;
|
||||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.PlatformObject;
|
||||
import org.eclipse.launchbar.core.ILaunchDescriptor;
|
||||
import org.eclipse.launchbar.core.ILaunchDescriptorType;
|
||||
|
||||
/**
|
||||
* A launch descriptor representing a project built with the new Core Build system.
|
||||
*/
|
||||
public class CoreBuildProjectLaunchDescriptor extends PlatformObject implements ILaunchDescriptor {
|
||||
|
||||
private final IProject project;
|
||||
private final CoreBuildLaunchDescriptorType type;
|
||||
|
||||
public CoreBuildProjectLaunchDescriptor(CoreBuildLaunchDescriptorType type, IProject project) {
|
||||
this.type = type;
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> T getAdapter(Class<T> adapter) {
|
||||
if (IProject.class.equals(adapter)) {
|
||||
return (T) project;
|
||||
} else {
|
||||
return super.getAdapter(adapter);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return project.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILaunchDescriptorType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue