forked from qt-creator/qt-creator
QmlDesigner: Clean up flow tags remainings
Remove the remaining unused code related to flow tags. Flow tags feature
was removed as part of the new item library ui commit:
151184a609
Change-Id: Ic2f518cb7d345d4f5a183194bebb29c76b227c15
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -307,7 +307,7 @@ QmlDesigner_ScrollBarHandleColor=ff595b5c
|
|||||||
|
|
||||||
;palette colors
|
;palette colors
|
||||||
|
|
||||||
;outline colors on the combo box, zoom slider, flowtag button, dialog outlines, on loading project the whole screen flashes this color
|
;outline colors on the combo box, zoom slider, dialog outlines, on loading project the whole screen flashes this color
|
||||||
;PaletteWindow=normalBackground
|
;PaletteWindow=normalBackground
|
||||||
PaletteWindow=ff262626
|
PaletteWindow=ff262626
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ PaletteText=text
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
;text for flowtags, import dropdown, ticks for tick boxes.
|
; text for ticks for tick boxes.
|
||||||
PaletteButtonText=text
|
PaletteButtonText=text
|
||||||
;PaletteButtonText=ffd3299a
|
;PaletteButtonText=ffd3299a
|
||||||
|
|
||||||
|
@@ -229,15 +229,11 @@ void ItemLibraryWidget::setItemLibraryInfo(ItemLibraryInfo *itemLibraryInfo)
|
|||||||
if (m_itemLibraryInfo) {
|
if (m_itemLibraryInfo) {
|
||||||
disconnect(m_itemLibraryInfo.data(), &ItemLibraryInfo::entriesChanged,
|
disconnect(m_itemLibraryInfo.data(), &ItemLibraryInfo::entriesChanged,
|
||||||
this, &ItemLibraryWidget::delayedUpdateModel);
|
this, &ItemLibraryWidget::delayedUpdateModel);
|
||||||
disconnect(m_itemLibraryInfo.data(), &ItemLibraryInfo::importTagsChanged,
|
|
||||||
this, &ItemLibraryWidget::delayedUpdateModel);
|
|
||||||
}
|
}
|
||||||
m_itemLibraryInfo = itemLibraryInfo;
|
m_itemLibraryInfo = itemLibraryInfo;
|
||||||
if (itemLibraryInfo) {
|
if (itemLibraryInfo) {
|
||||||
connect(m_itemLibraryInfo.data(), &ItemLibraryInfo::entriesChanged,
|
connect(m_itemLibraryInfo.data(), &ItemLibraryInfo::entriesChanged,
|
||||||
this, &ItemLibraryWidget::delayedUpdateModel);
|
this, &ItemLibraryWidget::delayedUpdateModel);
|
||||||
connect(m_itemLibraryInfo.data(), &ItemLibraryInfo::importTagsChanged,
|
|
||||||
this, &ItemLibraryWidget::delayedUpdateModel);
|
|
||||||
}
|
}
|
||||||
delayedUpdateModel();
|
delayedUpdateModel();
|
||||||
}
|
}
|
||||||
|
@@ -108,14 +108,11 @@ public:
|
|||||||
void clearEntries();
|
void clearEntries();
|
||||||
|
|
||||||
QStringList blacklistImports() const;
|
QStringList blacklistImports() const;
|
||||||
QStringList showTagsForImports() const;
|
|
||||||
|
|
||||||
void addBlacklistImports(const QStringList &list);
|
void addBlacklistImports(const QStringList &list);
|
||||||
void addShowTagsForImports(const QStringList &list);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void entriesChanged();
|
void entriesChanged();
|
||||||
void importTagsChanged();
|
|
||||||
|
|
||||||
private: // functions
|
private: // functions
|
||||||
ItemLibraryInfo(QObject *parent = nullptr);
|
ItemLibraryInfo(QObject *parent = nullptr);
|
||||||
@@ -126,7 +123,6 @@ private: // variables
|
|||||||
QPointer<ItemLibraryInfo> m_baseInfo;
|
QPointer<ItemLibraryInfo> m_baseInfo;
|
||||||
|
|
||||||
QStringList m_blacklistImports;
|
QStringList m_blacklistImports;
|
||||||
QStringList m_showTagsForImports;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
@@ -344,29 +344,11 @@ QStringList ItemLibraryInfo::blacklistImports() const
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove this and its dependencies, as flow tags are removed
|
|
||||||
QStringList ItemLibraryInfo::showTagsForImports() const
|
|
||||||
{
|
|
||||||
auto list = m_showTagsForImports;
|
|
||||||
if (m_baseInfo)
|
|
||||||
list.append(m_baseInfo->m_showTagsForImports);
|
|
||||||
list.removeDuplicates();
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ItemLibraryInfo::addBlacklistImports(const QStringList &list)
|
void ItemLibraryInfo::addBlacklistImports(const QStringList &list)
|
||||||
{
|
{
|
||||||
m_blacklistImports.append(list);
|
m_blacklistImports.append(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ItemLibraryInfo::addShowTagsForImports(const QStringList &list)
|
|
||||||
{
|
|
||||||
if (!list.isEmpty()) {
|
|
||||||
m_showTagsForImports.append(list);
|
|
||||||
emit importTagsChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ItemLibraryInfo::setBaseInfo(ItemLibraryInfo *baseInfo)
|
void ItemLibraryInfo::setBaseInfo(ItemLibraryInfo *baseInfo)
|
||||||
{
|
{
|
||||||
m_baseInfo = baseInfo;
|
m_baseInfo = baseInfo;
|
||||||
|
@@ -230,8 +230,6 @@ void MetaInfoReader::readImportsProperty(const QString &name, const QVariant &va
|
|||||||
|
|
||||||
if (name == "blacklistImports" && !values.isEmpty()) {
|
if (name == "blacklistImports" && !values.isEmpty()) {
|
||||||
m_metaInfo.itemLibraryInfo()->addBlacklistImports(values);
|
m_metaInfo.itemLibraryInfo()->addBlacklistImports(values);
|
||||||
} else if (name == "showTagsForImports" && !values.isEmpty()) {
|
|
||||||
m_metaInfo.itemLibraryInfo()->addShowTagsForImports(values);
|
|
||||||
} else {
|
} else {
|
||||||
addError(tr("Unknown property for Imports %1").arg(name), currentSourceLocation());
|
addError(tr("Unknown property for Imports %1").arg(name), currentSourceLocation());
|
||||||
setParserState(Error);
|
setParserState(Error);
|
||||||
|
@@ -369,23 +369,6 @@ void SubComponentManager::parseQuick3DAssetDir(const QString &assetPath)
|
|||||||
for (QString &asset : assets)
|
for (QString &asset : assets)
|
||||||
asset.prepend(assetImportRoot + QLatin1Char('.'));
|
asset.prepend(assetImportRoot + QLatin1Char('.'));
|
||||||
|
|
||||||
QStringList newFlowTags;
|
|
||||||
const QStringList flowTags = model()->metaInfo().itemLibraryInfo()->showTagsForImports();
|
|
||||||
const QString quick3Dlib = QLatin1String(Constants::QT_QUICK_3D_MODULE_NAME);
|
|
||||||
const QList<Import> possibleImports = model()->possibleImports();
|
|
||||||
|
|
||||||
auto isPossibleImport = [&possibleImports](const QString &asset) {
|
|
||||||
for (const Import &import : possibleImports) {
|
|
||||||
if (import.url() == asset)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// If there are 3D assets in import path, add a flow tag for QtQuick3D
|
|
||||||
if (!assets.isEmpty() && !flowTags.contains(quick3Dlib) && isPossibleImport(quick3Dlib))
|
|
||||||
newFlowTags << quick3Dlib;
|
|
||||||
|
|
||||||
// Create item library entries for Quick3D assets that are imported by document
|
// Create item library entries for Quick3D assets that are imported by document
|
||||||
const QString iconPath = QStringLiteral(":/ItemLibrary/images/item-3D_model-icon.png");
|
const QString iconPath = QStringLiteral(":/ItemLibrary/images/item-3D_model-icon.png");
|
||||||
for (auto &import : qAsConst(m_imports)) {
|
for (auto &import : qAsConst(m_imports)) {
|
||||||
@@ -427,17 +410,6 @@ void SubComponentManager::parseQuick3DAssetDir(const QString &assetPath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create flow tags for the rest, if they are possible imports
|
|
||||||
if (!assets.isEmpty()) {
|
|
||||||
for (const QString &asset : qAsConst(assets)) {
|
|
||||||
if (!flowTags.contains(asset) && isPossibleImport(asset))
|
|
||||||
newFlowTags << asset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!newFlowTags.isEmpty())
|
|
||||||
model()->metaInfo().itemLibraryInfo()->addShowTagsForImports(newFlowTags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList SubComponentManager::quick3DAssetPaths() const
|
QStringList SubComponentManager::quick3DAssetPaths() const
|
||||||
|
@@ -70,7 +70,6 @@ const char QUICK_3D_ASSETS_FOLDER[] = "/Quick3DAssets";
|
|||||||
const char QUICK_3D_ASSET_LIBRARY_ICON_SUFFIX[] = "_libicon";
|
const char QUICK_3D_ASSET_LIBRARY_ICON_SUFFIX[] = "_libicon";
|
||||||
const char QUICK_3D_ASSET_ICON_DIR[] = "_icons";
|
const char QUICK_3D_ASSET_ICON_DIR[] = "_icons";
|
||||||
const char DEFAULT_ASSET_IMPORT_FOLDER[] = "/asset_imports";
|
const char DEFAULT_ASSET_IMPORT_FOLDER[] = "/asset_imports";
|
||||||
const char QT_QUICK_3D_MODULE_NAME[] = "QtQuick3D";
|
|
||||||
|
|
||||||
// Menus
|
// Menus
|
||||||
const char M_VIEW_WORKSPACES[] = "QmlDesigner.Menu.View.Workspaces";
|
const char M_VIEW_WORKSPACES[] = "QmlDesigner.Menu.View.Workspaces";
|
||||||
@@ -86,7 +85,6 @@ const char EVENT_ANNOTATION_ADDED[] = "Annotation Added";
|
|||||||
const char EVENT_RESOURCE_IMPORTED[] = "Resource Imported ";
|
const char EVENT_RESOURCE_IMPORTED[] = "Resource Imported ";
|
||||||
const char EVENT_ACTION_EXECUTED[] = "Action Executed ";
|
const char EVENT_ACTION_EXECUTED[] = "Action Executed ";
|
||||||
const char EVENT_IMPORT_ADDED[] = "Import Added ";
|
const char EVENT_IMPORT_ADDED[] = "Import Added ";
|
||||||
const char EVENT_IMPORT_ADDED_FLOWTAG[] = "Import Added FlowTag ";
|
|
||||||
const char EVENT_BINDINGEDITOR_OPENED[] = "Binding Editor Opened";
|
const char EVENT_BINDINGEDITOR_OPENED[] = "Binding Editor Opened";
|
||||||
const char EVENT_RICHTEXT_OPENED[] = "Richtext Editor Opened";
|
const char EVENT_RICHTEXT_OPENED[] = "Richtext Editor Opened";
|
||||||
const char EVENT_FORMEDITOR_TIME[] = "Form Editor";
|
const char EVENT_FORMEDITOR_TIME[] = "Form Editor";
|
||||||
|
Reference in New Issue
Block a user