Opened 12 years ago

Closed 12 years ago

#4596 closed defect (fixed)

Don't add unnecessary data items to Active Screens

Reported by: Joe Ripley <vitaminjoe@…> Owned by: stuartm
Priority: trivial Milestone: 0.21
Component: mythweather Version: head
Severity: low Keywords: MythWeather settings
Cc: stuartm Ticket locked: no

Description

The code in weatherSetup.cpp currently adds all of the dataitems from the weatherdatalayout DB table to the Active Screen that is selected. This causes problems when you want to change the location for a given Active Screen.

What happens is, the plugin attempts to locate a source that supplies all of the dataitems that was provided for the previous location for the new location. Most grabbers don't supply the same dataitems for their locations. The end result is an incomplete list of possible locations to change to.

This patch makes sure that dataitem is only inserted into the ScreenListInfo? object if the given type is defined for the current container.

Attachments (2)

4596_diff.patch (1.3 KB) - added by Joe Ripley <vitaminjoe@…> 12 years ago.
Check if dataitem belongs to the given container before adding it to ScreenListInfo?->types
4596_diff.2.patch (553 bytes) - added by Joe Ripley <vitaminjoe@…> 12 years ago.
Initialize type list for each container first!

Download all attachments as: .zip

Change History (7)

Changed 12 years ago by Joe Ripley <vitaminjoe@…>

Attachment: 4596_diff.patch added

Check if dataitem belongs to the given container before adding it to ScreenListInfo?->types

comment:1 Changed 12 years ago by Joe Ripley <vitaminjoe@…>

This problem can be reproduced by defining a new screen (i.e. Current Conditions) using the ENVCAN grabber (pick a Canadian city, like Edmonton). After saving the screen, try changing the location so that it's something the ENVCAN grabber doesn't know about (i.e. New York). You'll find 0 results returned. However, you can search for Canadian cities and get results from the ENVCAN grabber, but not the other grabbers (because they don't supply ALL of the dataitems that ENVCAN does).

After applying this patch everything works fine. :)

-- Joe Ripley vitaminjoe@…

comment:2 Changed 12 years ago by stuartm

Resolution: fixed
Status: newclosed

(In [15783]) "Check if dataitem belongs to the given container before adding it to ScreenListInfo?->types"

Patch by Joe Ripley

Closes #4596

comment:3 Changed 12 years ago by stuartm

Owner: changed from ldunning to stuartm

Changed 12 years ago by Joe Ripley <vitaminjoe@…>

Attachment: 4596_diff.2.patch added

Initialize type list for each container first!

comment:4 Changed 12 years ago by Joe Ripley <vitaminjoe@…>

Resolution: fixed
Status: closednew

Forgot to re-build the type list for each container as we enter it. This caused all of the types in the DB to get screwed up when changing the location of an existing 'Active Screen' definition.

I've tested this ad-nauseum. Should be good to commit.

-- Joe Ripley vitaminjoe@…

comment:5 Changed 12 years ago by stuartm

Resolution: fixed
Status: newclosed

(In [15812]) Re-init the types list for each screen.

Patch by Joe Ripley

Fixes #4596 again.

Note: See TracTickets for help on using tickets.