Skip to content

Commit

Permalink
Drop support for inserting channels parsed from a xawtv config. xawtv…
Browse files Browse the repository at this point in the history
… has been dead for years.
  • Loading branch information
stuartm committed Nov 22, 2012
1 parent a9314eb commit 9b9129e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 122 deletions.
11 changes: 0 additions & 11 deletions mythtv/programs/mythfilldatabase/commandlineparser.cpp
Expand Up @@ -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",
Expand All @@ -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 "
Expand Down
84 changes: 0 additions & 84 deletions mythtv/programs/mythfilldatabase/filldata.cpp
Expand Up @@ -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: */
2 changes: 0 additions & 2 deletions mythtv/programs/mythfilldatabase/filldata.h
Expand Up @@ -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
{
Expand Down
25 changes: 0 additions & 25 deletions mythtv/programs/mythfilldatabase/main.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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.");
Expand Down

0 comments on commit 9b9129e

Please sign in to comment.