Fixed doubling cr hashset issue

This commit is contained in:
Kelly Kelly
2020-08-06 17:04:57 -04:00
parent 708a4fa906
commit b7db91c963
2 changed files with 17 additions and 12 deletions
@@ -72,7 +72,10 @@ public final class HashDatabaseOptionsPanelController extends OptionsPanelContro
*/
@Override
public void cancel() {
getPanel().cancel();
if(changed) {
getPanel().cancel();
changed = false;
}
}
@Override
@@ -326,17 +326,19 @@ public class HashDbManager implements PropertyChangeListener {
}
// Add the hash database to the collection
hashSets.add(db);
// Let any external listeners know that there's a new set
try {
changeSupport.firePropertyChange(SetEvt.DB_ADDED.toString(), null, hashSetName);
} catch (Exception e) {
logger.log(Level.SEVERE, "HashDbManager listener threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(
NbBundle.getMessage(this.getClass(), "HashDbManager.moduleErr"),
NbBundle.getMessage(this.getClass(), "HashDbManager.moduleErrorListeningToUpdatesMsg"),
MessageNotifyUtil.MessageType.ERROR);
if(!hashSets.contains(db)) {
hashSets.add(db);
// Let any external listeners know that there's a new set
try {
changeSupport.firePropertyChange(SetEvt.DB_ADDED.toString(), null, hashSetName);
} catch (Exception e) {
logger.log(Level.SEVERE, "HashDbManager listener threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(
NbBundle.getMessage(this.getClass(), "HashDbManager.moduleErr"),
NbBundle.getMessage(this.getClass(), "HashDbManager.moduleErrorListeningToUpdatesMsg"),
MessageNotifyUtil.MessageType.ERROR);
}
}
return db;