Skip to main content
summaryrefslogtreecommitdiffstats
path: root/qt
diff options
context:
space:
mode:
authorDoug Schaefer2016-09-27 23:35:36 -0400
committerGerrit Code Review @ Eclipse.org2016-10-12 19:19:19 -0400
commite371ba0919f68b50543500521c4d0d111e0e2650 (patch)
tree7b48265fc5504f1c7d02cbc616f71a0ce571e9d7 /qt
parent23f68c6c3518f558d0c484b96df54ad5e85ffb23 (diff)
downloadorg.eclipse.cdt-e371ba0919f68b50543500521c4d0d111e0e2650.tar.gz
org.eclipse.cdt-e371ba0919f68b50543500521c4d0d111e0e2650.tar.xz
org.eclipse.cdt-e371ba0919f68b50543500521c4d0d111e0e2650.zip
Updates for Core Build.
Diffstat (limited to 'qt')
-rw-r--r--qt/org.eclipse.cdt.qt.core/plugin.xml45
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfiguration.java6
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfigurationProvider.java42
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLaunchDescriptor.java50
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLaunchDescriptorType.java41
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLocalLaunchConfigationProvider.java36
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLocalRunLaunchConfigDelegate.java66
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/project/QtProjectGenerator.java23
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/IQtBuildConfiguration.java4
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtLaunchConfigurationProvider.java98
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.cpp2
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.pro2
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.qrc2
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project2/appProject/manifest.xml5
14 files changed, 67 insertions, 355 deletions
diff --git a/qt/org.eclipse.cdt.qt.core/plugin.xml b/qt/org.eclipse.cdt.qt.core/plugin.xml
index 56a4eb9ca0..e55bf9b4b4 100644
--- a/qt/org.eclipse.cdt.qt.core/plugin.xml
+++ b/qt/org.eclipse.cdt.qt.core/plugin.xml
@@ -115,51 +115,6 @@
<persistent value="true"/>
</extension>
<extension
- point="org.eclipse.launchbar.core.launchBarContributions">
- <descriptorType
- class="org.eclipse.cdt.internal.qt.core.launch.QtLaunchDescriptorType"
- id="org.eclipse.cdt.qt.core.launchDescriptorType"
- priority="10">
- <enablement>
- <instanceof
- value="org.eclipse.core.resources.IProject">
- </instanceof>
- <test
- forcePluginActivation="true"
- property="org.eclipse.core.resources.projectNature"
- value="org.eclipse.cdt.qt.core.qtNature">
- </test>
- </enablement>
- </descriptorType>
- <configProvider
- class="org.eclipse.cdt.internal.qt.core.launch.QtLocalLaunchConfigationProvider"
- descriptorType="org.eclipse.cdt.qt.core.launchDescriptorType"
- priority="10">
- </configProvider>
- </extension>
- <extension
- point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- delegate="org.eclipse.cdt.internal.qt.core.launch.QtLocalRunLaunchConfigDelegate"
- id="org.eclipse.cdt.qt.core.launchConfigurationType"
- modes="run"
- name="Qt Local Application"
- public="true"
- sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
- sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer">
- </launchConfigurationType>
- </extension>
- <extension
- point="org.eclipse.debug.core.launchDelegates">
- <launchDelegate
- delegate="org.eclipse.cdt.internal.qt.core.launch.QtLocalDebugLaunchConfigDelegate"
- id="org.eclipse.cdt.qt.core.launchDelegate.debug.local"
- modes="debug"
- name="Qt Local Debug launcher"
- type="org.eclipse.cdt.qt.core.launchConfigurationType">
- </launchDelegate>
- </extension>
- <extension
point="org.eclipse.cdt.core.buildConfigProvider">
<provider
class="org.eclipse.cdt.internal.qt.core.build.QtBuildConfigurationProvider"
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfiguration.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfiguration.java
index 8b19c1b317..460531accd 100644
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfiguration.java
+++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfiguration.java
@@ -115,11 +115,6 @@ public class QtBuildConfiguration extends CBuildConfiguration
}
}
- @Override
- public <T> T getAdapter(Class<T> adapter) {
- return super.getAdapter(adapter);
- }
-
public IQtInstall getQtInstall() {
if (qtInstall == null && !qtInstallSpec.isEmpty()) {
// find one that matches the spec
@@ -176,6 +171,7 @@ public class QtBuildConfiguration extends CBuildConfiguration
}
}
+ @Deprecated
@Override
public Path getProgramPath() throws CoreException {
// TODO get the app name from the .pro file.
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfigurationProvider.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfigurationProvider.java
index 019c1c29eb..c442de5da8 100644
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfigurationProvider.java
+++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/build/QtBuildConfigurationProvider.java
@@ -20,7 +20,6 @@ import org.eclipse.cdt.internal.qt.core.Activator;
import org.eclipse.cdt.qt.core.IQtBuildConfiguration;
import org.eclipse.cdt.qt.core.IQtInstall;
import org.eclipse.cdt.qt.core.IQtInstallManager;
-import org.eclipse.cdt.qt.core.QtMinGWToolChainProvider;
import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@@ -78,6 +77,47 @@ public class QtBuildConfigurationProvider implements ICBuildConfigurationProvide
}
}
+ @Override
+ public ICBuildConfiguration createBuildConfiguration(IProject project, IToolChain toolChain, String launchMode,
+ IProgressMonitor monitor) throws CoreException {
+ IQtInstall qtInstall = getQtInstall(toolChain);
+ if (qtInstall != null) {
+ // See if one exists
+ for (IBuildConfiguration config : project.getBuildConfigs()) {
+ ICBuildConfiguration cconfig = config.getAdapter(ICBuildConfiguration.class);
+ if (cconfig != null) {
+ IQtBuildConfiguration qtConfig = cconfig.getAdapter(IQtBuildConfiguration.class);
+ if (qtConfig != null && launchMode.equals(qtConfig.getLaunchMode()) &&
+ qtConfig.getToolChain().equals(toolChain)) {
+ return qtConfig;
+ }
+ }
+ }
+
+ // TODO what if multiple matches, this returns first match
+ String configName = "qt." + qtInstall.getSpec() + "." + launchMode; //$NON-NLS-1$ //$NON-NLS-2$
+ IBuildConfiguration config = configManager.createBuildConfiguration(this, project, configName,
+ monitor);
+ QtBuildConfiguration qtConfig = new QtBuildConfiguration(config, configName, toolChain, qtInstall,
+ launchMode);
+ configManager.addBuildConfiguration(config, qtConfig);
+ return qtConfig;
+ }
+
+ return null;
+ }
+
+ private IQtInstall getQtInstall(IToolChain toolChain) {
+ for (IQtInstall qtInstall : qtInstallManager.getInstalls()) {
+ if (qtInstallManager.supports(qtInstall, toolChain)) {
+ return qtInstall;
+ }
+ }
+
+ return null;
+ }
+
+ // TODO this goes when the launch delegate goes
public IQtBuildConfiguration getConfiguration(IProject project, Map<String, String> properties, String launchMode,
IProgressMonitor monitor) throws CoreException {
Collection<IToolChain> toolChains = toolChainManager.getToolChainsMatching(properties);
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLaunchDescriptor.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLaunchDescriptor.java
deleted file mode 100644
index 73c5851521..0000000000
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLaunchDescriptor.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 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.internal.qt.core.launch;
-
-import org.eclipse.cdt.qt.core.IQtLaunchDescriptor;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.launchbar.core.ILaunchDescriptorType;
-
-public class QtLaunchDescriptor extends PlatformObject implements IQtLaunchDescriptor {
-
- private final QtLaunchDescriptorType type;
- private final IProject project;
-
- public QtLaunchDescriptor(QtLaunchDescriptorType type, IProject project) {
- this.type = type;
- this.project = project;
- }
-
- @Override
- public String getName() {
- return project.getName();
- }
-
- @Override
- public ILaunchDescriptorType getType() {
- return type;
- }
-
- @Override
- public IProject getProject() {
- return project;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public <T> T getAdapter(Class<T> adapter) {
- if (adapter.equals(IProject.class)) {
- return (T) project;
- } else {
- return super.getAdapter(adapter);
- }
- }
-
-}
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLaunchDescriptorType.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLaunchDescriptorType.java
deleted file mode 100644
index 41f8cbdbe1..0000000000
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLaunchDescriptorType.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 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.internal.qt.core.launch;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.cdt.internal.qt.core.QtNature;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.launchbar.core.ILaunchDescriptor;
-import org.eclipse.launchbar.core.ILaunchDescriptorType;
-
-public class QtLaunchDescriptorType implements ILaunchDescriptorType {
-
- private Map<IProject, QtLaunchDescriptor> descriptors = new HashMap<>();
-
- @Override
- public ILaunchDescriptor getDescriptor(Object launchObject) throws CoreException {
- // TODO also check to make sure it's an application project and not a library.
- // qmake -E will give the TEMPLATE variable
- if (launchObject instanceof IProject) {
- IProject project = (IProject) launchObject;
- if (QtNature.hasNature(project)) {
- QtLaunchDescriptor desc = descriptors.get(project);
- if (desc == null) {
- desc = new QtLaunchDescriptor(this, project);
- descriptors.put(project, desc);
- }
- return desc;
- }
- }
- return null;
- }
-
-}
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLocalLaunchConfigationProvider.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLocalLaunchConfigationProvider.java
deleted file mode 100644
index f985c07209..0000000000
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLocalLaunchConfigationProvider.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 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.internal.qt.core.launch;
-
-import org.eclipse.cdt.qt.core.QtLaunchConfigurationProvider;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.launchbar.core.ILaunchDescriptor;
-import org.eclipse.launchbar.core.target.ILaunchTarget;
-import org.eclipse.launchbar.core.target.ILaunchTargetManager;
-
-/**
- * Launch config provider for Qt projects running on the Local connection.
- * Simply uses the C++ Application launch config type.
- */
-public class QtLocalLaunchConfigationProvider extends QtLaunchConfigurationProvider {
-
- @Override
- public boolean supports(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException {
- return ILaunchTargetManager.localLaunchTargetTypeId.equals(target.getTypeId());
- }
-
- @Override
- public ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, ILaunchTarget target)
- throws CoreException {
- return DebugPlugin.getDefault().getLaunchManager()
- .getLaunchConfigurationType(QtLocalRunLaunchConfigDelegate.TYPE_ID);
- }
-
-}
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLocalRunLaunchConfigDelegate.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLocalRunLaunchConfigDelegate.java
deleted file mode 100644
index c300c209f8..0000000000
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/launch/QtLocalRunLaunchConfigDelegate.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 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.internal.qt.core.launch;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
-import org.eclipse.cdt.internal.qt.core.Activator;
-import org.eclipse.cdt.qt.core.IQtBuildConfiguration;
-import org.eclipse.cdt.qt.core.QtLaunchConfigurationDelegate;
-import org.eclipse.core.resources.IBuildConfiguration;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.launchbar.core.target.ILaunchTarget;
-import org.eclipse.launchbar.core.target.launch.ITargetedLaunch;
-
-public class QtLocalRunLaunchConfigDelegate extends QtLaunchConfigurationDelegate {
-
- public static final String TYPE_ID = Activator.ID + ".launchConfigurationType"; //$NON-NLS-1$
-
- @Override
- public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
- throws CoreException {
- ILaunchTarget target = ((ITargetedLaunch) launch).getLaunchTarget();
- IQtBuildConfiguration qtBuildConfig = getQtBuildConfiguration(configuration, mode, target, monitor);
-
- IBuildConfiguration buildConfig = qtBuildConfig.getBuildConfiguration();
- ProcessBuilder processBuilder = new ProcessBuilder(qtBuildConfig.getProgramPath().toString())
- .directory(buildConfig.getProject().getLocation().toFile());
-
- Map<String, String> env = processBuilder.environment();
- for (IEnvironmentVariable var : CCorePlugin.getDefault().getBuildEnvironmentManager()
- .getVariables(qtBuildConfig.getBuildConfiguration(), true)) {
- env.put(var.getName(), var.getValue());
- }
-
- Map<String, String> configEnv = configuration.getAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES,
- (Map<String, String>) null);
- if (configEnv != null) {
- for (Map.Entry<String, String> entry : configEnv.entrySet()) {
- env.put(entry.getKey(), entry.getValue());
- }
- }
-
- try {
- Process process = processBuilder.start();
- DebugPlugin.newProcess(launch, process, qtBuildConfig.getProgramPath().toString());
- } catch (IOException e) {
- throw new CoreException(new Status(IStatus.ERROR, Activator.ID, "Launching", e));
- }
- }
-
-}
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/project/QtProjectGenerator.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/project/QtProjectGenerator.java
index f1726f09bb..1345c8f922 100644
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/project/QtProjectGenerator.java
+++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/project/QtProjectGenerator.java
@@ -48,17 +48,26 @@ public class QtProjectGenerator extends FMProjectGenerator {
public void generate(Map<String, Object> model, IProgressMonitor monitor) throws CoreException {
super.generate(model, monitor);
- // Create the sourcefolders
+ // Create the source folders
IProject project = getProject();
List<IPathEntry> entries = new ArrayList<>();
- for (SourceRoot srcRoot : getManifest().getSrcRoots()) {
- IFolder sourceFolder = project.getFolder(srcRoot.getDir());
- if (!sourceFolder.exists()) {
- sourceFolder.create(true, true, monitor);
- }
+ List<SourceRoot> srcRoots = getManifest().getSrcRoots();
+ if (srcRoots != null && !srcRoots.isEmpty()) {
+ for (SourceRoot srcRoot : srcRoots) {
+ IFolder sourceFolder = project.getFolder(srcRoot.getDir());
+ if (!sourceFolder.exists()) {
+ sourceFolder.create(true, true, monitor);
+ }
- entries.add(CoreModel.newSourceEntry(sourceFolder.getFullPath()));
+ entries.add(CoreModel.newSourceEntry(sourceFolder.getFullPath()));
+ }
+ } else {
+ entries.add(CoreModel.newSourceEntry(getProject().getFullPath()));
}
+
+ // build directory as output folder
+ entries.add(CoreModel.newOutputEntry(getProject().getFolder("build").getFullPath())); //$NON-NLS-1$
+
CoreModel.getDefault().create(project).setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]),
monitor);
}
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/IQtBuildConfiguration.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/IQtBuildConfiguration.java
index ee55522304..3c42900141 100644
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/IQtBuildConfiguration.java
+++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/IQtBuildConfiguration.java
@@ -20,6 +20,10 @@ public interface IQtBuildConfiguration extends ICBuildConfiguration {
String[] getQmakeConfig();
+ /**
+ * @deprecated use getBuildOutput() instead
+ */
+ @Deprecated
Path getProgramPath() throws CoreException;
String getLaunchMode();
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtLaunchConfigurationProvider.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtLaunchConfigurationProvider.java
deleted file mode 100644
index 0ef7ef98c1..0000000000
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/qt/core/QtLaunchConfigurationProvider.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 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.qt.core;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.internal.qt.core.launch.QtLaunchDescriptor;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.launchbar.core.AbstractLaunchConfigProvider;
-import org.eclipse.launchbar.core.ILaunchDescriptor;
-import org.eclipse.launchbar.core.target.ILaunchTarget;
-
-public abstract class QtLaunchConfigurationProvider extends AbstractLaunchConfigProvider {
-
- private Map<IProject, ILaunchConfiguration> configs = new HashMap<>();
-
- @Override
- public ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target)
- throws CoreException {
- ILaunchConfiguration config = null;
- IProject project = descriptor.getAdapter(IProject.class);
- if (project != null) {
- config = configs.get(project);
- if (config == null) {
- config = createLaunchConfiguration(descriptor, target);
- // launch config added will get called below to add it to the
- // configs map
- }
- }
- return config;
- }
-
- @Override
- protected void populateLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target,
- ILaunchConfigurationWorkingCopy workingCopy) throws CoreException {
- super.populateLaunchConfiguration(descriptor, target, workingCopy);
-
- // Main is actually in the library. Don't stop there
- workingCopy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false);
-
- // Set the project and the connection
- QtLaunchDescriptor qtDesc = (QtLaunchDescriptor) descriptor;
- workingCopy.setMappedResources(new IResource[] { qtDesc.getProject() });
- }
-
- @Override
- public boolean launchConfigurationAdded(ILaunchConfiguration configuration) throws CoreException {
- if (ownsLaunchConfiguration(configuration)) {
- IProject project = configuration.getMappedResources()[0].getProject();
- configs.put(project, configuration);
- return true;
- }
- return false;
- }
-
- @Override
- public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException {
- for (Entry<IProject, ILaunchConfiguration> entry : configs.entrySet()) {
- if (configuration.equals(entry.getValue())) {
- configs.remove(entry.getKey());
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean launchConfigurationChanged(ILaunchConfiguration configuration) throws CoreException {
- // TODO not sure I care
- return false;
- }
-
- @Override
- public void launchDescriptorRemoved(ILaunchDescriptor descriptor) throws CoreException {
- IProject project = descriptor.getAdapter(IProject.class);
- if (project != null) {
- configs.remove(project);
- }
- }
-
- @Override
- public void launchTargetRemoved(ILaunchTarget target) throws CoreException {
- // nothing to do since the Local connection can't be removed
- }
-
-}
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.cpp b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.cpp
index b3e29a3b85..9835fbac6b 100644
--- a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.cpp
+++ b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.cpp
@@ -5,7 +5,7 @@ int main(int argc, char *argv[]) {
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
- engine.load(QUrl(QStringLiteral("qrc:/src/${projectName}.qml")));
+ engine.load(QUrl(QStringLiteral("qrc:/${projectName}.qml")));
return app.exec();
}
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.pro b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.pro
index f80ccb38ca..0ff331f048 100644
--- a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.pro
+++ b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.pro
@@ -5,7 +5,7 @@ CONFIG += c++11
RESOURCES += ${projectName}.qrc
-qml.files = src/${projectName}.qml
+qml.files = ${projectName}.qml
launch_modeall {
CONFIG(debug, debug|release) {
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.qrc b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.qrc
index 30335ce99e..274d26dc9b 100644
--- a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.qrc
+++ b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/main.qrc
@@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/">
- <file>src/${projectName}.qml</file>
+ <file>${projectName}.qml</file>
</qresource>
</RCC>
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/manifest.xml b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/manifest.xml
index 91eac74942..7a88c74085 100644
--- a/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/manifest.xml
+++ b/qt/org.eclipse.cdt.qt.core/templates/project2/appProject/manifest.xml
@@ -1,9 +1,8 @@
<templateManifest>
- <srcRoot dir="src"/>
<file src="/templates/project2/appProject/main.cpp"
- dest="/${projectName}/src/${projectName}.cpp"/>
+ dest="/${projectName}/${projectName}.cpp"/>
<file src="/templates/project2/appProject/main.qml"
- dest="/${projectName}/src/${projectName}.qml"/>
+ dest="/${projectName}/${projectName}.qml"/>
<file src="/templates/project2/appProject/main.pro"
dest="/${projectName}/${projectName}.pro"/>
<file src="/templates/project2/appProject/main.qrc"

Back to the top