Skip to content

Commit

Permalink
Fix harmless QML errors when switching locator results <-> filters mo…
Browse files Browse the repository at this point in the history
…dels
  • Loading branch information
nirvn committed Sep 2, 2023
1 parent d523e83 commit cee49c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/core/locator/locatormodelsuperbridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ LocatorActionsModel::LocatorActionsModel( int rows, int columns, QObject *parent
QHash<int, QByteArray> LocatorActionsModel::roleNames() const
{
QHash<int, QByteArray> roles;
roles[IconPathRole] = "iconPath";
roles[IdRole] = "id";
roles[IconPathRole] = "IconPath";
roles[IdRole] = "Id";
return roles;
}

Expand Down
16 changes: 10 additions & 6 deletions src/qml/LocatorItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ Item {
id: descriptionCell
anchors.left: parent.left
anchors.right: parent.right
text: Description
text: Description || ''
leftPadding: 5
font.bold: false
font.pointSize: Theme.resultFont.pointSize
Expand Down Expand Up @@ -364,8 +364,8 @@ Item {
Rectangle {
id: delegateRect

property bool isGroup: model.ResultFilterGroupSorting === 0
property bool isFilterName: model.ResultType === 0
property bool isGroup: ResultFilterGroupSorting === 0
property bool isFilterName: ResultType === 0
property int resultIndex: index

anchors.margins: 10
Expand Down Expand Up @@ -397,7 +397,11 @@ Item {
id: nameCell
anchors.left: parent.left
anchors.right: parent.right
text: isFilterName ? model.ResultFilterName : model.Text.trim()
text: isFilterName
? ResultFilterName
: typeof(model.Text) == 'string'
? model.Text.trim()
: ''
leftPadding: 5
font.bold: false
font.pointSize: Theme.resultFont.pointSize
Expand Down Expand Up @@ -438,11 +442,11 @@ Item {
padding: 0
bgcolor: "transparent"

iconSource: Theme.getThemeIcon(model.iconPath)
iconSource: Theme.getThemeIcon(IconPath)

onClicked: {
locatorItem.state = "off"
locator.triggerResultAtRow(delegateRect.resultIndex, model.id)
locator.triggerResultAtRow(delegateRect.resultIndex, Id)
}
}
}
Expand Down

0 comments on commit cee49c4

Please sign in to comment.