From 2784a026d60e1b8f6b7338b4e0305e0af809c831 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 18 Dec 2017 13:19:20 +0100 Subject: [PATCH] Web API: added Qt version in the instance summary --- sdrbase/resources/index.html | 8 ++++++-- sdrgui/webapi/webapiadaptergui.cpp | 1 + sdrsrv/webapi/webapiadaptersrv.cpp | 1 + swagger/sdrangel/api/swagger/swagger.yaml | 4 ++++ swagger/sdrangel/code/html2/index.html | 8 ++++++-- .../qt5/client/SWGInstanceSummaryResponse.cpp | 17 +++++++++++++++++ .../qt5/client/SWGInstanceSummaryResponse.h | 4 ++++ 7 files changed, 39 insertions(+), 4 deletions(-) diff --git a/sdrbase/resources/index.html b/sdrbase/resources/index.html index 96705b314..d7bcb2132 100644 --- a/sdrbase/resources/index.html +++ b/sdrbase/resources/index.html @@ -1050,12 +1050,16 @@ margin-bottom: 20px; "description" : "Summarized information about logical devices from hardware devices attached to this SDRangel instance" }; defs.InstanceSummaryResponse = { - "required" : [ "devicesetlist", "version" ], + "required" : [ "devicesetlist", "qtVersion", "version" ], "properties" : { "version" : { "type" : "string", "description" : "Current software version" }, + "qtVersion" : { + "type" : "string", + "description" : "Qt version with which the software was compiled" + }, "logging" : { "$ref" : "#/definitions/LoggingInfo" }, @@ -14085,7 +14089,7 @@ except ApiException as e:
- Generated 2017-12-18T01:56:22.008+01:00 + Generated 2017-12-18T13:11:28.683+01:00
diff --git a/sdrgui/webapi/webapiadaptergui.cpp b/sdrgui/webapi/webapiadaptergui.cpp index 1489b1855..6902dcf4c 100644 --- a/sdrgui/webapi/webapiadaptergui.cpp +++ b/sdrgui/webapi/webapiadaptergui.cpp @@ -72,6 +72,7 @@ int WebAPIAdapterGUI::instanceSummary( { *response.getVersion() = qApp->applicationVersion(); + *response.getQtVersion() = QString(QT_VERSION_STR); SWGSDRangel::SWGLoggingInfo *logging = response.getLogging(); logging->init(); diff --git a/sdrsrv/webapi/webapiadaptersrv.cpp b/sdrsrv/webapi/webapiadaptersrv.cpp index 4711d817e..5beda3086 100644 --- a/sdrsrv/webapi/webapiadaptersrv.cpp +++ b/sdrsrv/webapi/webapiadaptersrv.cpp @@ -50,6 +50,7 @@ int WebAPIAdapterSrv::instanceSummary( { *response.getVersion() = QCoreApplication::instance()->applicationVersion(); + *response.getQtVersion() = QString(QT_VERSION_STR); SWGSDRangel::SWGLoggingInfo *logging = response.getLogging(); logging->init(); diff --git a/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index 243375154..b9ff98624 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/swagger/swagger.yaml @@ -936,11 +936,15 @@ definitions: description: "Summarized information about this SDRangel instance" required: - version + - qtVersion - devicesetlist properties: version: description: "Current software version" type: string + qtVersion: + description: "Qt version with which the software was compiled" + type: string logging: $ref: "#/definitions/LoggingInfo" devicesetlist: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 96705b314..d7bcb2132 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1050,12 +1050,16 @@ margin-bottom: 20px; "description" : "Summarized information about logical devices from hardware devices attached to this SDRangel instance" }; defs.InstanceSummaryResponse = { - "required" : [ "devicesetlist", "version" ], + "required" : [ "devicesetlist", "qtVersion", "version" ], "properties" : { "version" : { "type" : "string", "description" : "Current software version" }, + "qtVersion" : { + "type" : "string", + "description" : "Qt version with which the software was compiled" + }, "logging" : { "$ref" : "#/definitions/LoggingInfo" }, @@ -14085,7 +14089,7 @@ except ApiException as e:
- Generated 2017-12-18T01:56:22.008+01:00 + Generated 2017-12-18T13:11:28.683+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.cpp b/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.cpp index 0c41e7ea1..e54aca419 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.cpp @@ -38,6 +38,7 @@ SWGInstanceSummaryResponse::~SWGInstanceSummaryResponse() { void SWGInstanceSummaryResponse::init() { version = new QString(""); + qt_version = new QString(""); logging = new SWGLoggingInfo(); devicesetlist = new SWGDeviceSetList(); } @@ -49,6 +50,10 @@ SWGInstanceSummaryResponse::cleanup() { delete version; } + if(qt_version != nullptr) { + delete qt_version; + } + if(logging != nullptr) { delete logging; } @@ -70,6 +75,7 @@ SWGInstanceSummaryResponse::fromJson(QString &json) { void SWGInstanceSummaryResponse::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&version, pJson["version"], "QString", "QString"); + ::SWGSDRangel::setValue(&qt_version, pJson["qtVersion"], "QString", "QString"); ::SWGSDRangel::setValue(&logging, pJson["logging"], "SWGLoggingInfo", "SWGLoggingInfo"); ::SWGSDRangel::setValue(&devicesetlist, pJson["devicesetlist"], "SWGDeviceSetList", "SWGDeviceSetList"); } @@ -90,6 +96,8 @@ SWGInstanceSummaryResponse::asJsonObject() { toJsonValue(QString("version"), version, obj, QString("QString")); + toJsonValue(QString("qtVersion"), qt_version, obj, QString("QString")); + toJsonValue(QString("logging"), logging, obj, QString("SWGLoggingInfo")); toJsonValue(QString("devicesetlist"), devicesetlist, obj, QString("SWGDeviceSetList")); @@ -106,6 +114,15 @@ SWGInstanceSummaryResponse::setVersion(QString* version) { this->version = version; } +QString* +SWGInstanceSummaryResponse::getQtVersion() { + return qt_version; +} +void +SWGInstanceSummaryResponse::setQtVersion(QString* qt_version) { + this->qt_version = qt_version; +} + SWGLoggingInfo* SWGInstanceSummaryResponse::getLogging() { return logging; diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.h b/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.h index c531ebf37..6b658a30a 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.h +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceSummaryResponse.h @@ -47,6 +47,9 @@ public: QString* getVersion(); void setVersion(QString* version); + QString* getQtVersion(); + void setQtVersion(QString* qt_version); + SWGLoggingInfo* getLogging(); void setLogging(SWGLoggingInfo* logging); @@ -56,6 +59,7 @@ public: private: QString* version; + QString* qt_version; SWGLoggingInfo* logging; SWGDeviceSetList* devicesetlist; };