fix the pop-up of license window

Signed-off-by: pengzhile <pengzhile@gmail.com>
This commit is contained in:
pengzhile
2020-11-18 12:17:43 +08:00
parent ffc96d454a
commit 58ad4fbda8
3 changed files with 24 additions and 2 deletions
@@ -47,6 +47,22 @@ public class Resetter {
}
}
File licenseDir = getLicenseDir();
if (licenseDir.exists()) {
File[] files = licenseDir.listFiles();
if (files == null) {
NotificationHelper.showError(null, "List license file failed!");
} else {
for (File file : files) {
if (!file.getName().endsWith(".key") && !file.getName().endsWith(".license")) {
continue;
}
list.add(new NormalFileRecord(file));
}
}
}
Element state = PropertyRecord.PROPS.getState();
if (state != null) {
Attribute attrName, attrValue;
@@ -171,6 +187,10 @@ public class Resetter {
return new File(configPath, "eval");
}
protected static File getLicenseDir() {
return new File(PathManager.getConfigPath());
}
protected static void getAllPrefsKeys(Preferences prefs, List<String> list) throws BackingStoreException {
String[] childrenNames = prefs.childrenNames();
if (childrenNames.length == 0) {