Verified Commit 61ee6869 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳
Browse files

AppModel: Rename role names

parent f0e760f9
......@@ -306,13 +306,12 @@ int AppModel::rowCount(const QModelIndex &parent) const
QHash<int, QByteArray> AppModel::roleNames() const
{
QHash<int, QByteArray> roles = QAbstractListModel::roleNames();
roles[ApplicationNameRole] = "ApplicationName";
roles[ApplicationIconRole] = "ApplicationIcon";
roles[ApplicationDesktopFileRole] = "ApplicationDesktopFile";
roles[ApplicationCategoryRole] = "ApplicationCategory";
return roles;
return {
{ApplicationNameRole, QByteArrayLiteral("applicationName")},
{ApplicationIconRole, QByteArrayLiteral("applicationIcon")},
{ApplicationDesktopFileRole, QByteArrayLiteral("applicationDesktopFile")},
{ApplicationCategoryRole, QByteArrayLiteral("applicationCategory")}
};
}
void AppModel::loadApplications()
......
......@@ -104,7 +104,7 @@ Item {
Rectangle {
anchors.fill: parent
color: Kirigami.Theme.highlightColor
visible: ApplicationDesktopFile == AppChooserData.defaultApp
visible: model.applicationDesktopFile === AppChooserData.defaultApp
radius: 2
}
......@@ -114,7 +114,7 @@ Item {
hoverEnabled: true
onContainsMouseChanged: cursorShape = containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: AppChooserData.applicationSelected(ApplicationDesktopFile)
onClicked: AppChooserData.applicationSelected(model.applicationDesktopFile)
}
Column {
......@@ -126,7 +126,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
height: Kirigami.Units.iconSizes.huge
width: Kirigami.Units.iconSizes.huge
source: ApplicationIcon
source: model.applicationIcon
smooth: true
}
......@@ -138,7 +138,7 @@ Item {
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
maximumLineCount: 2
text: ApplicationName
text: model.applicationName
wrapMode: Text.WordWrap
}
}
......
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