forked from qt-creator/qt-creator
QmlDesigner: Refactor out ContentLibraryMaterial from user bundle
Some tweaks and refactoring to get rid of ContentLibraryMaterial in the user section of the content library. The end goal is to unify the code for handling all Qml components in the user section (materials, 3d components, effects, 2D components. etc). Change-Id: I99d4fb64dae0b52265994ce478525e574e4bc658 Reviewed-by: Ali Kianian <ali.kianian@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
|
||||
#include "contentlibrarymaterial.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
ContentLibraryMaterial::ContentLibraryMaterial(QObject *parent,
|
||||
@@ -12,11 +10,8 @@ ContentLibraryMaterial::ContentLibraryMaterial(QObject *parent,
|
||||
const QString &qml,
|
||||
const TypeName &type,
|
||||
const QUrl &icon,
|
||||
const QStringList &files,
|
||||
const QString &downloadPath,
|
||||
const QString &baseWebUrl)
|
||||
const QStringList &files)
|
||||
: QObject(parent), m_name(name), m_qml(qml), m_type(type), m_icon(icon), m_files(files)
|
||||
, m_downloadPath(downloadPath), m_baseWebUrl(baseWebUrl)
|
||||
{
|
||||
m_allFiles = m_files;
|
||||
m_allFiles.push_back(m_qml);
|
||||
@@ -78,22 +73,6 @@ bool ContentLibraryMaterial::imported() const
|
||||
return m_imported;
|
||||
}
|
||||
|
||||
bool ContentLibraryMaterial::isDownloaded() const
|
||||
{
|
||||
QString fullPath = qmlFilePath();
|
||||
return QFileInfo(fullPath).isFile();
|
||||
}
|
||||
|
||||
QString ContentLibraryMaterial::qmlFilePath() const
|
||||
{
|
||||
return m_downloadPath + "/" + m_qml;
|
||||
}
|
||||
|
||||
QString ContentLibraryMaterial::dirPath() const
|
||||
{
|
||||
return m_downloadPath;
|
||||
}
|
||||
|
||||
QStringList ContentLibraryMaterial::allFiles() const
|
||||
{
|
||||
return m_allFiles;
|
||||
|
||||
Reference in New Issue
Block a user