mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Corrections
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef Unsorted
|
||||||
|
#undef Unsorted
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <utils/Logger.h>
|
#include <utils/Logger.h>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
add_library(database
|
add_library(database
|
||||||
${CMAKE_SOURCE_DIR}/include/db/AuthTable.h
|
${CMAKE_SOURCE_DIR}/include/db/AuthTable.h
|
||||||
${CMAKE_SOURCE_DIR}/include/db/DBManager.h
|
|
||||||
${CMAKE_SOURCE_DIR}/include/db/ConfigImportExport.h
|
${CMAKE_SOURCE_DIR}/include/db/ConfigImportExport.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/db/DBManager.h
|
||||||
${CMAKE_SOURCE_DIR}/include/db/InstanceTable.h
|
${CMAKE_SOURCE_DIR}/include/db/InstanceTable.h
|
||||||
${CMAKE_SOURCE_DIR}/include/db/MetaTable.h
|
${CMAKE_SOURCE_DIR}/include/db/MetaTable.h
|
||||||
${CMAKE_SOURCE_DIR}/include/db/SettingsTable.h
|
${CMAKE_SOURCE_DIR}/include/db/SettingsTable.h
|
||||||
${CMAKE_SOURCE_DIR}/libsrc/db/AuthTable.cpp
|
${CMAKE_SOURCE_DIR}/libsrc/db/AuthTable.cpp
|
||||||
${CMAKE_SOURCE_DIR}/libsrc/db/DBManager.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/libsrc/db/ConfigImportExport.cpp
|
${CMAKE_SOURCE_DIR}/libsrc/db/ConfigImportExport.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/db/DBManager.cpp
|
||||||
${CMAKE_SOURCE_DIR}/libsrc/db/InstanceTable.cpp
|
${CMAKE_SOURCE_DIR}/libsrc/db/InstanceTable.cpp
|
||||||
${CMAKE_SOURCE_DIR}/libsrc/db/MetaTable.cpp
|
${CMAKE_SOURCE_DIR}/libsrc/db/MetaTable.cpp
|
||||||
${CMAKE_SOURCE_DIR}/libsrc/db/SettingsTable.cpp
|
${CMAKE_SOURCE_DIR}/libsrc/db/SettingsTable.cpp
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
#include <QSqlQuery>
|
#include <QSqlQuery>
|
||||||
#include <QSqlError>
|
#include <QSqlError>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QDateTime>
|
||||||
|
|
||||||
ConfigImportExport::ConfigImportExport(QObject* parent)
|
ConfigImportExport::ConfigImportExport(QObject* parent)
|
||||||
: DBManager(parent)
|
: DBManager(parent)
|
||||||
|
@@ -400,7 +400,11 @@ QString DBManager::constructExecutedQuery(const QSqlQuery& query) const
|
|||||||
|
|
||||||
// Check if the query uses positional placeholders
|
// Check if the query uses positional placeholders
|
||||||
if (executedQuery.contains('?')) {
|
if (executedQuery.contains('?')) {
|
||||||
QVariantList boundValues = query.boundValues(); // Get bound values as a list
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
//QVariantList boundValues = query.boundValues(); // Get bound values as a list
|
||||||
|
#else
|
||||||
|
QVariantMap boundValues = query.boundValues(); // Get bound values as a list
|
||||||
|
#endif
|
||||||
// Iterate through the bound values and replace placeholders
|
// Iterate through the bound values and replace placeholders
|
||||||
for (const QVariant &value : boundValues) {
|
for (const QVariant &value : boundValues) {
|
||||||
// Replace the first occurrence of '?' with the actual value
|
// Replace the first occurrence of '?' with the actual value
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
// qt
|
// qt
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QDateTime>
|
||||||
|
#include <QUuid>
|
||||||
|
|
||||||
AuthManager *AuthManager::manager = nullptr;
|
AuthManager *AuthManager::manager = nullptr;
|
||||||
|
|
||||||
@@ -14,7 +16,6 @@ AuthManager::AuthManager(QObject *parent)
|
|||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, _authTable(new AuthTable(this))
|
, _authTable(new AuthTable(this))
|
||||||
, _metaTable(new MetaTable(this))
|
, _metaTable(new MetaTable(this))
|
||||||
, _pendingRequests()
|
|
||||||
, _timer(new QTimer(this))
|
, _timer(new QTimer(this))
|
||||||
, _authBlockTimer(new QTimer(this))
|
, _authBlockTimer(new QTimer(this))
|
||||||
{
|
{
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
#include <QVariantMap>
|
||||||
|
|
||||||
// hyperion include
|
// hyperion include
|
||||||
#include <hyperion/Hyperion.h>
|
#include <hyperion/Hyperion.h>
|
||||||
@@ -325,8 +326,9 @@ QJsonObject Hyperion::getQJsonConfig() const
|
|||||||
const QJsonObject instanceConfig = _settingsManager->getSettings();
|
const QJsonObject instanceConfig = _settingsManager->getSettings();
|
||||||
const QJsonObject globalConfig = _settingsManager->getSettings({},QStringList());
|
const QJsonObject globalConfig = _settingsManager->getSettings({},QStringList());
|
||||||
|
|
||||||
QVariantMap map = instanceConfig.toVariantMap();
|
QMultiMap map = instanceConfig.toVariantMap();
|
||||||
map.insert(globalConfig.toVariantMap());
|
map.unite(globalConfig.toVariantMap());
|
||||||
|
|
||||||
return QJsonObject::fromVariantMap(map);
|
return QJsonObject::fromVariantMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -240,9 +240,6 @@ QJsonObject SettingsManager::getSettings(const QVariant& instance, const QString
|
|||||||
config = jsonDoc.object();
|
config = jsonDoc.object();
|
||||||
}
|
}
|
||||||
settingsObject.insert(type, config);
|
settingsObject.insert(type, config);
|
||||||
} else
|
|
||||||
{
|
|
||||||
qWarning() << "Failed to parse JSON string:" << configObject;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
"device": {
|
"device": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_conf_enum_custom",
|
"title": "edt_conf_enum_custom",
|
||||||
|
"default": "none",
|
||||||
"options": {
|
"options": {
|
||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user