Skip to content

Commit

Permalink
Fix display of tracker names in solar drilldown pages
Browse files Browse the repository at this point in the history
- SolarChargers.qml: formatTrackerName() was trying to substitute a
string arg that did not exist
- SolarChargerPage.qml: the QuantityTable needs to ensure the tracker
name is not displayed as an empty string. If the tracker name is
empty, use Global.solarChargers.formatTrackerName() to find an
appropriate name based on the tracker's charger.
  • Loading branch information
blammit committed Jul 15, 2024
1 parent b706e2b commit b7c7f3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/SolarChargers.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ QtObject {
if (trackerName.length > 0) {
return trackerName
} else {
return "#%2".arg(deviceName).arg(trackerIndex + 1)
return "#%2".arg(trackerIndex + 1)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pages/solar/SolarChargerPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Page {
valueForModelIndex: function(trackerIndex, column) {
const tracker = root.solarCharger.trackers.get(trackerIndex).solarTracker
if (column === 0) {
return tracker.name
return Global.solarChargers.formatTrackerName(tracker.name, trackerIndex, root.solarCharger.trackers.count, root.solarCharger.name, VenusOS.TrackerName_NoDevicePrefix)
} else if (column === 1) {
// Today's yield for this tracker
const history = root.solarCharger.dailyTrackerHistory(0, trackerIndex)
Expand Down

0 comments on commit b7c7f3f

Please sign in to comment.