Commit 4cbdc3b4 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.model: extending Import:toString

This allows skipping the alias part.
parent 9b93ac78
......@@ -59,7 +59,7 @@ public:
QString alias() const { return m_alias; }
QStringList importPaths() const { return m_importPathList; }
QString toString(bool addSemicolon = false) const;
QString toString(bool addSemicolon = false, bool skipAlias = false) const;
bool operator==(const Import &other) const;
......
......@@ -60,7 +60,7 @@ Import::Import(const QString &url, const QString &file, const QString &version,
{
}
QString Import::toString(bool addSemicolon) const
QString Import::toString(bool addSemicolon, bool skipAlias) const
{
QString result = QLatin1String("import ");
......@@ -74,7 +74,7 @@ QString Import::toString(bool addSemicolon) const
if (hasVersion())
result += ' ' + version();
if (hasAlias())
if (hasAlias() && !skipAlias)
result += " as " + alias();
if (addSemicolon)
......
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