fix file detection
This commit is contained in:
parent
2aa4160400
commit
270a004037
|
@ -81,6 +81,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean load(IWaveformDb db, File file) throws Exception {
|
public boolean load(IWaveformDb db, File file) throws Exception {
|
||||||
|
if(file.isDirectory() || !file.exists()) return false;
|
||||||
this.db=db;
|
this.db=db;
|
||||||
try {
|
try {
|
||||||
FileInputStream fis = new FileInputStream(file);
|
FileInputStream fis = new FileInputStream(file);
|
||||||
|
|
|
@ -64,6 +64,7 @@ public class TextDbLoader implements IWaveformDbLoader{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
boolean load(IWaveformDb db, File file) throws Exception {
|
boolean load(IWaveformDb db, File file) throws Exception {
|
||||||
|
if(file.isDirectory() || !file.exists()) return false;
|
||||||
this.db=db
|
this.db=db
|
||||||
this.streams=[]
|
this.streams=[]
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -79,6 +79,7 @@ public class VCDDbLoader implements IWaveformDbLoader, IVCDDatabaseBuilder {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public boolean load(IWaveformDb db, File file) throws Exception {
|
public boolean load(IWaveformDb db, File file) throws Exception {
|
||||||
|
if(file.isDirectory() || !file.exists()) return false;
|
||||||
this.db=db;
|
this.db=db;
|
||||||
this.maxTime=0;
|
this.maxTime=0;
|
||||||
String name = file.getCanonicalFile().getName();
|
String name = file.getCanonicalFile().getName();
|
||||||
|
|
|
@ -669,7 +669,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
}
|
}
|
||||||
if (filesToLoad.size() > 0)
|
if (filesToLoad.size() > 0)
|
||||||
loadDatabase(persistedState);
|
loadDatabase(persistedState);
|
||||||
if(partConfig instanceof String) {
|
if(partConfig instanceof String && ((String)partConfig).length()>0) {
|
||||||
loadState((String) partConfig);
|
loadState((String) partConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue