Permalink
Browse files

Initialise members in constructor in mythtv-setup

  • Loading branch information...
1 parent 5746436 commit 3da907c675ab8f13ce65ac7a1eab00ee6c8a8bc2 @stuartm stuartm committed Aug 23, 2011
Showing with 29 additions and 25 deletions.
  1. +22 −19 mythtv/programs/mythtv-setup/channeleditor.cpp
  2. +7 −6 mythtv/programs/mythtv-setup/importicons.cpp
View
41 mythtv/programs/mythtv-setup/channeleditor.cpp
@@ -57,11 +57,14 @@ ChannelWizard::ChannelWizard(int id, int default_sourceid)
/////////////////////////////////////////////////////////
ChannelEditor::ChannelEditor(MythScreenStack *parent)
- : MythScreenType(parent, "channeleditor")
+ : MythScreenType(parent, "channeleditor"),
+ m_sourceFilter(FILTER_ALL),
+ m_currentSortMode(QObject::tr("Channel Name")),
+ m_currentHideMode(false),
+ m_channelList(NULL), m_sourceList(NULL), m_preview(NULL),
+ m_channame(NULL), m_channum(NULL), m_callsign(NULL),
+ m_chanid(NULL), m_sourcename(NULL), m_compoundname(NULL)
{
- m_currentSortMode = tr("Channel Name");
- m_sourceFilter = FILTER_ALL; // All
- m_currentHideMode = false;
}
bool ChannelEditor::Create()
@@ -383,15 +386,15 @@ void ChannelEditor::setHideMode(bool hide)
void ChannelEditor::del()
{
MythUIButtonListItem *item = m_channelList->GetItemCurrent();
-
+
if (!item)
return;
-
+
QString message = tr("Delete channel '%1'?").arg(item->GetText("name"));
-
+
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *dialog = new MythConfirmationDialog(popupStack, message, true);
-
+
if (dialog->Create())
{
dialog->SetData(qVariantFromValue(item));
@@ -400,7 +403,7 @@ void ChannelEditor::del()
}
else
delete dialog;
-
+
}
void ChannelEditor::deleteChannels(void)
@@ -414,10 +417,10 @@ void ChannelEditor::deleteChannels(void)
(del_all) ? tr("Delete ALL channels?") :
((del_nul) ? tr("Delete all unassigned channels?") :
tr("Delete all channels on %1?").arg(currentLabel));
-
+
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *dialog = new MythConfirmationDialog(popupStack, message, true);
-
+
if (dialog->Create())
{
dialog->SetReturnEvent(this, "delall");
@@ -586,7 +589,7 @@ void ChannelEditor::customEvent(QEvent *event)
{
bool del_all = m_sourceFilter == FILTER_ALL;
bool del_nul = m_sourceFilter == FILTER_UNASSIGNED;
-
+
MSqlQuery query(MSqlQuery::InitCon());
if (del_all)
{
@@ -597,17 +600,17 @@ void ChannelEditor::customEvent(QEvent *event)
query.prepare("SELECT sourceid "
"FROM videosource "
"GROUP BY sourceid");
-
+
if (!query.exec() || !query.isActive())
{
MythDB::DBError("ChannelEditor Delete Channels", query);
return;
}
-
+
QString tmp = "";
while (query.next())
tmp += "'" + query.value(0).toString() + "',";
-
+
if (tmp.isEmpty())
{
query.prepare("TRUNCATE TABLE channel");
@@ -625,10 +628,10 @@ void ChannelEditor::customEvent(QEvent *event)
"WHERE sourceid = :SOURCEID");
query.bindValue(":SOURCEID", m_sourceFilter);
}
-
+
if (!query.exec())
MythDB::DBError("ChannelEditor Delete Channels", query);
-
+
fillList();
}
else if (resultid == "iconimportopt")
@@ -638,7 +641,7 @@ void ChannelEditor::customEvent(QEvent *event)
ImportIconsWizard *iconwizard;
QString channelname = dce->GetData().toString();
-
+
switch (buttonnum)
{
case 0 : // Import all icons
@@ -663,5 +666,5 @@ void ChannelEditor::customEvent(QEvent *event)
else
delete iconwizard;
}
- }
+ }
}
View
13 mythtv/programs/mythtv-setup/importicons.cpp
@@ -28,7 +28,8 @@ ImportIconsWizard::ImportIconsWizard(MythScreenStack *parent, bool fRefresh,
m_url("http://services.mythtv.org/channel-icon/"), m_progressDialog(NULL),
m_iconsList(NULL), m_manualEdit(NULL),
m_nameText(NULL), m_manualButton(NULL),
- m_skipButton(NULL), m_statusText(NULL)
+ m_skipButton(NULL), m_statusText(NULL),
+ m_preview(NULL), m_previewtitle(NULL)
{
m_strChannelname.detach();
LOG(VB_GENERAL, LOG_INFO,
@@ -60,7 +61,7 @@ bool ImportIconsWizard::Create()
if (!initialLoad(m_strChannelname))
return false;
-
+
bool foundtheme = false;
// Load the theme for this screen
@@ -100,7 +101,7 @@ bool ImportIconsWizard::Create()
SLOT(menuSelection(MythUIButtonListItem *)));
connect(m_iconsList, SIGNAL(itemSelected(MythUIButtonListItem *)),
SLOT(itemChanged(MythUIButtonListItem *)));
-
+
BuildFocusList();
enableControls(STATE_NORMAL);
@@ -547,7 +548,7 @@ bool ImportIconsWizard::checkAndDownload(const QString& url, const QString& loca
QFileInfo file(m_strChannelDir+filename);
bool fRet;
- // Since DNS for lyngsat-logos.com times out, set a 20s timeout
+ // Since DNS for lyngsat-logos.com times out, set a 20s timeout
if (!file.exists())
fRet = HttpComms::getHttpFile(file.absoluteFilePath(),iconUrl,20000);
else
@@ -703,9 +704,9 @@ bool ImportIconsWizard::search(const QString& strParam)
iconfile = m_tmpDir.absoluteFilePath(iconfile);
QString iconname = entry.strName;
bool haveIcon = true;
- // Since DNS for lyngsat-logos.com times out, set a 20s timeout
+ // Since DNS for lyngsat-logos.com times out, set a 20s timeout
if (!QFile(iconfile).exists())
- haveIcon = HttpComms::getHttpFile(iconfile, entry.strLogo,
+ haveIcon = HttpComms::getHttpFile(iconfile, entry.strLogo,
20000);
if (haveIcon)

0 comments on commit 3da907c

Please sign in to comment.