27 #include <QQmlContext> 78 Zblcore::Zblcore(QObject* parent)
79 : QQmlExtensionPlugin(parent)
81 zDebug() <<
"Zblcore::Zblcore";
85 "Zbl::Zblcore::Zblcore programming error: " 86 "only one instance of Zblcore class should exist per linux process!");
88 qRegisterMetaType<Zbl::ZRoleRow>();
102 logProfilePath,
true);
107 m_zApp =
new ZApplication(&logMan);
111 logMan.setApplicationObject(m_zApp);
117 zDebug() <<
"Log Manager initialized";
121 zDebug() <<
"Cog initialized";
125 QThread* guiThread = qApp->thread();
127 zDebug() <<
"Moving Zuble core objects to GUI thread.";
129 logMan.moveToThread(guiThread);
131 zDebug() <<
"Core objects move to GUI thread complete.";
137 zDebug() <<
"Zblcore::~Zblcore";
142 return m_zApp ? true :
false;
148 zDebug() <<
"Zblcore::registerResource";
153 return zCog.registerResource(uri, versionMajor, versionMinor);
163 zDebug() <<
"Zblcore::mapResource";
165 if(!uri || !fileName)
168 return zCog.mapResource(uri, versionMajor, versionMinor, fileName);
176 zDebug() <<
"Zblcore::mapResource: " << configFilePath;
178 return zCog.mapConfigResources(configFilePath);
183 zDebug() <<
"Zblcore::mapPluginResources";
185 return zCog.mapPluginResources(fileName, qmlRegister);
192 zDebug() <<
"Zblcore::initializeEngine, uri: " << uri;
199 zDebug() <<
"Zblcore::registerTypes, uri: " << uri;
201 qDebug() <<
"Zblcore::registerTypes thread: " 244 bool status = qmlProtectModule(uri, 1);
247 qWarning(
"Zblcore::registerTypes - Warning: QML module %s could not " 248 "be protected.", uri);
253 zDebug() <<
"Zblcore::mapConfigSettings";
262 "Zbl::Zblcore::zInstance programming error: " 263 "embedded ZApplication object not initialized!");
273 modules.append(tmpOut);
276 modules.append(tmpOut);
279 modules.append(tmpOut);
282 modules.append(tmpOut);
285 modules.append(tmpOut);
287 qApp->setProperty(
"org_zuble_logModules",
288 QVariant::fromValue<Zbl::ZblLogOutput::zLogModuleList>(modules));
static void registerType()
Registers ZTextStream as a QML type.
static void registerType()
Registers ZioDevice as a QML type.
static void zInit()
Initialize static variables.
static void registerType()
Registers ZAndGate as a QML type.
static void registerType()
Registers ZLogReader as a QML type.
static bool isInitialized()
true if the ZApplication object has completed initialization, false otherwise
static void registerType()
Registers ZSettings as a QML type.
static void registerType()
Registers ZByteArray as a QML type.
static void debugCompareThreadAddress(const char *label, QObject *obj)
Sends both current thread address and object's thread address to qDebug.
static ZblLogManager & zInit(QObject *parent)
Construct, initialize and obtain a reference to Zuble's log manager object.
static void registerType()
Registers ZTableColumnList as a QML type.
static void registerType()
Registers ZScriptThread as a QML type.
static void registerType()
Registers ZxItem as a QML type.
static void registerType()
#define ZBL_REGISTER_LOGGED_OBJECT
static void registerType()
Registers ZFile as a QML type.
static void registerType()
Registers ZxResultItems as a QML type. TBD: should we do this?
static ZApplication * m_zApp
static bool mapConfigSettings(const char *configFilePath)
static void registerType()
Registers ZFile as a QML type.
The core Zuble QML Extension plugin class.
static void registerType()
Registers ZLogMap as a QML type.
Abstract base class for Zuble log output modules.
static void zInit()
This method must be called once at the start of each thread that throws or catches ZblException objec...
static void registerType()
Registers ZTableModel as a QML type.
#define ZBL_DEFINE_LOGGED_OBJECT(class_name)
virtual bool mapPluginResources(const char *fileName, bool qmlRegister)
Read binary resource file information from the specified Zuble sprocket plugin.
static void registerType()
Registers ZFileSystemWatcher as a QML type.
static int registerType()
Registers this object with the QML type system.
static void registerType()
Registers ZTableColumn as a QML type.
static void registerType()
Registers ZDataStream as a QML type.
virtual bool registerResource(const char *uri, int versionMajor, int versionMinor)
Registers a binary resource with QML. This makes a resource available to QML documents.
virtual bool mapConfigResources(const char *configFilePath)
Read binary resource file information from the specified Zuble application configuration file (zblcon...
static QString getObjectThreadAddress(QObject *object)
Returns the human-readable memory address of the specified object's thread.
static int registerSingletonType()
Registers this object with QML as a singleton type.
static QString createTemporaryLogProfile(const QString &nameTemplate, bool remove=false)
Creates an empty file with a unique file name in the log profile directory.
bool inObjectThread(const QObject &object)
static void registerType()
Register ZMailbox as a QML type.
Zuble's Singleton Application Object.
static ZApplication & zApplication()
Return a reference to the encapsulated singleton ZApplication object.
static void registerType()
Registers ZDir as a QML type.
static void registerType()
Registers ZxQuery as a QML type.
Zuble's Qt Exception Object.
static QString getLogSettingsMetadata()
Returns an xml data structure that defines the zuble application's log settings.
virtual bool mapConfigSettings(const char *fileName)
Load QML settings bundles from the specified Zuble application configuration file (zblconfig...
virtual bool mapResource(const char *uri, int versionMajor, int versionMinor, const char *fileName)
Binds a resource uri to a resource file. See ZblCog for more information.
static void registerType()
Registers ZMessageQueue as a QML type.
QList< ZblLogOutput * > zLogModuleList
virtual void initializeEngine(QQmlEngine *engine, const char *uri)
This override of QQmlExtensionPlugin is currently unused and may be deprecated.
static void registerType()
Registers ZLogViewport as a QML type.
static bool insertBundle(const QString &id, const QString &metaPath, QSettings::Scope scope=QSettings::UserScope, const QString organization=QString(), const QString application=QString())
Adds the specified settings bundle to the settings repository.
virtual void registerTypes(const char *uri)
Override of QQmlExtensionPlugin is called by the QML engine to register the Zuble core plugin's QML t...
static void registerType()
Register ZMailbox as a QML type.
static void registerType()
Register ZMailbox as a QML type.
static ZblCog & zInit(QObject *parent)