提交 d375f9eb 编写于 作者: J jurgen

Driver reset fix

上级 80c13cde
......@@ -660,7 +660,7 @@ public class DriverEditDialog extends HelpEnabledDialog
embeddedDriverCheck.setSelection(driver.isEmbedded());
if (original) {
resetLibraries();
resetLibraries(true);
}
if (libTable != null) {
libTable.setInput(driver.getEnabledDriverLibraries());
......@@ -687,19 +687,20 @@ public class DriverEditDialog extends HelpEnabledDialog
@Override
protected void cancelPressed() {
resetLibraries();
resetLibraries(false);
super.cancelPressed();
}
private void resetLibraries() {
private void resetLibraries(boolean original) {
// Set libraries
for (DBPDriverLibrary lib : CommonUtils.safeCollection(origLibList)) {
Collection<DBPDriverLibrary> newLibList = CommonUtils.copyList(original ? driver.getOrigFiles() : origLibList);
for (DBPDriverLibrary lib : newLibList) {
lib.setDisabled(false);
driver.addDriverLibrary(lib);
}
for (DBPDriverLibrary lib : CommonUtils.copyList(driver.getDriverLibraries())) {
if (!origLibList.contains(lib)) {
if (!newLibList.contains(lib)) {
driver.removeDriverLibrary(lib);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册