Merge remote-tracking branch 'origin/patch'

This commit is contained in:
Ryan Kurtz
2026-07-28 05:06:17 -04:00
3 changed files with 29 additions and 9 deletions

View File

@@ -1860,7 +1860,27 @@ public class HeadlessAnalyzer {
}
}
/**
* A headless version of the {@link DefaultProjectManager} that does not update the project's
* preferences. This prevents the headless environment from overwriting settings GUI
* installations.
*/
private static class HeadlessGhidraProjectManager extends DefaultProjectManager {
// this exists just to allow access to the constructor
@Override
public void setLastOpenedProject(ProjectLocator projectLocator) {
// No need to save this for headless. We also do not want to affect the GUI by saving
// this value.
}
@Override
public ProjectLocator getLastOpenedProject() {
return null;
}
@Override
protected void updatePreferences() {
// nothing to save
}
}
}

View File

@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,20 +23,20 @@ import ghidra.framework.options.Options;
*/
public enum DefaultLaunchMode {
REUSE_TOOL("Reuse acceptable running tool"),
NEW_TOOL("Launch new default tool");
REUSE_TOOL("Reuse Tool"),
NEW_TOOL("New Tool");
public static DefaultLaunchMode DEFAULT = NEW_TOOL;
private String str;
private String description;
private DefaultLaunchMode(String str) {
this.str = str;
this.description = str;
}
@Override
public String toString() {
return str;
return description;
}
}

View File

@@ -577,7 +577,7 @@ public class DefaultProjectManager implements ProjectManager {
/**
* Update preferences file with list of known projects.
*/
void updatePreferences() {
protected void updatePreferences() {
setProjectLocatorProperty(recentlyOpenedProjectsList, RECENT_PROJECTS);
setProjectURLProperty(recentlyViewedProjectsList, VIEWED_PROJECTS);