Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initialise members in constructor in mythtv-setup

  • Loading branch information...
commit 3da907c675ab8f13ce65ac7a1eab00ee6c8a8bc2 1 parent 5746436
Stuart Morgan stuartm authored
41 mythtv/programs/mythtv-setup/channeleditor.cpp
@@ -57,11 +57,14 @@ ChannelWizard::ChannelWizard(int id, int default_sourceid)
57 57 /////////////////////////////////////////////////////////
58 58
59 59 ChannelEditor::ChannelEditor(MythScreenStack *parent)
60   - : MythScreenType(parent, "channeleditor")
  60 + : MythScreenType(parent, "channeleditor"),
  61 + m_sourceFilter(FILTER_ALL),
  62 + m_currentSortMode(QObject::tr("Channel Name")),
  63 + m_currentHideMode(false),
  64 + m_channelList(NULL), m_sourceList(NULL), m_preview(NULL),
  65 + m_channame(NULL), m_channum(NULL), m_callsign(NULL),
  66 + m_chanid(NULL), m_sourcename(NULL), m_compoundname(NULL)
61 67 {
62   - m_currentSortMode = tr("Channel Name");
63   - m_sourceFilter = FILTER_ALL; // All
64   - m_currentHideMode = false;
65 68 }
66 69
67 70 bool ChannelEditor::Create()
@@ -383,15 +386,15 @@ void ChannelEditor::setHideMode(bool hide)
383 386 void ChannelEditor::del()
384 387 {
385 388 MythUIButtonListItem *item = m_channelList->GetItemCurrent();
386   -
  389 +
387 390 if (!item)
388 391 return;
389   -
  392 +
390 393 QString message = tr("Delete channel '%1'?").arg(item->GetText("name"));
391   -
  394 +
392 395 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
393 396 MythConfirmationDialog *dialog = new MythConfirmationDialog(popupStack, message, true);
394   -
  397 +
395 398 if (dialog->Create())
396 399 {
397 400 dialog->SetData(qVariantFromValue(item));
@@ -400,7 +403,7 @@ void ChannelEditor::del()
400 403 }
401 404 else
402 405 delete dialog;
403   -
  406 +
404 407 }
405 408
406 409 void ChannelEditor::deleteChannels(void)
@@ -414,10 +417,10 @@ void ChannelEditor::deleteChannels(void)
414 417 (del_all) ? tr("Delete ALL channels?") :
415 418 ((del_nul) ? tr("Delete all unassigned channels?") :
416 419 tr("Delete all channels on %1?").arg(currentLabel));
417   -
  420 +
418 421 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
419 422 MythConfirmationDialog *dialog = new MythConfirmationDialog(popupStack, message, true);
420   -
  423 +
421 424 if (dialog->Create())
422 425 {
423 426 dialog->SetReturnEvent(this, "delall");
@@ -586,7 +589,7 @@ void ChannelEditor::customEvent(QEvent *event)
586 589 {
587 590 bool del_all = m_sourceFilter == FILTER_ALL;
588 591 bool del_nul = m_sourceFilter == FILTER_UNASSIGNED;
589   -
  592 +
590 593 MSqlQuery query(MSqlQuery::InitCon());
591 594 if (del_all)
592 595 {
@@ -597,17 +600,17 @@ void ChannelEditor::customEvent(QEvent *event)
597 600 query.prepare("SELECT sourceid "
598 601 "FROM videosource "
599 602 "GROUP BY sourceid");
600   -
  603 +
601 604 if (!query.exec() || !query.isActive())
602 605 {
603 606 MythDB::DBError("ChannelEditor Delete Channels", query);
604 607 return;
605 608 }
606   -
  609 +
607 610 QString tmp = "";
608 611 while (query.next())
609 612 tmp += "'" + query.value(0).toString() + "',";
610   -
  613 +
611 614 if (tmp.isEmpty())
612 615 {
613 616 query.prepare("TRUNCATE TABLE channel");
@@ -625,10 +628,10 @@ void ChannelEditor::customEvent(QEvent *event)
625 628 "WHERE sourceid = :SOURCEID");
626 629 query.bindValue(":SOURCEID", m_sourceFilter);
627 630 }
628   -
  631 +
629 632 if (!query.exec())
630 633 MythDB::DBError("ChannelEditor Delete Channels", query);
631   -
  634 +
632 635 fillList();
633 636 }
634 637 else if (resultid == "iconimportopt")
@@ -638,7 +641,7 @@ void ChannelEditor::customEvent(QEvent *event)
638 641 ImportIconsWizard *iconwizard;
639 642
640 643 QString channelname = dce->GetData().toString();
641   -
  644 +
642 645 switch (buttonnum)
643 646 {
644 647 case 0 : // Import all icons
@@ -663,5 +666,5 @@ void ChannelEditor::customEvent(QEvent *event)
663 666 else
664 667 delete iconwizard;
665 668 }
666   - }
  669 + }
