GP 29 - remove hardcoded sleep per file when adding files to version ctl

This commit is contained in:
dev747368 2020-07-09 15:22:27 -04:00
parent 2ecde972c6
commit bba1624c79

View file

@ -30,6 +30,7 @@ import ghidra.framework.model.DomainFile;
import ghidra.framework.plugintool.Plugin;
import ghidra.framework.plugintool.PluginTool;
import ghidra.util.Msg;
import ghidra.util.Swing;
import ghidra.util.exception.CancelledException;
import ghidra.util.task.TaskMonitor;
import resources.ResourceManager;
@ -80,7 +81,7 @@ public class VersionControlAddAction extends VersionControlAction {
if (!checkRepositoryConnected()) {
return;
}
List<DomainFile> unversioned = new ArrayList<DomainFile>();
List<DomainFile> unversioned = new ArrayList<>();
for (DomainFile domainFile : domainFiles) {
if (domainFile.isVersionControlSupported() && !domainFile.isVersioned()) {
unversioned.add(domainFile);
@ -140,8 +141,7 @@ public class VersionControlAddAction extends VersionControlAction {
public void run(TaskMonitor monitor) {
checkFilesInUse();
try {
for (int i = 0; i < list.size(); i++) {
DomainFile df = list.get(i);
for (DomainFile df : list) {
String name = df.getName();
monitor.setMessage("Adding " + name + " to Version Control");
@ -152,21 +152,12 @@ public class VersionControlAddAction extends VersionControlAction {
return;
}
if (i != 0) {
try {
// Give Swing a chance to update
Thread.sleep(200);
}
catch (InterruptedException e2) {
// don't care??
}
}
Swing.allowSwingToProcessEvents();
df.addToVersionControl(comments, keepCheckedOut, monitor);
}
}
catch (CancelledException e) {
System.out.println("Add to Version Control was canceled");
Msg.info(this, "Add to Version Control was canceled");
}
catch (IOException e) {
ClientUtil.handleException(repository, e, "Add to Version Control",