Commit f2f7357f authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.MetaInfo: adding importDirectoryPath() to NodeMetaInfo



importDirectoryPath() returns the path to the plugin this component
comes from.

Change-Id: I6d7f1834052921a3f6176c493e8d359316a3dcbb
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 96788d29
......@@ -99,6 +99,8 @@ public:
bool isPositioner() const;
QString importDirectoryPath() const;
static void clearCache();
private:
......
......@@ -385,6 +385,7 @@ public:
QString componentSource() const;
QString componentFileName() const;
QString importDirectoryPath() const;
static Pointer create(Model *model, const QString &type, int maj = -1, int min = -1);
......@@ -852,6 +853,16 @@ QString NodeMetaInfoPrivate::componentFileName() const
return QString();
}
QString NodeMetaInfoPrivate::importDirectoryPath() const
{
if (isValid()) {
const Imports *imports = context()->imports(document());
ImportInfo importInfo = imports->info(qualfiedTypeName(), context().data());
return importInfo.path();
}
return QString();
}
QString NodeMetaInfoPrivate::lookupName() const
{
......@@ -1109,7 +1120,12 @@ QString NodeMetaInfo::componentSource() const
QString NodeMetaInfo::componentFileName() const
{
return NodeMetaInfo::m_privateData->componentFileName();
return m_privateData->componentFileName();
}
QString NodeMetaInfo::importDirectoryPath() const
{
return m_privateData->importDirectoryPath();
}
bool NodeMetaInfo::hasCustomParser() const
......
Markdown is supported
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