Ticket #5697: mythbrowser-uninit.patch

File mythbrowser-uninit.patch, 3.2 KB (added by Erik Hovland <erik@…>, 13 years ago)

initialize member vars in ctors

  • mythplugins/mythbrowser/mythbookmarkmanager/bookmarkeditor.cpp

    Fixes uninit defects in mythbrowser
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     .../mythbookmarkmanager/bookmarkeditor.cpp         |   16 +++++++---------
     .../mythbookmarkmanager/bookmarkmanager.cpp        |   10 ++++------
     .../mythbrowser/mythbrowser/mythbrowser.cpp        |   11 +++++------
     3 files changed, 16 insertions(+), 21 deletions(-)
    
    diff --git a/mythplugins/mythbrowser/mythbookmarkmanager/bookmarkeditor.cpp b/mythplugins/mythbrowser/mythbookmarkmanager/bookmarkeditor.cpp
    index 2e7a2b3..4799938 100644
    a b  
    1818 */
    1919BookmarkEditor::BookmarkEditor(Bookmark *site, bool edit,
    2020                               MythScreenStack *parent, const char *name)
    21     : MythScreenType (parent, name)
     21    : MythScreenType (parent, name),
     22      m_site(site),               m_siteName(""),
     23      m_siteCategory(),           m_editing(edit),
     24      m_titleText(NULL),          m_categoryEdit(NULL),
     25      m_nameEdit(NULL),           m_urlEdit(NULL),
     26      m_okButton(NULL),           m_cancelButton(NULL),
     27      m_findCategoryButton(NULL), m_searchDialog(NULL)
    2228{
    23     m_categoryEdit = m_nameEdit = m_urlEdit = NULL;
    24     m_okButton = m_cancelButton = NULL;
    25 
    26     m_site = site;
    27     m_editing = edit;
    28 
    2929    if (m_editing)
    3030    {
    3131        m_siteCategory = m_site->category;
    3232        m_siteName = m_site->name;
    3333    }
    34     else
    35         m_siteName = "";
    3634}
    3735
    3836BookmarkEditor::~BookmarkEditor()
  • mythplugins/mythbrowser/mythbookmarkmanager/bookmarkmanager.cpp

    diff --git a/mythplugins/mythbrowser/mythbookmarkmanager/bookmarkmanager.cpp b/mythplugins/mythbrowser/mythbookmarkmanager/bookmarkmanager.cpp
    index 17d2c68..c1747f1 100644
    a b using namespace std; 
    2222// ---------------------------------------------------
    2323
    2424BrowserConfig::BrowserConfig(MythScreenStack *parent, const char *name)
    25                : MythScreenType(parent, name)
     25    : MythScreenType(parent, name),
     26      m_commandEdit(NULL),     m_zoomEdit(NULL),
     27      m_descriptionText(NULL), m_titleText(NULL),
     28      m_okButton(NULL),        m_cancelButton(NULL)
    2629{
    27     m_commandEdit = NULL;
    28     m_zoomEdit = NULL;
    29     m_descriptionText = NULL;
    30     m_okButton = NULL;
    31     m_cancelButton = NULL;
    3230}
    3331
    3432bool BrowserConfig::Create()
  • mythplugins/mythbrowser/mythbrowser/mythbrowser.cpp

    diff --git a/mythplugins/mythbrowser/mythbrowser/mythbrowser.cpp b/mythplugins/mythbrowser/mythbrowser/mythbrowser.cpp
    index 8cd066a..720bca1 100644
    a b using namespace std; 
    1919
    2020MythBrowser::MythBrowser (MythScreenStack *parent, const char *name,
    2121                  QStringList &urlList, float zoom)
    22        : MythScreenType (parent, name)
     22    : MythScreenType (parent, name),
     23      m_urlList(urlList),  m_pageList(NULL),
     24      m_progressBar(NULL), m_titleText(NULL),
     25      m_statusText(NULL),  m_currentBrowser(-1),
     26      m_zoom(zoom),        m_menuPopup(NULL)
    2327{
    24     m_currentBrowser = -1;
    25     m_zoom = zoom;
    26     m_urlList = urlList;
    27 
    28     m_menuPopup = NULL;
    2928}
    3029
    3130MythBrowser::~MythBrowser()