Permalink
Browse files

Fix three dead code warnings in MythNetVision. Coverity 703658,703659…

…,703660
  • Loading branch information...
stuartm committed Jun 3, 2013
1 parent 5817309 commit 3ffed8d6b30faf3a4e4b360342910dff78699503
@@ -452,7 +452,7 @@ bool RSSEditor::keyPressEvent(QKeyEvent *event)
{
slotDeleteSite();
}
if (action == "EDIT" && GetFocusWidget() == m_sites)
else if (action == "EDIT" && GetFocusWidget() == m_sites)
{
slotEditSite();
}
@@ -480,15 +480,13 @@ void RSSEditor::fillRSSButtonList()
new MythUIButtonListItem(m_sites, (*i)->GetTitle());
if (item)
{
item->SetText((*i)->GetTitle(), "title");
item->SetText((*i)->GetDescription(), "description");
item->SetText((*i)->GetURL(), "url");
item->SetText((*i)->GetAuthor(), "author");
item->SetData(qVariantFromValue(*i));
item->SetImage((*i)->GetImage());
item->SetText((*i)->GetTitle(), "title");
item->SetText((*i)->GetDescription(), "description");
item->SetText((*i)->GetURL(), "url");
item->SetText((*i)->GetAuthor(), "author");
item->SetData(qVariantFromValue(*i));
item->SetImage((*i)->GetImage());
}
else
delete item;
}
}
@@ -118,11 +118,15 @@ void SearchEditor::slotLoadedData()
type = grabber.firstChildElement("type").text();
description = grabber.firstChildElement("description").text();
version = grabber.firstChildElement("version").text().toDouble();
QString treestring = grabber.firstChildElement("tree").text();
if (!treestring.isEmpty() && (treestring.toLower() == "true" ||
treestring.toLower() == "yes" || treestring == "1"))
tree = true;
QString searchstring = grabber.firstChildElement("search").text();
if (!searchstring.isEmpty() && (searchstring.toLower() == "true" ||
searchstring.toLower() == "yes" || searchstring == "1"))
search = true;
@@ -199,20 +203,21 @@ void SearchEditor::fillGrabberButtonList()
item->SetData(qVariantFromValue(*i));
QString img = (*i)->GetImage();
QString thumb;
if (!img.startsWith("/") && !img.isEmpty())
thumb = QString("%1mythnetvision/icons/%2").arg(GetShareDir())
.arg((*i)->GetImage());
else
thumb = img;
item->SetImage(thumb);
item->setCheckable(true);
item->setChecked(MythUIButtonListItem::NotChecked);
QFileInfo fi((*i)->GetCommandline());
if (findSearchGrabberInDB(fi.fileName(), VIDEO_FILE))
item->setChecked(MythUIButtonListItem::FullChecked);
}
else
delete item;
}
}
@@ -236,13 +241,10 @@ void SearchEditor::toggleItem(MythUIButtonListItem *item)
item->setChecked(MythUIButtonListItem::FullChecked);
}
}
else
else if (removeSearchFromDB(script))
{
if (removeSearchFromDB(script))
{
m_changed = true;
item->setChecked(MythUIButtonListItem::NotChecked);
}
m_changed = true;
item->setChecked(MythUIButtonListItem::NotChecked);
}
}
@@ -128,11 +128,11 @@ void TreeEditor::slotLoadedData()
QDomElement grabber = content.firstChildElement("grabber");
while (!grabber.isNull())
{
{
QString title, author, image, description, type, commandline;
double version;
bool search = false;
bool tree = false;
double version;
bool search = false;
bool tree = false;
title = grabber.firstChildElement("name").text();
commandline = grabber.firstChildElement("command").text();
@@ -141,25 +141,29 @@ void TreeEditor::slotLoadedData()
type = grabber.firstChildElement("type").text();
description = grabber.firstChildElement("description").text();
version = grabber.firstChildElement("version").text().toDouble();
QString treestring = grabber.firstChildElement("tree").text();
if (!treestring.isEmpty() && (treestring.toLower() == "true" ||
treestring.toLower() == "yes" || treestring == "1"))
tree = true;
if (!treestring.isEmpty() && (treestring.toLower() == "true" ||
treestring.toLower() == "yes" || treestring == "1"))
tree = true;
QString searchstring = grabber.firstChildElement("search").text();
if (!searchstring.isEmpty() && (searchstring.toLower() == "true" ||
searchstring.toLower() == "yes" || searchstring == "1"))
search = true;
if (!searchstring.isEmpty() && (searchstring.toLower() == "true" ||
searchstring.toLower() == "yes" || searchstring == "1"))
search = true;
if (type.toLower() == "video" && tree)
{
LOG(VB_GENERAL, LOG_INFO,
QString("Found Browseable Source %1...").arg(title));
m_grabberList.append(new GrabberScript(title, image, VIDEO_FILE, author,
search, tree, description, commandline, version));
search, tree, description, commandline, version));
}
grabber = grabber.nextSiblingElement("grabber");
}
}
parsedData();
}
@@ -205,24 +209,23 @@ void TreeEditor::fillGrabberButtonList()
new MythUIButtonListItem(m_grabbers, (*i)->GetTitle());
if (item)
{
item->SetText((*i)->GetTitle(), "title");
item->SetData(qVariantFromValue(*i));
QString img = (*i)->GetImage();
QString thumb;
if (!img.startsWith("/") && !img.isEmpty())
thumb = QString("%1mythnetvision/icons/%2").arg(GetShareDir())
.arg((*i)->GetImage());
else
thumb = img;
item->SetImage(thumb);
item->setCheckable(true);
item->setChecked(MythUIButtonListItem::NotChecked);
QFileInfo fi((*i)->GetCommandline());
if (findTreeGrabberInDB(fi.fileName(), VIDEO_FILE))
item->setChecked(MythUIButtonListItem::FullChecked);
item->SetText((*i)->GetTitle(), "title");
item->SetData(qVariantFromValue(*i));
QString img = (*i)->GetImage();
QString thumb;
if (!img.startsWith("/") && !img.isEmpty())
thumb = QString("%1mythnetvision/icons/%2").arg(GetShareDir())
.arg((*i)->GetImage());
else
thumb = img;
item->SetImage(thumb);
item->setCheckable(true);
item->setChecked(MythUIButtonListItem::NotChecked);
QFileInfo fi((*i)->GetCommandline());
if (findTreeGrabberInDB(fi.fileName(), VIDEO_FILE))
item->setChecked(MythUIButtonListItem::FullChecked);
}
else
delete item;
}
}

0 comments on commit 3ffed8d

Please sign in to comment.