Commit b3799504 authored by Guenter Schwann's avatar Guenter Schwann Committed by Alex Diev
Browse files

656 Store the DV function path in XML

parent e479bb17
Pipeline #7108 passed with stage
in 8 minutes and 13 seconds
......@@ -40,6 +40,7 @@ const QHash<QString, Props::Token> Props::TokensByName = {
{ "url", Token::url },
{ "type", Token::type },
{ "encoding", Token::encoding },
{ "path", Token::path },
{ "port", Token::port },
{ "bus", Token::bus },
......
......@@ -58,6 +58,7 @@ public:
url,
type,
encoding,
path,
from_node,
from_port,
......
......@@ -87,14 +87,27 @@ QString DVFunction::defaultImplementation() const
}
/*!
Retruns the full ath of the function (relevant for nested functions)
Returns the full ath of the function (relevant for nested functions)
Does update the information from interfaceview if possible.
*/
QStringList DVFunction::path() const
{
QStringList path;
const QString tokenName = meta::Props::token(meta::Props::Token::path);
if (model() && model()->ivQueries()) {
return model()->ivQueries()->functionPath(title());
path = model()->ivQueries()->functionPath(title());
auto self = const_cast<DVFunction *>(this);
self->setEntityAttribute(tokenName, QVariant::fromValue(path.join("::")));
} else {
path = entityAttributeValue<QString>(tokenName, title()).split("::");
}
return {};
return path;
}
void DVFunction::updateForExport()
{
path();
}
} // namespace dvm
......@@ -41,6 +41,8 @@ public:
QStringList path() const;
void updateForExport() override;
Q_SIGNALS:
void usedImplementationChanged();
void implementationChanged();
......
......@@ -110,6 +110,9 @@ public:
virtual QVariantList generateProperties(bool isProperty) const = 0;
// Perform updates/actions directly before the data is saved
virtual void updateForExport() {};
Q_SIGNALS:
void attributeChanged(const QString &name);
......
......@@ -75,6 +75,7 @@ protected:
QHash<QString, QVariant> grouppedObjects;
for (const auto &object : objects) {
object->updateForExport();
if (object->parentObject() != nullptr)
continue;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment