Loading editor/documentmanager.cpp +7 −0 Changes for editor/documentmanager.cpp: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -154,6 +154,12 @@ bool DocumentManager::importHtml(const QString &html) { return importXml(QString::fromStdString(xmlStr)); } void DocumentManager::propagatePrefix(const std::string &prefix) { for (auto *el : _ownedElements) { if (el) el->setInstancePrefix(prefix); } } QString DocumentManager::renderToHtml() { if (!_docRoot) return {}; Loading Loading @@ -268,6 +274,7 @@ EditPlugin *DocumentManager::createPluginByName(const std::string &name) { if (plgName == lowerName) { EditPlugin *inst = p->createNewInstance(); if (inst) { inst->setInstancePrefix(EditPlugin::getStaticPrefix()); _ownedElements.push_back(inst); return inst; } Loading editor/documentmanager.h +3 −0 Changes for editor/documentmanager.h: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ public: bool importHtml(const QString &html); QString renderToHtml(); /* Propagate prefix to all widget instances */ void propagatePrefix(const std::string &prefix); /* Plugin info */ QString getPluginTypes() const; Loading editor/edit.cpp +1 −0 Changes for editor/edit.cpp: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -427,6 +427,7 @@ blogi::webedit::EditPlugin* blogi::webedit::WebEditor::createPluginByName(const if (pd) { EditPlugin *newInst = pd->createNewInstance(); if (newInst) { newInst->setInstancePrefix(Args.config->getprefix()); // Take ownership DocElements.emplace_back(newInst); return newInst; Loading editor/localapi.cpp +2 −0 Changes for editor/localapi.cpp: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -786,6 +786,7 @@ void LocalApi::connectToServer(const QString &url, const QString &user, const QS QString path = qurl.path(); if (path.endsWith('/')) path.chop(1); blogi::webedit::EditPlugin::setPrefix(path.toStdString()); _doc->propagatePrefix(path.toStdString()); if (user.isEmpty()) { /* No credentials — verify server is reachable */ Loading Loading @@ -819,6 +820,7 @@ void LocalApi::disconnectServer() { _pub->setServerUrl(""); _pub->setAuthToken(""); blogi::webedit::EditPlugin::setPrefix(""); _doc->propagatePrefix(""); emit connectionStatusChanged(false, "Disconnected"); emit statusMessage("Disconnected from server"); } Loading src/plugin.h +10 −1 Changes for src/plugin.h: 10 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -252,10 +252,18 @@ namespace blogi { _Prefix = prefix; } static const std::string& getPrefix() { static const std::string& getStaticPrefix() { return _Prefix; } const std::string& getPrefix() const { return _instancePrefix.empty() ? _Prefix : _instancePrefix; } void setInstancePrefix(const std::string &prefix) { _instancePrefix = prefix; } virtual ~EditPlugin()=default; virtual const std::string getName() const =0; Loading Loading @@ -314,6 +322,7 @@ namespace blogi { uuid::uuid Id; EditPlugin* nextel=nullptr; EditPlugin* child=nullptr; std::string _instancePrefix; static inline std::string _Prefix; friend class EditPluginLoad; }; Loading Loading
editor/documentmanager.cpp +7 −0 Changes for editor/documentmanager.cpp: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -154,6 +154,12 @@ bool DocumentManager::importHtml(const QString &html) { return importXml(QString::fromStdString(xmlStr)); } void DocumentManager::propagatePrefix(const std::string &prefix) { for (auto *el : _ownedElements) { if (el) el->setInstancePrefix(prefix); } } QString DocumentManager::renderToHtml() { if (!_docRoot) return {}; Loading Loading @@ -268,6 +274,7 @@ EditPlugin *DocumentManager::createPluginByName(const std::string &name) { if (plgName == lowerName) { EditPlugin *inst = p->createNewInstance(); if (inst) { inst->setInstancePrefix(EditPlugin::getStaticPrefix()); _ownedElements.push_back(inst); return inst; } Loading
editor/documentmanager.h +3 −0 Changes for editor/documentmanager.h: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -59,6 +59,9 @@ public: bool importHtml(const QString &html); QString renderToHtml(); /* Propagate prefix to all widget instances */ void propagatePrefix(const std::string &prefix); /* Plugin info */ QString getPluginTypes() const; Loading
editor/edit.cpp +1 −0 Changes for editor/edit.cpp: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -427,6 +427,7 @@ blogi::webedit::EditPlugin* blogi::webedit::WebEditor::createPluginByName(const if (pd) { EditPlugin *newInst = pd->createNewInstance(); if (newInst) { newInst->setInstancePrefix(Args.config->getprefix()); // Take ownership DocElements.emplace_back(newInst); return newInst; Loading
editor/localapi.cpp +2 −0 Changes for editor/localapi.cpp: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -786,6 +786,7 @@ void LocalApi::connectToServer(const QString &url, const QString &user, const QS QString path = qurl.path(); if (path.endsWith('/')) path.chop(1); blogi::webedit::EditPlugin::setPrefix(path.toStdString()); _doc->propagatePrefix(path.toStdString()); if (user.isEmpty()) { /* No credentials — verify server is reachable */ Loading Loading @@ -819,6 +820,7 @@ void LocalApi::disconnectServer() { _pub->setServerUrl(""); _pub->setAuthToken(""); blogi::webedit::EditPlugin::setPrefix(""); _doc->propagatePrefix(""); emit connectionStatusChanged(false, "Disconnected"); emit statusMessage("Disconnected from server"); } Loading
src/plugin.h +10 −1 Changes for src/plugin.h: 10 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -252,10 +252,18 @@ namespace blogi { _Prefix = prefix; } static const std::string& getPrefix() { static const std::string& getStaticPrefix() { return _Prefix; } const std::string& getPrefix() const { return _instancePrefix.empty() ? _Prefix : _instancePrefix; } void setInstancePrefix(const std::string &prefix) { _instancePrefix = prefix; } virtual ~EditPlugin()=default; virtual const std::string getName() const =0; Loading Loading @@ -314,6 +322,7 @@ namespace blogi { uuid::uuid Id; EditPlugin* nextel=nullptr; EditPlugin* child=nullptr; std::string _instancePrefix; static inline std::string _Prefix; friend class EditPluginLoad; }; Loading