From 9b9129e722338872dc926c5ef81e25d2ede1fdfe Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 22 Nov 2012 14:33:25 +0000 Subject: [PATCH] Drop support for inserting channels parsed from a xawtv config. xawtv has been dead for years. --- .../mythfilldatabase/commandlineparser.cpp | 11 --- mythtv/programs/mythfilldatabase/filldata.cpp | 84 ------------------- mythtv/programs/mythfilldatabase/filldata.h | 2 - mythtv/programs/mythfilldatabase/main.cpp | 25 ------ 4 files changed, 122 deletions(-) diff --git a/mythtv/programs/mythfilldatabase/commandlineparser.cpp b/mythtv/programs/mythfilldatabase/commandlineparser.cpp index 19ec684dfbc..9f65650d70c 100644 --- a/mythtv/programs/mythfilldatabase/commandlineparser.cpp +++ b/mythtv/programs/mythfilldatabase/commandlineparser.cpp @@ -39,17 +39,11 @@ void MythFillDatabaseCommandLineParser::LoadArguments(void) "Directly define the sourceid and XMLTV file to " "import.") ->SetBlocks("ddfile") - ->SetBlocks("xawchannels") ->SetRequires("sourceid"); add("--dd-file", "ddfile", false, "Bypass grabber, and read SD data from file", "Directly define the data needed to import a local " "DataDirect download.") - ->SetBlocks("xawchannels") - ->SetRequires("sourceid"); - add("--xawchannels", "xawchannels", false, - "Read channels from xawtvrc file", - "Import channels from an xawtvrc file.") ->SetRequires("sourceid"); add("--sourceid", "sourceid", 0, "Operate on single source", @@ -72,11 +66,6 @@ void MythFillDatabaseCommandLineParser::LoadArguments(void) ->SetRequiredChildOf("ddfile") ->SetRequiredChildOf("file"); - add("--xawtvrcfile", "xawtvrcfile", "", - "xawtvrc file to import channels from", - "Xawtvrc file containing channels to be imported.") - ->SetRequiredChildOf("xawchannels"); - add("--do-channel-updates", "dochannelupdates", false, "update channels using datadirect", "When using DataDirect, ask mythfilldatabase to " diff --git a/mythtv/programs/mythfilldatabase/filldata.cpp b/mythtv/programs/mythfilldatabase/filldata.cpp index 5667b28bea5..55224e8a7a9 100644 --- a/mythtv/programs/mythfilldatabase/filldata.cpp +++ b/mythtv/programs/mythfilldatabase/filldata.cpp @@ -1003,88 +1003,4 @@ bool FillData::Run(SourceList &sourcelist) return (failures == 0); } -ChannelInfo *FillData::xawtvChannel(QString &id, QString &channel, QString &fine) -{ - ChannelInfo *chaninfo = new ChannelInfo; - chaninfo->xmltvid = id; - chaninfo->name = id; - chaninfo->callsign = id; - if (chan_data.channel_preset) - chaninfo->channum = id; - else - chaninfo->channum = channel; - chaninfo->finetune = fine.toInt(); - chaninfo->freqid = channel; - chaninfo->tvformat = "Default"; - - return chaninfo; -} - -void FillData::readXawtvChannels(int id, QString xawrcfile) -{ - QByteArray tmp = xawrcfile.toAscii(); - fstream fin(tmp.constData(), ios::in); - - if (!fin.is_open()) - return; - - ChannelInfoList chanlist; - - QString xawid; - QString channel; - QString fine; - - string strLine; - int nSplitPoint = 0; - - while(!fin.eof()) - { - getline(fin,strLine); - - if ((strLine[0] != '#') && (!strLine.empty())) - { - if (strLine[0] == '[') - { - if ((nSplitPoint = strLine.find(']')) > 1) - { - if (!xawid.isEmpty() && !channel.isEmpty()) - { - ChannelInfo *chinfo = xawtvChannel(xawid, channel, fine); - chanlist.push_back(*chinfo); - delete chinfo; - } - xawid = strLine.substr(1, nSplitPoint - 1).c_str(); - channel.clear(); - fine.clear(); - } - } - else if ((nSplitPoint = strLine.find('=') + 1) > 0) - { - while (strLine.substr(nSplitPoint,1) == " ") - { ++nSplitPoint; } - - if (!strncmp(strLine.c_str(), "channel", 7)) - { - channel = strLine.substr(nSplitPoint, - strLine.size()).c_str(); - } - else if (!strncmp(strLine.c_str(), "fine", 4)) - { - fine = strLine.substr(nSplitPoint, strLine.size()).c_str(); - } - } - } - } - - if (!xawid.isEmpty() && !channel.isEmpty()) - { - ChannelInfo *chinfo = xawtvChannel(xawid, channel, fine); - chanlist.push_back(*chinfo); - delete chinfo; - } - - chan_data.handleChannels(id, &chanlist); - icon_data.UpdateSourceIcons(id); -} - /* vim: set expandtab tabstop=4 shiftwidth=4: */ diff --git a/mythtv/programs/mythfilldatabase/filldata.h b/mythtv/programs/mythfilldatabase/filldata.h index 43eb3610fcd..d9a5592537a 100644 --- a/mythtv/programs/mythfilldatabase/filldata.h +++ b/mythtv/programs/mythfilldatabase/filldata.h @@ -68,8 +68,6 @@ class FillData bool GrabDataFromDDFile(int id, int offset, const QString &filename, const QString &lineupid, QDate *qCurrentDate = 0); bool Run(SourceList &sourcelist); - ChannelInfo *xawtvChannel(QString &id, QString &channel, QString &fine); - void readXawtvChannels(int id, QString xawrcfile); enum { diff --git a/mythtv/programs/mythfilldatabase/main.cpp b/mythtv/programs/mythfilldatabase/main.cpp index d055306dffc..87a07740c69 100644 --- a/mythtv/programs/mythfilldatabase/main.cpp +++ b/mythtv/programs/mythfilldatabase/main.cpp @@ -66,9 +66,6 @@ int main(int argc, char *argv[]) int fromfile_id = 1; int fromfile_offset = 0; QString fromfile_name; - bool from_xawfile = false; - int fromxawfile_id = 1; - QString fromxawfile_name; bool from_file = false; bool mark_repeats = true; @@ -189,24 +186,6 @@ int main(int argc, char *argv[]) from_dd_file = true; } - if (cmdline.toBool("xawchannels")) - { - // xaw channel import mode - if (!cmdline.toBool("sourceid") || - !cmdline.toBool("xawtvrcfile")) - { - cerr << "The --xawchannels option must be used in combination" - << endl - << "with both --sourceid and --xawtvrcfile" << endl; - } - - fromxawfile_id = cmdline.toInt("sourceid"); - fromxawfile_name = cmdline.toString("xawtvrcfile"); - - LOG(VB_GENERAL, LOG_INFO, "Reading channels from xawtv configfile"); - from_xawfile = true; - } - if (cmdline.toBool("dochannelupdates")) fill_data.chan_data.channel_updates = true; if (cmdline.toBool("removechannels")) @@ -376,10 +355,6 @@ int main(int argc, char *argv[]) if (!grab_data) { } - else if (from_xawfile) - { - fill_data.readXawtvChannels(fromxawfile_id, fromxawfile_name); - } else if (from_file) { QString status = QObject::tr("currently running.");