Ticket #7680: mnews-enclosure-image.patch

File mnews-enclosure-image.patch, 1.8 KB (added by otto at kolsi dot fi, 16 years ago)
  • mythnews/mythnews/newssite.cpp

     
    314314        QDomNode enclosureNode = itemNode.namedItem("enclosure");
    315315        QString enclosure = QString::null;
    316316        QString enclosure_type = QString::null;
     317        QString thumbnail = QString::null;
    317318        if (!enclosureNode.isNull())
    318319        {
    319320            QDomAttr enclosureURL = enclosureNode.toElement()
     
    324325
    325326            QDomAttr enclosureType = enclosureNode.toElement()
    326327                .attributeNode("type");
    327             if (!enclosureType.isNull())
     328            if (!enclosureType.isNull())
     329            {
    328330                enclosure_type  = enclosureType.value();
     331
     332                if (enclosure_type == "image/jpeg"){
     333                    thumbnail = enclosure;
     334                    enclosure = QString::null;
     335                }
     336            }
    329337        }
    330338
    331339        //////////////////////////////////////////////////////////////
     
    341349            itemNode = mediaGroup;
    342350
    343351        QDomNode thumbNode = itemNode.namedItem("media:thumbnail");
    344         QString thumbnail = QString::null;
    345352        if (!thumbNode.isNull())
    346353        {
    347354            QDomAttr thumburl = thumbNode.toElement().attributeNode("url");
  • mythnews/mythnews/mythnews.cpp

     
    322322            }
    323323            else
    324324            {
     325                if (m_thumbnailImage)
     326                    m_thumbnailImage->Hide();
     327
    325328                if (!site->imageURL().isEmpty())
    326329                {
    327330                    QString fileprefix = GetConfDir();