mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP 29 - remove hardcoded sleep per file when adding files to version ctl
This commit is contained in:
parent
2ecde972c6
commit
bba1624c79
1 changed files with 5 additions and 14 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue