mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-24 03:11:03 -07:00
Use ListModel.count instead of rowCount
The .count property properly updates when the model is changed. Contributes to issue CURA-5876.
This commit is contained in:
parent
db05d7853a
commit
f3af5a72ad
14 changed files with 49 additions and 36 deletions
|
|
@ -21,8 +21,10 @@ UM.ManagementPage
|
|||
|
||||
function activeMachineIndex()
|
||||
{
|
||||
for(var i = 0; i < model.rowCount(); i++) {
|
||||
if (model.getItem(i).id == Cura.MachineManager.activeMachineId) {
|
||||
for(var i = 0; i < model.count; i++)
|
||||
{
|
||||
if (model.getItem(i).id == Cura.MachineManager.activeMachineId)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
|
@ -47,7 +49,7 @@ UM.ManagementPage
|
|||
{
|
||||
text: catalog.i18nc("@action:button", "Remove");
|
||||
iconName: "list-remove";
|
||||
enabled: base.currentItem != null && model.rowCount() > 1
|
||||
enabled: base.currentItem != null && model.count > 1
|
||||
onClicked: confirmDialog.open();
|
||||
},
|
||||
Button
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue