Skip to content

Commit

Permalink
Fix three dead code warnings in MythNetVision. Coverity 703658,703659…
Browse files Browse the repository at this point in the history
…,703660
  • Loading branch information
stuartm committed Jun 3, 2013
1 parent 5817309 commit 3ffed8d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 46 deletions.
16 changes: 7 additions & 9 deletions mythplugins/mythnetvision/mythnetvision/rsseditor.cpp
Expand Up @@ -452,7 +452,7 @@ bool RSSEditor::keyPressEvent(QKeyEvent *event)
{
slotDeleteSite();
}
if (action == "EDIT" && GetFocusWidget() == m_sites)
else if (action == "EDIT" && GetFocusWidget() == m_sites)
{
slotEditSite();
}
Expand Down Expand Up @@ -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;
}
}

Expand Down
18 changes: 10 additions & 8 deletions mythplugins/mythnetvision/mythnetvision/searcheditor.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

Expand All @@ -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);
}
}

61 changes: 32 additions & 29 deletions mythplugins/mythnetvision/mythnetvision/treeeditor.cpp
Expand Up @@ -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();
Expand All @@ -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();
}
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 3ffed8d

Please sign in to comment.