mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-09 10:05:24 +02:00
[fix] [163392] First connection created is shown duplicate in tree
This commit is contained in:
parent
d33981c1db
commit
76fe278b7b
2 changed files with 24 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved.
|
* Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* 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
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
@ -11,7 +11,8 @@
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* David Dykstal (IBM) - moved methods to SystemPreferencesManager
|
* David Dykstal (IBM) - moved methods to SystemPreferencesManager.
|
||||||
|
* Uwe Stieber (Wind River) - bugfixing.
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui;
|
package org.eclipse.rse.ui;
|
||||||
|
@ -500,14 +501,22 @@ public class RSEUIPlugin extends SystemBasePlugin implements ISystemMessageProvi
|
||||||
//logError("Error creating default Local connection", exc);
|
//logError("Error creating default Local connection", exc);
|
||||||
//}
|
//}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// new support to allow products to not pre-create a local connection
|
// new support to allow products to not pre-create a local connection
|
||||||
if (SystemResourceManager.isFirstTime() && SystemPreferencesManager.getShowLocalConnection()) {
|
if (SystemResourceManager.isFirstTime() && SystemPreferencesManager.getShowLocalConnection()) {
|
||||||
|
// create the connection only if the local system type is enabled!
|
||||||
|
IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID);
|
||||||
|
if (systemType != null) {
|
||||||
|
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class));
|
||||||
|
if (adapter != null && adapter.isEnabled(systemType)) {
|
||||||
ISystemProfileManager profileManager = SystemProfileManager.getSystemProfileManager();
|
ISystemProfileManager profileManager = SystemProfileManager.getSystemProfileManager();
|
||||||
ISystemProfile profile = profileManager.getDefaultPrivateSystemProfile();
|
ISystemProfile profile = profileManager.getDefaultPrivateSystemProfile();
|
||||||
String userName = System.getProperty("user.name"); //$NON-NLS-1$
|
String userName = System.getProperty("user.name"); //$NON-NLS-1$
|
||||||
registry.createLocalHost(profile, SystemResources.TERM_LOCAL, userName);
|
registry.createLocalHost(profile, SystemResources.TERM_LOCAL, userName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For pathpath access to our adapters for non-local objects in our model. Exploits the knowledge we use singleton adapters.
|
* For pathpath access to our adapters for non-local objects in our model. Exploits the knowledge we use singleton adapters.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2006, 2007 IBM Corporation and Wind River Systems, Inc. All rights reserved.
|
* Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* 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
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
@ -13,6 +13,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - patch for an NPE in getSubSystemConfigurations()
|
* Michael Scharf (Wind River) - patch for an NPE in getSubSystemConfigurations()
|
||||||
* David Dykstal (IBM) - moved SystemsPreferencesManager to a new package
|
* David Dykstal (IBM) - moved SystemsPreferencesManager to a new package
|
||||||
|
* Uwe Stieber (Wind River) - bugfixing
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.model;
|
package org.eclipse.rse.model;
|
||||||
|
@ -256,16 +257,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
|
||||||
IRSESystemType sysType = RSECorePlugin.getDefault().getRegistry().getSystemType(con.getSystemType());
|
IRSESystemType sysType = RSECorePlugin.getDefault().getRegistry().getSystemType(con.getSystemType());
|
||||||
if (sysType != null) { // sysType can be null if workspace contains a host that is no longer defined by the workbench
|
if (sysType != null) { // sysType can be null if workspace contains a host that is no longer defined by the workbench
|
||||||
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(sysType.getAdapter(IRSESystemType.class));
|
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(sysType.getAdapter(IRSESystemType.class));
|
||||||
if (adapter.isEnabled(sysType)) {
|
// Note: System types without registered subsystems get disabled by the adapter itself!
|
||||||
|
// There is no need to re-check this here again.
|
||||||
// Bug 154524 Local node is shown in RSE even though the Local subsystem is not installed
|
if (adapter.isEnabled(sysType)) result.add(con);
|
||||||
// so we check for subsystems
|
|
||||||
ISubSystem[] subsystems = con.getSubSystems();
|
|
||||||
|
|
||||||
if (subsystems != null && subsystems.length != 0) {
|
|
||||||
result.add(con);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result.toArray();
|
return result.toArray();
|
||||||
|
|
Loading…
Add table
Reference in a new issue