mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-23 22:29:14 +08:00
GT-3283 - minor code cleanup
This commit is contained in:
+4
@@ -85,4 +85,8 @@ public class ObjectChooserDialog<T> extends DialogComponentProvider {
|
||||
public T getSelectedObject() {
|
||||
return selectedObject;
|
||||
}
|
||||
|
||||
public void setFilterText(String text) {
|
||||
table.setFilterText(text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,4 +186,7 @@ public class GFilterTable<ROW_OBJECT> extends JPanel {
|
||||
filterPanel.requestFocus();
|
||||
}
|
||||
|
||||
public void setFiterText(String text) {
|
||||
filterPanel.setFilterText(text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,4 +219,8 @@ public class GTableWidget<T> extends JPanel {
|
||||
public void focusFilter() {
|
||||
gFilterTable.focusFilter();
|
||||
}
|
||||
|
||||
public void setFilterText(String text) {
|
||||
gFilterTable.setFiterText(text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,38 +155,44 @@ public class GenericRunInfo {
|
||||
|
||||
/**
|
||||
* This is the same as {@link #getUserSettingsDirsByTime()} except that it doesn't include the
|
||||
* current installation or installations with different release names.
|
||||
* current installation or installations with different release names
|
||||
*
|
||||
* @return the list of previous directories, sorted by time
|
||||
*/
|
||||
public static List<File> getPreviousApplicationSettingsDirsByTime() {
|
||||
List<File> applicationSettiingsDirs = new ArrayList<>();
|
||||
List<File> settingsDirs = new ArrayList<>();
|
||||
|
||||
ApplicationIdentifier myIdentifier = new ApplicationIdentifier(
|
||||
Application.getApplicationLayout().getApplicationProperties());
|
||||
String myRelease = myIdentifier.getApplicationReleaseName();
|
||||
String myDirName = Application.getUserSettingsDirectory().getName();
|
||||
|
||||
for (File dir : getUserSettingsDirsByTime()) {
|
||||
String dirName = dir.getName();
|
||||
|
||||
// Ignore the currently active user settings directory.
|
||||
// By definition, it is not a previous one.
|
||||
if (dirName.equals(Application.getUserSettingsDirectory().getName())) {
|
||||
String dirName = dir.getName();
|
||||
if (dirName.equals(myDirName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dirName.startsWith(".")) {
|
||||
dirName = dirName.substring(1);
|
||||
}
|
||||
|
||||
try {
|
||||
// The current release name has to match for it to be considered
|
||||
if (new ApplicationIdentifier(dirName).getApplicationReleaseName().equals(
|
||||
myIdentifier.getApplicationReleaseName())) {
|
||||
applicationSettiingsDirs.add(dir);
|
||||
// The current release name has to match for it to be considered
|
||||
ApplicationIdentifier identifier = new ApplicationIdentifier(dirName);
|
||||
String release = identifier.getApplicationReleaseName();
|
||||
if (release.equals(myRelease)) {
|
||||
settingsDirs.add(dir);
|
||||
}
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
// The directory name didn't contain a valid application identifier...skip it
|
||||
}
|
||||
}
|
||||
return applicationSettiingsDirs;
|
||||
return settingsDirs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user