diff --git a/HxBroadcast.cpp b/HxBroadcast.cpp index a35d256..9d2bfb0 100644 --- a/HxBroadcast.cpp +++ b/HxBroadcast.cpp @@ -1,4 +1,4 @@ -#include "HxBroadcast.h" +#include "HxBroadcast.h" #include #include diff --git a/HxBroadcast.h b/HxBroadcast.h index fda3396..8b9ea55 100644 --- a/HxBroadcast.h +++ b/HxBroadcast.h @@ -1,4 +1,4 @@ -#ifndef HXBROADCAST_H +#ifndef HXBROADCAST_H #define HXBROADCAST_H #include diff --git a/HxDisk.cpp b/HxDisk.cpp index 46ff3b4..f14e715 100644 --- a/HxDisk.cpp +++ b/HxDisk.cpp @@ -1,4 +1,4 @@ -#include "HxDisk.h" +#include "HxDisk.h" void HxDisk::mkpath(QString path) { diff --git a/HxDisk.h b/HxDisk.h index 33ca507..8fd06cd 100644 --- a/HxDisk.h +++ b/HxDisk.h @@ -1,4 +1,4 @@ -#ifndef HXDISK_H +#ifndef HXDISK_H #define HXDISK_H #include "HxTrace.h" diff --git a/HxJson.cpp b/HxJson.cpp index 6b22890..826ab28 100644 --- a/HxJson.cpp +++ b/HxJson.cpp @@ -1,57 +1,57 @@ -#include "HxJson.h" - -#include - -int HxJson::to_int(QJsonObject object, QString key) -{ - auto value = object.value(key); - - switch(value.type()) - { - case QJsonValue::Double: - return qRound(value.toDouble()); - - case QJsonValue::String: - return value.toString().toInt(); - - default: - return 0; - } -} - -bool HxJson::to_boolean(QJsonObject object, QString key) -{ - auto value = object.value(key); - - switch(value.type()) - { - case QJsonValue::Bool: - return value.toBool(); - - case QJsonValue::String: - return QVariant(value.toString()).toBool(); - - default: - return false; - } -} - -QString HxJson::to_string(QJsonObject object, QString key) -{ - auto value = object.value(key); - - switch(value.type()) - { - case QJsonValue::Bool: - case QJsonValue::Double: - return QString::number(value.toDouble()); - - case QJsonValue::String: - return value.toString(); - - default: - return ""; - } -} - -QStringList HxJson::to_string_list(QJsonObject object, QString key, QString split){ return to_string(object, key).split(split);} +#include "HxJson.h" + +#include + +int HxJson::to_int(QJsonObject object, QString key) +{ + auto value = object.value(key); + + switch(value.type()) + { + case QJsonValue::Double: + return qRound(value.toDouble()); + + case QJsonValue::String: + return value.toString().toInt(); + + default: + return 0; + } +} + +bool HxJson::to_boolean(QJsonObject object, QString key) +{ + auto value = object.value(key); + + switch(value.type()) + { + case QJsonValue::Bool: + return value.toBool(); + + case QJsonValue::String: + return QVariant(value.toString()).toBool(); + + default: + return false; + } +} + +QString HxJson::to_string(QJsonObject object, QString key) +{ + auto value = object.value(key); + + switch(value.type()) + { + case QJsonValue::Bool: + case QJsonValue::Double: + return QString::number(value.toDouble()); + + case QJsonValue::String: + return value.toString(); + + default: + return ""; + } +} + +QStringList HxJson::to_string_list(QJsonObject object, QString key, QString split){ return to_string(object, key).split(split);} diff --git a/HxJson.h b/HxJson.h index 74b7ab6..3ee8687 100644 --- a/HxJson.h +++ b/HxJson.h @@ -1,15 +1,15 @@ -#ifndef HXJSON_H -#define HXJSON_H - -#include - -class HxJson -{ -public: - static int to_int(QJsonObject object, QString key); - static bool to_boolean(QJsonObject object, QString key); - static QString to_string(QJsonObject object, QString key); - static QStringList to_string_list(QJsonObject object, QString key, QString split); -}; - -#endif // HXJSON_H +#ifndef HXJSON_H +#define HXJSON_H + +#include + +class HxJson +{ +public: + static int to_int(QJsonObject object, QString key); + static bool to_boolean(QJsonObject object, QString key); + static QString to_string(QJsonObject object, QString key); + static QStringList to_string_list(QJsonObject object, QString key, QString split); +}; + +#endif // HXJSON_H diff --git a/HxSocket.cpp b/HxSocket.cpp index 5327ed6..ee16467 100644 --- a/HxSocket.cpp +++ b/HxSocket.cpp @@ -1,4 +1,4 @@ -#include "HxSocket.h" +#include "HxSocket.h" #include "HxThread.h" #include diff --git a/HxSql.h b/HxSql.h index 3adfe2f..be24331 100644 --- a/HxSql.h +++ b/HxSql.h @@ -1,4 +1,4 @@ -#ifndef HXSQL_H +#ifndef HXSQL_H #define HXSQL_H #include diff --git a/HxSystem.cpp b/HxSystem.cpp index 31b8d3a..eed518e 100644 --- a/HxSystem.cpp +++ b/HxSystem.cpp @@ -1,4 +1,4 @@ -#include "HxSystem.h" +#include "HxSystem.h" #include "HxProcess.h" #include @@ -112,6 +112,10 @@ bool HxSystem::get_memory_status(double *memory_use, double *memory_total, doubl bool HxSystem::get_program_status(double *cpu_usage, double *virtual_memory, double *resident_memory) { + Q_UNUSED(cpu_usage); + Q_UNUSED(virtual_memory); + Q_UNUSED(resident_memory); + #ifdef Q_OS_LINUX auto result = HxProcess::start(QString("ps u %1").arg(getpid())); @@ -193,6 +197,8 @@ bool HxSystem::get_harddisk_temperature(QString file_system, QString *temperatur bool HxSystem::get_harddisk_smart(QString file_system, QString *smart) { + Q_UNUSED(file_system); + Q_UNUSED(smart); #ifdef Q_OS_LINUX auto result = HxProcess::start(QString("echo tvis | sudo -S smartctl -i %1 | grep 'SMART support is'").arg(file_system)); if(result.indexOf("Unavailable") != -1) diff --git a/HxSystem.h b/HxSystem.h index 338df95..9c5a1ec 100644 --- a/HxSystem.h +++ b/HxSystem.h @@ -1,4 +1,4 @@ -#ifndef HXSYSTEM_H +#ifndef HXSYSTEM_H #define HXSYSTEM_H #include diff --git a/HxTask.h b/HxTask.h index 5ec92bf..5fe0e7f 100644 --- a/HxTask.h +++ b/HxTask.h @@ -1,4 +1,4 @@ -#ifndef HXTASK_H +#ifndef HXTASK_H #define HXTASK_H #include "HxTrace.h" diff --git a/HxThread.h b/HxThread.h index 5b742a1..62a542b 100644 --- a/HxThread.h +++ b/HxThread.h @@ -1,4 +1,4 @@ -#ifndef HXTHREAD_H +#ifndef HXTHREAD_H #define HXTHREAD_H #include