Ticket #6782: weather_screens.patch

File weather_screens.patch, 1.8 KB (added by Marc Alban <marcalban@…>, 17 years ago)

Patch to fix how MythWeather handles multiple screens of the same type.

  • mythplugins/mythweather/mythweather/weatherSetup.cpp

     
    264264
    265265    QStringList types;
    266266
    267     ScreenListMap m_ScreenListMap = loadScreens();
     267    ScreenListMap screenListMap = loadScreens();
    268268
    269     ScreenListMap::const_iterator i = m_ScreenListMap.constBegin();
    270     while (i != m_ScreenListMap.constEnd())
     269    ScreenListMap::const_iterator i = screenListMap.constBegin();
     270    while (i != screenListMap.constEnd())
    271271    {
    272272
    273         si = m_ScreenListMap[i.key()];
     273        si = screenListMap[i.key()];
    274274        types = si->dataTypes;
    275275        si->units = ENG_UNITS;
    276276
     
    329329        QString src = db.value(4).toString();
    330330        uint draworder = db.value(5).toUInt();
    331331
    332         si = m_ScreenListMap[name];
     332        si = new ScreenListInfo(*screenListMap[name]);
     333       
    333334        // Clear types first as we will re-insert the values from the database
    334335        si->types.clear();
    335336        types = si->dataTypes;
  • mythplugins/mythweather/mythweather/weatherUtils.h

     
    5151class ScreenListInfo
    5252{
    5353  public:
     54        ScreenListInfo() {}
     55    ScreenListInfo(const ScreenListInfo &info)
     56        : name(info.name), types(info.types), dataTypes(info.dataTypes),
     57        helptxt(info.helptxt), sources(info.sources), units(info.units),
     58        hasUnits(info.hasUnits), multiLoc(info.multiLoc) {}
     59       
    5460    TypeListInfo GetCurrentTypeList(void) const;
    5561
    5662  public: