mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 08:45:44 +02:00
Bug 521703 Add name attribute to new targets
This ensure they have at least one attribute to that the child node persists (empty ones don't). Change-Id: I3bdc64a07a097882acfcc4995e1d09a0a862b197
This commit is contained in:
parent
3d9e238603
commit
374059131b
2 changed files with 27 additions and 25 deletions
|
@ -1,16 +1,9 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) Jan 29, 2016 QNX Software Systems. All Rights Reserved.
|
* Copyright (c) 2016 QNX Software Systems and others.
|
||||||
*
|
* All rights reserved. This program and the accompanying materials
|
||||||
* You must obtain a written license from and pay applicable license fees to QNX
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* Software Systems before you may reproduce, modify or distribute this software,
|
* which accompanies this distribution, and is available at
|
||||||
* or any work that includes all or part of this software. Free development
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
* licenses are available for evaluation and non-commercial purposes. For more
|
|
||||||
* information visit [http://licensing.qnx.com] or email licensing@qnx.com.
|
|
||||||
*
|
|
||||||
* This file may contain contributions from others. Please review this entire
|
|
||||||
* file for other proprietary rights or license notices, as well as the QNX
|
|
||||||
* Development Suite License Guide at [http://licensing.qnx.com/license-guide/]
|
|
||||||
* for other information.
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.launchbar.core;
|
package org.eclipse.launchbar.core;
|
||||||
|
|
||||||
|
|
|
@ -192,15 +192,20 @@ public class LaunchTargetManager implements ILaunchTargetManager {
|
||||||
targets.put(typeId, type);
|
targets.put(typeId, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
Preferences prefs = getTargetsPref();
|
Preferences prefs = getTargetsPref();
|
||||||
String childName = typeId + DELIMETER1 + id;
|
String childName = typeId + DELIMETER1 + id;
|
||||||
ILaunchTarget target = new LaunchTarget(typeId, id, prefs.node(childName));
|
Preferences child;
|
||||||
type.put(id, target);
|
if (prefs.nodeExists(childName)) {
|
||||||
try {
|
child = prefs.node(childName);
|
||||||
prefs.flush();
|
} else {
|
||||||
} catch (BackingStoreException e) {
|
child = prefs.node(childName);
|
||||||
Activator.log(e);
|
// set the id so we have at least one attribute to save
|
||||||
|
child.put("name", id); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
ILaunchTarget target = new LaunchTarget(typeId, id, child);
|
||||||
|
type.put(id, target);
|
||||||
|
child.flush();
|
||||||
|
|
||||||
synchronized (listeners) {
|
synchronized (listeners) {
|
||||||
for (ILaunchTargetListener listener : listeners) {
|
for (ILaunchTargetListener listener : listeners) {
|
||||||
|
@ -209,6 +214,10 @@ public class LaunchTargetManager implements ILaunchTargetManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
return target;
|
return target;
|
||||||
|
} catch (BackingStoreException e) {
|
||||||
|
Activator.log(e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue