NymeaCore: class cleanup and statup improvements

This commit is contained in:
Simon Stürz 2025-11-15 15:36:09 +01:00
parent e4ef75b76d
commit cfc13d6984
3 changed files with 9 additions and 14 deletions

View File

@ -229,8 +229,6 @@ JsonRPCServerImplementation::JsonRPCServerImplementation(const QSslConfiguration
params.insert("o:token", enumValueName(String)); params.insert("o:token", enumValueName(String));
registerNotification("PushButtonAuthFinished", description, params); registerNotification("PushButtonAuthFinished", description, params);
QMetaObject::invokeMethod(this, "setup", Qt::QueuedConnection);
connect(NymeaCore::instance()->userManager(), &UserManager::pushButtonAuthFinished, this, &JsonRPCServerImplementation::onPushButtonAuthFinished); connect(NymeaCore::instance()->userManager(), &UserManager::pushButtonAuthFinished, this, &JsonRPCServerImplementation::onPushButtonAuthFinished);
m_connectionLockdownTimer.setSingleShot(true); m_connectionLockdownTimer.setSingleShot(true);

View File

@ -60,6 +60,7 @@
#include <QDir> #include <QDir>
#include <QCoreApplication> #include <QCoreApplication>
#include <QMetaObject>
#ifdef WITH_SYSTEMD #ifdef WITH_SYSTEMD
#include <systemd/sd-daemon.h> #include <systemd/sd-daemon.h>
@ -168,6 +169,8 @@ void NymeaCore::init(const QStringList &additionalInterfaces, bool disableLogEng
connect(m_thingManager, &ThingManagerImplementation::loaded, this, &NymeaCore::thingManagerLoaded); connect(m_thingManager, &ThingManagerImplementation::loaded, this, &NymeaCore::thingManagerLoaded);
QMetaObject::invokeMethod(m_serverManager->jsonServer(), "setup", Qt::QueuedConnection);
m_logger->log({"started"}, {{"version", NYMEA_VERSION_STRING}}); m_logger->log({"started"}, {{"version", NYMEA_VERSION_STRING}});
#ifdef WITH_SYSTEMD #ifdef WITH_SYSTEMD
sd_notify(0, "READY=1"); sd_notify(0, "READY=1");
@ -271,10 +274,12 @@ QStringList NymeaCore::getAvailableLanguages()
foreach (const QString &path, searchPaths) { foreach (const QString &path, searchPaths) {
QDir translationDirectory(path); QDir translationDirectory(path);
translationDirectory.setNameFilters(QStringList() << "*.qm"); translationDirectory.setNameFilters(QStringList() << "*.qm");
translationFiles = translationDirectory.entryList(); const QStringList filesInPath = translationDirectory.entryList();
qCDebug(dcTranslations()) << translationFiles.count() << "translations in" << path; qCDebug(dcTranslations()) << filesInPath.count() << "translations in" << path;
if (translationFiles.count() > 0) { foreach (const QString &translationFile, filesInPath) {
break; if (!translationFiles.contains(translationFile)) {
translationFiles.append(translationFile);
}
} }
} }
@ -321,11 +326,6 @@ UserManager *NymeaCore::userManager() const
return m_userManager; return m_userManager;
} }
CloudManager *NymeaCore::cloudManager() const
{
return m_cloudManager;
}
DebugServerHandler *NymeaCore::debugServerHandler() const DebugServerHandler *NymeaCore::debugServerHandler() const
{ {
return m_debugServerHandler; return m_debugServerHandler;

View File

@ -64,7 +64,6 @@ class UserManager;
class Platform; class Platform;
class System; class System;
class ExperienceManager; class ExperienceManager;
class CloudManager;
class ZigbeeManager; class ZigbeeManager;
class ZWaveManager; class ZWaveManager;
class ModbusRtuManager; class ModbusRtuManager;
@ -108,7 +107,6 @@ public:
BluetoothServer *bluetoothServer() const; BluetoothServer *bluetoothServer() const;
NetworkManager *networkManager() const; NetworkManager *networkManager() const;
UserManager *userManager() const; UserManager *userManager() const;
CloudManager *cloudManager() const;
DebugServerHandler *debugServerHandler() const; DebugServerHandler *debugServerHandler() const;
TagsStorage *tagsStorage() const; TagsStorage *tagsStorage() const;
Platform *platform() const; Platform *platform() const;
@ -140,7 +138,6 @@ private:
LogEngine *m_logEngine = nullptr; LogEngine *m_logEngine = nullptr;
Logger *m_logger = nullptr; Logger *m_logger = nullptr;
TimeManager *m_timeManager = nullptr; TimeManager *m_timeManager = nullptr;
CloudManager *m_cloudManager = nullptr;
HardwareManagerImplementation *m_hardwareManager = nullptr; HardwareManagerImplementation *m_hardwareManager = nullptr;
DebugServerHandler *m_debugServerHandler = nullptr; DebugServerHandler *m_debugServerHandler = nullptr;
TagsStorage *m_tagsStorage = nullptr; TagsStorage *m_tagsStorage = nullptr;