Skip to content

Commit a02927d

Browse files
Fix cppcheck 'error'. This just gets rid of some redundant code.
Note: I did check to see that this wasn't a real regression, 30 minutes on that, 3 minutes on the 'fix' once I assured myself it wasn't.
1 parent 7d78b55 commit a02927d

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

mythtv/programs/mythfrontend/playbackbox.cpp

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2833,25 +2833,16 @@ MythMenu* PlaybackBox::createStorageMenu()
28332833
return NULL;
28342834

28352835
QString title = tr("Storage Options") + CreateProgramInfoString(*pginfo);
2836+
QString autoExpireText = (pginfo->IsAutoExpirable()) ?
2837+
tr("Disable Auto Expire") : tr("Enable Auto Expire");
2838+
QString preserveText = (pginfo->IsPreserved()) ?
2839+
tr("Do not preserve this episode") : tr("Preserve this episode");
28362840

28372841
MythMenu *menu = new MythMenu(title, this, "slotmenu");
2838-
28392842
menu->AddItem(tr("Change Recording Group"), SLOT(ShowRecGroupChanger()));
2840-
28412843
menu->AddItem(tr("Change Playback Group"), SLOT(ShowPlayGroupChanger()));
2842-
2843-
if (pginfo)
2844-
{
2845-
if (pginfo->IsAutoExpirable())
2846-
menu->AddItem(tr("Disable Auto Expire"), SLOT(toggleAutoExpire()));
2847-
else
2848-
menu->AddItem(tr("Enable Auto Expire"), SLOT(toggleAutoExpire()));
2849-
2850-
if (pginfo->IsPreserved())
2851-
menu->AddItem(tr("Do not preserve this episode"), SLOT(togglePreserveEpisode()));
2852-
else
2853-
menu->AddItem(tr("Preserve this episode"), SLOT(togglePreserveEpisode()));
2854-
}
2844+
menu->AddItem(autoExpireText, SLOT(toggleAutoExpire()));
2845+
menu->AddItem(preserveText, SLOT(togglePreserveEpisode()));
28552846

28562847
return menu;
28572848
}

0 commit comments

Comments
 (0)