667 670 }
13 mythtv/programs/mythtv-setup/importicons.cpp
@@ -28,7 +28,8 @@ ImportIconsWizard::ImportIconsWizard(MythScreenStack *parent, bool fRefresh,
28 28 m_url("http://services.mythtv.org/channel-icon/"), m_progressDialog(NULL),
29 29 m_iconsList(NULL), m_manualEdit(NULL),
30 30 m_nameText(NULL), m_manualButton(NULL),
31   - m_skipButton(NULL), m_statusText(NULL)
  31 + m_skipButton(NULL), m_statusText(NULL),
  32 + m_preview(NULL), m_previewtitle(NULL)
32 33 {
33 34 m_strChannelname.detach();
34 35 LOG(VB_GENERAL, LOG_INFO,
@@ -60,7 +61,7 @@ bool ImportIconsWizard::Create()
60 61 if (!initialLoad(m_strChannelname))
61 62 return false;
62 63
63   -
  64 +
64 65 bool foundtheme = false;
65 66
66 67 // Load the theme for this screen
@@ -100,7 +101,7 @@ bool ImportIconsWizard::Create()
100 101 SLOT(menuSelection(MythUIButtonListItem *)));
101 102 connect(m_iconsList, SIGNAL(itemSelected(MythUIButtonListItem *)),
102 103 SLOT(itemChanged(MythUIButtonListItem *)));
103   -
  104 +
104 105 BuildFocusList();
105 106
106 107 enableControls(STATE_NORMAL);
@@ -547,7 +548,7 @@ bool ImportIconsWizard::checkAndDownload(const QString& url, const QString& loca
547 548 QFileInfo file(m_strChannelDir+filename);
548 549
549 550 bool fRet;
550   - // Since DNS for lyngsat-logos.com times out, set a 20s timeout
  551 + // Since DNS for lyngsat-logos.com times out, set a 20s timeout
551 552 if (!file.exists())
552 553 fRet = HttpComms::getHttpFile(file.absoluteFilePath(),iconUrl,20000);
553 554 else
@@ -703,9 +704,9 @@ bool ImportIconsWizard::search(const QString& strParam)
703 704 iconfile = m_tmpDir.absoluteFilePath(iconfile);
704 705 QString iconname = entry.strName;
705 706 bool haveIcon = true;
706   - // Since DNS for lyngsat-logos.com times out, set a 20s timeout
  707 + // Since DNS for lyngsat-logos.com times out, set a 20s timeout
707 708 if (!QFile(iconfile).exists())
708   - haveIcon = HttpComms::getHttpFile(iconfile, entry.strLogo,
  709 + haveIcon = HttpComms::getHttpFile(iconfile, entry.strLogo,
709 710 20000);
710 711
711 712 if (haveIcon)

0 comments on commit 3da907c

Please sign in to comment.
Something went wrong with that request. Please try again.