inspectrum icon indicating copy to clipboard operation
inspectrum copied to clipboard

add additional sigmf filetype

Open jacobagilbert opened this issue 4 years ago • 4 comments

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.

jacobagilbert avatar Mar 26 '21 18:03 jacobagilbert

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

jacobagilbert avatar Mar 26 '21 18:03 jacobagilbert

Ive been using this for a while and its pretty convenient. I ended up changing the PR to use the simplified version above ^

jacobagilbert avatar Jun 29 '21 13:06 jacobagilbert

+1

777arc avatar Jul 02 '21 05:07 777arc

@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.

jacobagilbert avatar Mar 03 '22 15:03 jacobagilbert