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

QmlDesigner.itemLibrary: always show Qml Components first

Also we do translate "Qml Components" anymore since it might get confusing
and all the other categories do not get translated, either.
parent de2868d1
...@@ -301,16 +301,13 @@ void ItemLibrarySectionModel::updateItemIconSize(const QSize &itemIconSize) ...@@ -301,16 +301,13 @@ void ItemLibrarySectionModel::updateItemIconSize(const QSize &itemIconSize)
} }
} }
bool ItemLibrarySectionModel::operator<(const ItemLibrarySectionModel &other) const bool ItemLibrarySectionModel::operator<(const ItemLibrarySectionModel &other) const
{ {
if (sectionName() == QLatin1String("QML Components")) //Qml Components always come first
return true;
return sectionName() < other.sectionName(); return sectionName() < other.sectionName();
} }
ItemLibraryModel::ItemLibraryModel(QScriptEngine *scriptEngine, QObject *parent) ItemLibraryModel::ItemLibraryModel(QScriptEngine *scriptEngine, QObject *parent)
: ItemLibrarySortedModel<ItemLibrarySectionModel>(parent), : ItemLibrarySortedModel<ItemLibrarySectionModel>(parent),
m_scriptEngine(scriptEngine), m_scriptEngine(scriptEngine),
......
...@@ -350,7 +350,7 @@ void SubComponentManagerPrivate::registerQmlFile(const QFileInfo &fileInfo, cons ...@@ -350,7 +350,7 @@ void SubComponentManagerPrivate::registerQmlFile(const QFileInfo &fileInfo, cons
ItemLibraryEntry itemLibraryEntry; ItemLibraryEntry itemLibraryEntry;
itemLibraryEntry.setType(componentName, -1, -1); itemLibraryEntry.setType(componentName, -1, -1);
itemLibraryEntry.setName(componentName); itemLibraryEntry.setName(componentName);
itemLibraryEntry.setCategory(tr("QML Components")); itemLibraryEntry.setCategory("QML Components");
m_metaInfo.itemLibraryInfo()->addEntry(itemLibraryEntry); m_metaInfo.itemLibraryInfo()->addEntry(itemLibraryEntry);
} }
} }
......
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