fix reload issues

This commit is contained in:
Eyck Jentzsch 2021-07-11 13:45:54 +02:00
parent 788065e456
commit f57fb93525
3 changed files with 6 additions and 16 deletions

View File

@ -62,9 +62,4 @@ public interface IWaveformDb extends IHierNode {
*/
public boolean isLoaded();
/**
* Clear.
*/
public void clear();
}

View File

@ -165,16 +165,6 @@ public class WaveformDb extends HierNode implements IWaveformDb, PropertyChangeL
return ext;
}
/**
* Clear.
*/
@Override
public void clear() {
waveforms.clear();
childNodes.clear();
loaded = false;
}
/**
* Checks if is loaded.
*

View File

@ -613,7 +613,12 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
Map<String, String> state = new HashMap<>();
saveWaveformViewerState(state);
waveformPane.getStreamList().clear();
database.clear();
database = dbFactory.getDatabase();
database.addPropertyChangeListener(evt -> {
if (IHierNode.WAVEFORMS.equals(evt.getPropertyName())) { //$NON-NLS-1$
myParent.getDisplay().syncExec(() -> waveformPane.setMaxTime(database.getMaxTime()));
}
});
if (!filesToLoad.isEmpty())
loadDatabase(state, 0L);
}