File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1511,8 +1511,10 @@ PluginComponent {
15111511
15121512 // When model is a ListModel, role names are direct properties.
15131513 // When model is a JS array, values are accessed via modelData.
1514+ // `real`, not `int`: a weekly per-model total passes the signed
1515+ // 32-bit range (2.1B tokens), and `int` wraps it negative.
15141516 property string _modelName: modelListData === modelRepeater .model ? modelName : (modelData ? modelData .modelName : " " )
1515- property int _modelTokens: modelListData === modelRepeater .model ? modelTokens : (modelData ? (modelData .modelTokens || 0 ) : 0 )
1517+ property real _modelTokens: modelListData === modelRepeater .model ? modelTokens : (modelData ? (modelData .modelTokens || 0 ) : 0 )
15161518
15171519 Row {
15181520 width: parent .width
Original file line number Diff line number Diff line change @@ -47,6 +47,19 @@ for f in $QML_FILES; do
4747 fi
4848done
4949
50+ echo " === Test 4: Token counts are not declared as 32-bit int ==="
51+ for f in $QML_FILES ; do
52+ name=$( basename " $f " )
53+ # QML `int` is signed 32-bit, so it wraps negative past 2147483647. A weekly
54+ # per-model token total passes that, so token properties must be `real`.
55+ if grep -qE ' ^[[:space:]]*property[[:space:]]+int[[:space:]]+[A-Za-z_]*[Tt]okens' " $f " ; then
56+ grep -nE ' ^[[:space:]]*property[[:space:]]+int[[:space:]]+[A-Za-z_]*[Tt]okens' " $f " >&2
57+ fail " $name declares a token count as int (wraps negative past 2.1B)"
58+ else
59+ pass " $name declares token counts as real"
60+ fi
61+ done
62+
5063echo " "
5164echo " Results: $PASS passed, $FAIL failed"
5265[ " $FAIL " -eq 0 ] || exit 1
You can’t perform that action at this time.
0 commit comments