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 | ||||
|  | ||||
| #ifdef Unsorted | ||||
| #undef Unsorted | ||||
| #endif | ||||
|  | ||||
| #include <utils/Logger.h> | ||||
| #include <QMap> | ||||
| #include <QVariant> | ||||
|   | ||||
| @@ -1,13 +1,13 @@ | ||||
| add_library(database | ||||
| 	${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/DBManager.h | ||||
| 	${CMAKE_SOURCE_DIR}/include/db/InstanceTable.h | ||||
| 	${CMAKE_SOURCE_DIR}/include/db/MetaTable.h | ||||
| 	${CMAKE_SOURCE_DIR}/include/db/SettingsTable.h | ||||
| 	${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/DBManager.cpp | ||||
| 	${CMAKE_SOURCE_DIR}/libsrc/db/InstanceTable.cpp | ||||
| 	${CMAKE_SOURCE_DIR}/libsrc/db/MetaTable.cpp | ||||
| 	${CMAKE_SOURCE_DIR}/libsrc/db/SettingsTable.cpp | ||||
|   | ||||
| @@ -14,6 +14,7 @@ | ||||
| #include <QSqlQuery> | ||||
| #include <QSqlError> | ||||
| #include <QDir> | ||||
| #include <QDateTime> | ||||
|  | ||||
| ConfigImportExport::ConfigImportExport(QObject* parent) | ||||
| 	: DBManager(parent) | ||||
|   | ||||
| @@ -400,7 +400,11 @@ QString DBManager::constructExecutedQuery(const QSqlQuery& query) const | ||||
|  | ||||
| 	// Check if the query uses positional placeholders | ||||
| 	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 | ||||
| 		for (const QVariant &value : boundValues) { | ||||
| 			// Replace the first occurrence of '?' with the actual value | ||||
|   | ||||
| @@ -7,6 +7,8 @@ | ||||
| // qt | ||||
| #include <QJsonObject> | ||||
| #include <QTimer> | ||||
| #include <QDateTime> | ||||
| #include <QUuid> | ||||
|  | ||||
| AuthManager *AuthManager::manager = nullptr; | ||||
|  | ||||
| @@ -14,7 +16,6 @@ AuthManager::AuthManager(QObject *parent) | ||||
| 	: QObject(parent) | ||||
| 	, _authTable(new AuthTable(this)) | ||||
| 	, _metaTable(new MetaTable(this)) | ||||
| 	, _pendingRequests() | ||||
| 	, _timer(new QTimer(this)) | ||||
| 	, _authBlockTimer(new QTimer(this)) | ||||
| { | ||||
|   | ||||
| @@ -6,6 +6,7 @@ | ||||
| #include <QString> | ||||
| #include <QStringList> | ||||
| #include <QThread> | ||||
| #include <QVariantMap> | ||||
|  | ||||
| // hyperion include | ||||
| #include <hyperion/Hyperion.h> | ||||
| @@ -325,8 +326,9 @@ QJsonObject Hyperion::getQJsonConfig() const | ||||
| 	const QJsonObject instanceConfig = _settingsManager->getSettings(); | ||||
| 	const QJsonObject globalConfig = _settingsManager->getSettings({},QStringList()); | ||||
|  | ||||
| 	QVariantMap map = instanceConfig.toVariantMap(); | ||||
| 	map.insert(globalConfig.toVariantMap()); | ||||
| 	QMultiMap map = instanceConfig.toVariantMap(); | ||||
| 	map.unite(globalConfig.toVariantMap()); | ||||
|  | ||||
| 	return QJsonObject::fromVariantMap(map); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -240,9 +240,6 @@ QJsonObject SettingsManager::getSettings(const QVariant& instance, const QString | ||||
| 					config = jsonDoc.object(); | ||||
| 				} | ||||
| 				settingsObject.insert(type, config); | ||||
| 			} else | ||||
| 			{ | ||||
| 				qWarning() << "Failed to parse JSON string:" << configObject; | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
| @@ -24,6 +24,7 @@ | ||||
| 		"device": { | ||||
| 			"type": "string", | ||||
| 			"title": "edt_conf_enum_custom", | ||||
| 			"default": "none", | ||||
| 			"options": { | ||||
| 				"hidden": true | ||||
| 			}, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user