Ticket #5659: xmltv_config_path_fixes.diff

File xmltv_config_path_fixes.diff, 1.6 KB (added by laga@…, 16 years ago)
  • libs/libmythtv/videosource.cpp

     
    451451    QString filename = QString("%1/%2.xmltv")
    452452        .arg(MythContext::GetConfDir()).arg(parent.getSourceName());
    453453
     454    gContext->SaveSetting(QString("XMLTVConfig.%1").arg(parent.getSourceName()), filename);
     455
    454456    command = QString("%1 --config-file '%2' --configure")
    455457        .arg(grabber).arg(filename);
    456458
  • programs/mythfilldatabase/filldata.cpp

     
    315315
    316316    QString filename = QString(tempfilename);
    317317
    318     QString home = QDir::homeDirPath();
    319     QString configfile = QString("%1/%2.xmltv").arg(MythContext::GetConfDir())
     318    QString configfile = gContext->GetSetting(QString("XMLTVConfig.%1").arg(source.name),NULL);
     319
     320    if (configfile == NULL) {
     321   
     322        VERBOSE(VB_GENERAL, "XMLTVConfig entry in settings table missing, falling back to old behavior");
     323        QString home = QDir::homeDirPath();
     324        configfile = QString("%1/%2.xmltv").arg(MythContext::GetConfDir())
    320325                                                       .arg(source.name);
     326    }
    321327
     328    VERBOSE(VB_GENERAL, QString("XMLTV config file is: %1").arg(configfile));
     329
    322330    QString command  = QString("nice %1 --config-file '%2' --output %3")
    323331                            .arg(xmltv_grabber.ascii())
    324332                            .arg(configfile.ascii())