inspectrum
inspectrum copied to clipboard
add additional sigmf filetype
When tab completing sigmf files, the completion will stop at '..sigmf-' which can be annoying since all information is available to open the files at this point. Allow opening of the files at this point.
Alternatively:
diff --git a/src/inputsource.cpp b/src/inputsource.cpp
index fd90020aaf..f5263ea920 100644
--- a/src/inputsource.cpp
+++ b/src/inputsource.cpp
@@ -298,13 +298,8 @@ void InputSource::openFile(const char *filename)
annotationList.clear();
QString metaFilename;
- if (suffix == "sigmf-meta") {
+ if (suffix == "sigmf-meta" || suffix == "sigmf-data" || suffix == "sigmf-") {
dataFilename = fileInfo.path() + "/" + fileInfo.completeBaseName() + ".sigmf-data";
- metaFilename = filename;
- readMetaData(metaFilename);
- }
- else if (suffix == "sigmf-data") {
- dataFilename = filename;
metaFilename = fileInfo.path() + "/" + fileInfo.completeBaseName() + ".sigmf-meta";
readMetaData(metaFilename);
}
@@ -312,7 +307,7 @@ void InputSource::openFile(const char *filename)
throw std::runtime_error("SigMF archives are not supported. Consider extracting a recording.");
}
#else
- if (suffix == "sigmf-meta" || suffix == "sigmf-data" || suffix == "sigmf") {
+ if (suffix == "sigmf-meta" || suffix == "sigmf-data" || suffix == "sigmf-" || suffix == "sigmf") {
throw std::runtime_error("Support for SigMF recordings is not enabled");
}
#endif
Ive been using this for a while and its pretty convenient. I ended up changing the PR to use the simplified version above ^
+1
@miek this is a good very simple PR that would be nice to have; i've been operating with this for quite a while now with no issues.