mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25:38 +02:00
small bug fixes
This commit is contained in:
parent
fdae0fb85b
commit
99f5c1b2bd
3 changed files with 73 additions and 40 deletions
|
@ -776,45 +776,46 @@ public class UniversalPreferencePage
|
|||
public boolean performOk() {
|
||||
|
||||
super.performOk();
|
||||
|
||||
// first save the transfer mode registry
|
||||
Object[] array1 = modeMappings.toArray();
|
||||
SystemFileTransferModeMapping[] mappingArray1 = new SystemFileTransferModeMapping[array1.length];
|
||||
|
||||
for (int i = 0; i < array1.length; i++) {
|
||||
mappingArray1[i] = (SystemFileTransferModeMapping)(array1[i]);
|
||||
}
|
||||
|
||||
modeRegistry.setModeMappings(mappingArray1);
|
||||
modeRegistry.saveAssociations();
|
||||
|
||||
// then save the editor registry
|
||||
Object[] array2 = editorMappings.toArray();
|
||||
FileEditorMapping[] mappingArray2 = new FileEditorMapping[array2.length];
|
||||
|
||||
for (int j = 0; j < array2.length; j++) {
|
||||
mappingArray2[j] = (FileEditorMapping)(array2[j]);
|
||||
}
|
||||
|
||||
((EditorRegistry)editorRegistry).setFileEditorMappings(mappingArray2);
|
||||
((EditorRegistry)editorRegistry).saveAssociations();
|
||||
|
||||
// editorRegistry.removePropertyListener(this);
|
||||
int defaultFileTransferMode = ISystemPreferencesConstants.FILETRANSFERMODE_BINARY;
|
||||
if (defaultBinaryButton.getSelection())
|
||||
if (modeMappings != null)
|
||||
{
|
||||
defaultFileTransferMode = ISystemPreferencesConstants.FILETRANSFERMODE_BINARY;
|
||||
}
|
||||
else
|
||||
{
|
||||
defaultFileTransferMode = ISystemPreferencesConstants.FILETRANSFERMODE_TEXT;
|
||||
}
|
||||
setFileTransferModeDefaultPreference(defaultFileTransferMode);
|
||||
setDoSuperTransfer(doSuperTransferButton.getSelection());
|
||||
setSuperTransferTypePreference(archiveTypeCombo.getText());
|
||||
setDownloadBufferSize(downloadBufferSize.getText());
|
||||
setUploadBufferSize(uploadBufferSize.getText());
|
||||
// first save the transfer mode registry
|
||||
Object[] array1 = modeMappings.toArray();
|
||||
SystemFileTransferModeMapping[] mappingArray1 = new SystemFileTransferModeMapping[array1.length];
|
||||
|
||||
for (int i = 0; i < array1.length; i++) {
|
||||
mappingArray1[i] = (SystemFileTransferModeMapping)(array1[i]);
|
||||
}
|
||||
|
||||
modeRegistry.setModeMappings(mappingArray1);
|
||||
modeRegistry.saveAssociations();
|
||||
|
||||
// then save the editor registry
|
||||
Object[] array2 = editorMappings.toArray();
|
||||
FileEditorMapping[] mappingArray2 = new FileEditorMapping[array2.length];
|
||||
|
||||
for (int j = 0; j < array2.length; j++) {
|
||||
mappingArray2[j] = (FileEditorMapping)(array2[j]);
|
||||
}
|
||||
|
||||
((EditorRegistry)editorRegistry).setFileEditorMappings(mappingArray2);
|
||||
((EditorRegistry)editorRegistry).saveAssociations();
|
||||
|
||||
// editorRegistry.removePropertyListener(this);
|
||||
int defaultFileTransferMode = ISystemPreferencesConstants.FILETRANSFERMODE_BINARY;
|
||||
if (defaultBinaryButton.getSelection())
|
||||
{
|
||||
defaultFileTransferMode = ISystemPreferencesConstants.FILETRANSFERMODE_BINARY;
|
||||
}
|
||||
else
|
||||
{
|
||||
defaultFileTransferMode = ISystemPreferencesConstants.FILETRANSFERMODE_TEXT;
|
||||
}
|
||||
setFileTransferModeDefaultPreference(defaultFileTransferMode);
|
||||
setDoSuperTransfer(doSuperTransferButton.getSelection());
|
||||
setSuperTransferTypePreference(archiveTypeCombo.getText());
|
||||
setDownloadBufferSize(downloadBufferSize.getText());
|
||||
setUploadBufferSize(uploadBufferSize.getText());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -399,13 +399,18 @@ public class UniversalFileTransferUtility
|
|||
{
|
||||
if (PlatformUI.isWorkbenchRunning())
|
||||
{
|
||||
tempFile.refreshLocal(IResource.DEPTH_ONE, monitor);
|
||||
if (!tempFile.isSynchronized(IResource.DEPTH_ZERO))
|
||||
tempFile.refreshLocal(IResource.DEPTH_ZERO, monitor);
|
||||
}
|
||||
}
|
||||
catch (CoreException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
tempFile = (IFile) getTempFileFor(srcFileOrFolder);
|
||||
|
|
|
@ -41,6 +41,7 @@ public class DStoreShellThread
|
|||
private String[] _envVars;
|
||||
private DataStore _dataStore;
|
||||
private DataElement _status;
|
||||
private String _invocation;
|
||||
|
||||
/**
|
||||
* @param cwd initial working directory
|
||||
|
@ -56,6 +57,7 @@ public class DStoreShellThread
|
|||
_encoding = encoding;
|
||||
_cwd = cwd;
|
||||
_envVars = envVars;
|
||||
_invocation = invocation;
|
||||
init();
|
||||
}
|
||||
|
||||
|
@ -65,8 +67,15 @@ public class DStoreShellThread
|
|||
DataElement contextDir = _dataStore.createObject(null, "directory", (new File(_cwd)).getName(), _cwd);
|
||||
_dataStore.setObject(contextDir);
|
||||
setRemoteEnvironment(contextDir);
|
||||
if (_invocation== null || _invocation.equals(">"))
|
||||
{
|
||||
sendShellToMiner(contextDir);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendCommandToMiner(contextDir, _invocation);
|
||||
|
||||
sendShellToMiner(contextDir);
|
||||
}
|
||||
}
|
||||
|
||||
public DataElement getStatus()
|
||||
|
@ -93,6 +102,24 @@ public class DStoreShellThread
|
|||
}
|
||||
}
|
||||
|
||||
protected void sendCommandToMiner(DataElement contextDir, String invocation)
|
||||
{
|
||||
DataElement cmdD = getRunCommandDescriptor(contextDir);
|
||||
|
||||
if (cmdD != null)
|
||||
{
|
||||
|
||||
if (invocation != null && invocation.length() > 0)
|
||||
{
|
||||
DataElement arg = _dataStore.createObject(null, "command", invocation);
|
||||
_status = _dataStore.command(cmdD, arg, contextDir);
|
||||
}
|
||||
else
|
||||
{
|
||||
_status = _dataStore.command(cmdD, contextDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the environment variables for this connection. For universal this sets them in the
|
||||
* DataStore tree. When a new shell is launched the environment variables are passed to the
|
||||
|
|
Loading…
Add table
Reference in a new issue