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