From 8a43efca92baed676541672393984883bdd680f9 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 17 Dec 2014 18:38:48 +0100 Subject: [PATCH] refs #350 Extra static function registerMetadata, so it can be called explicitly --- src/blackcore/context_runtime.cpp | 15 +++++++++------ src/blackcore/context_runtime.h | 3 +++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/blackcore/context_runtime.cpp b/src/blackcore/context_runtime.cpp index 452bcbd96..921ce4d54 100644 --- a/src/blackcore/context_runtime.cpp +++ b/src/blackcore/context_runtime.cpp @@ -43,13 +43,8 @@ namespace BlackCore QMap times; QTime time; - time.start(); + registerMetadata(); - BlackMisc::registerMetadata(); - BlackMisc::initResources(); - BlackSim::registerMetadata(); - BlackCore::registerMetadata(); - times.insert("Register metadata", time.restart()); this->connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &CRuntime::gracefulShutdown); // upfront reading of settings, as DBus server already relies on settings @@ -133,6 +128,14 @@ namespace BlackCore return (token == this->m_contextApplication->ping(token)); } + void CRuntime::registerMetadata() + { + BlackMisc::registerMetadata(); + BlackMisc::initResources(); + BlackSim::registerMetadata(); + BlackCore::registerMetadata(); + } + bool CRuntime::parseCommandLine(const QString commandLine) { bool handled = false; diff --git a/src/blackcore/context_runtime.h b/src/blackcore/context_runtime.h index a9a2827b4..db8bc9c38 100644 --- a/src/blackcore/context_runtime.h +++ b/src/blackcore/context_runtime.h @@ -147,6 +147,9 @@ namespace BlackCore //! Is application context available? bool canPingApplicationContext() const; + //! Register metadata + static void registerMetadata(); + public slots: //! Parse command line in all contexts bool parseCommandLine(const QString commandLine);