Attempts to fix defects associated to initialization of
From: Erik Hovland <erik@hovland.org>
member variables in ctors
---
mythtv/libs/libmythui/jsmenu.cpp | 12 +++---
mythtv/libs/libmythui/lirc.cpp | 8 ++--
mythtv/libs/libmythui/mythgenerictree.cpp | 25 +++++--------
mythtv/libs/libmythui/mythgenerictree.h | 2 +
mythtv/libs/libmythui/mythuiprogressbar.cpp | 14 ++-----
mythtv/libs/libmythui/mythuiprogressbar.h | 2 +
mythtv/libs/libmythui/mythuitext.cpp | 52 +++++++++++++--------------
mythtv/libs/libmythui/mythuiwebbrowser.cpp | 20 +++++-----
8 files changed, 60 insertions(+), 75 deletions(-)
diff --git a/mythtv/libs/libmythui/jsmenu.cpp b/mythtv/libs/libmythui/jsmenu.cpp
index c6c29fc..b351ac9 100644
|
a
|
b
|
using namespace std;
|
| 51 | 51 | ** JoystickMenuThread Constructor |
| 52 | 52 | **--------------------------------------------------------------------------*/ |
| 53 | 53 | JoystickMenuThread::JoystickMenuThread(QObject *main_window) |
| 54 | | : QThread() |
| | 54 | : QThread(), |
| | 55 | mainWindow(main_window), devicename(""), |
| | 56 | fd(-1), button_count(0), |
| | 57 | axes_count(0), buttons(NULL), |
| | 58 | axes(NULL), bStop(false) |
| 55 | 59 | { |
| 56 | | mainWindow = main_window; |
| 57 | | |
| 58 | | fd = -1; |
| 59 | | axes = NULL; |
| 60 | | buttons = NULL; |
| 61 | | bStop = false; |
| 62 | 60 | } |
| 63 | 61 | |
| 64 | 62 | /*---------------------------------------------------------------------------- |
diff --git a/mythtv/libs/libmythui/lirc.cpp b/mythtv/libs/libmythui/lirc.cpp
index 11ac95f..fd40a64 100644
|
a
|
b
|
|
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | LircThread::LircThread(QObject *main_window) |
| 27 | | : QThread() |
| | 27 | : QThread(), |
| | 28 | lircConfig(NULL), mainWindow(main_window), |
| | 29 | bStop(false), fd(-1), |
| | 30 | external_app("") |
| 28 | 31 | { |
| 29 | | mainWindow = main_window; |
| 30 | | bStop = false; |
| 31 | | lircConfig = NULL; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | int LircThread::Init(const QString &config_file, const QString &program, |
diff --git a/mythtv/libs/libmythui/mythgenerictree.cpp b/mythtv/libs/libmythui/mythgenerictree.cpp
index c8dc997..d53138c 100644
|
a
|
b
|
class SortableMythGenericTreeList : public QList<MythGenericTree*>
|
| 99 | 99 | }; |
| 100 | 100 | |
| 101 | 101 | /////////////////////////////////////////////////////// |
| | 102 | // Use 6 here, because we know that's what mythmusic wants (limits resizing) |
| | 103 | const unsigned int MythGenericTree::kDefaultVectorSize = 6; |
| 102 | 104 | |
| 103 | 105 | MythGenericTree::MythGenericTree(const QString &a_string, int an_int, |
| 104 | | bool selectable_flag) |
| | 106 | bool selectable_flag) |
| | 107 | : m_string(a_string), m_int(an_int), |
| | 108 | m_subnodes(new SortableMythGenericTreeList), |
| | 109 | m_ordered_subnodes(new SortableMythGenericTreeList), |
| | 110 | m_flatenedSubnodes(new SortableMythGenericTreeList), |
| | 111 | m_selected_subnode(NULL), m_attributes(new IntVector(kDefaultVectorSize)), |
| | 112 | m_parent(NULL), m_selectable(selectable_flag), |
| | 113 | m_visible(false), m_currentOrderingIndex(-1) |
| 105 | 114 | { |
| 106 | | m_subnodes = new SortableMythGenericTreeList; |
| 107 | | m_ordered_subnodes = new SortableMythGenericTreeList; |
| 108 | | m_flatenedSubnodes = new SortableMythGenericTreeList; |
| 109 | | |
| 110 | | m_parent = NULL; |
| 111 | | m_selected_subnode = NULL; |
| 112 | | m_currentOrderingIndex = -1; |
| 113 | | |
| 114 | | // Use 6 here, because we know that's what mythmusic wants (limits resizing) |
| 115 | | m_attributes = new IntVector(6); |
| 116 | | |
| 117 | | m_string = a_string; |
| 118 | | m_int = an_int; |
| 119 | | m_selectable = selectable_flag; |
| 120 | 115 | } |
| 121 | 116 | |
| 122 | 117 | MythGenericTree::~MythGenericTree() |
diff --git a/mythtv/libs/libmythui/mythgenerictree.h b/mythtv/libs/libmythui/mythgenerictree.h
index a539fe0..f2bcc89 100644
|
a
|
b
|
class MPUBLIC MythGenericTree
|
| 101 | 101 | private: |
| 102 | 102 | void reorderSubnodes(void); |
| 103 | 103 | |
| | 104 | static const unsigned int kDefaultVectorSize; |
| | 105 | |
| 104 | 106 | QString m_string; |
| 105 | 107 | int m_int; |
| 106 | 108 | QVariant m_data; |
diff --git a/mythtv/libs/libmythui/mythuiprogressbar.cpp b/mythtv/libs/libmythui/mythuiprogressbar.cpp
index 5716c01..6c98ffa 100644
|
a
|
b
|
|
| 10 | 10 | #include "mythuiprogressbar.h" |
| 11 | 11 | |
| 12 | 12 | MythUIProgressBar::MythUIProgressBar(MythUIType *parent, const QString &name) |
| 13 | | : MythUIType(parent, name) |
| | 13 | : MythUIType(parent, name), |
| | 14 | m_layout(LayoutHorizontal), m_effect(EffectReveal), |
| | 15 | m_initialized(false), m_total(0), |
| | 16 | m_start(0), m_current(0) |
| 14 | 17 | { |
| 15 | | m_layout = LayoutHorizontal; |
| 16 | | m_effect = EffectReveal; |
| 17 | | |
| 18 | | m_total = m_start = m_current = 0; |
| 19 | | } |
| 20 | | |
| 21 | | MythUIProgressBar::~MythUIProgressBar() |
| 22 | | { |
| 23 | | |
| 24 | 18 | } |
| 25 | 19 | |
| 26 | 20 | bool MythUIProgressBar::ParseElement(QDomElement &element) |
diff --git a/mythtv/libs/libmythui/mythuiprogressbar.h b/mythtv/libs/libmythui/mythuiprogressbar.h
index b50c37f..66e3686 100644
|
a
|
b
|
class MythUIProgressBar : public MythUIType
|
| 15 | 15 | { |
| 16 | 16 | public: |
| 17 | 17 | MythUIProgressBar(MythUIType *parent, const QString &name); |
| 18 | | ~MythUIProgressBar(); |
| | 18 | ~MythUIProgressBar() { } |
| 19 | 19 | |
| 20 | 20 | enum LayoutType { LayoutVertical, LayoutHorizontal }; |
| 21 | 21 | enum EffectType { EffectReveal, EffectSlide, EffectAnimate }; |
diff --git a/mythtv/libs/libmythui/mythuitext.cpp b/mythtv/libs/libmythui/mythuitext.cpp
index ed479ed..b177f9e 100644
|
a
|
b
|
|
| 12 | 12 | #include "compat.h" |
| 13 | 13 | |
| 14 | 14 | MythUIText::MythUIText(MythUIType *parent, const QString &name) |
| 15 | | : MythUIType(parent, name) |
| | 15 | : MythUIType(parent, name), |
| | 16 | m_Justification(Qt::AlignLeft | Qt::AlignTop), m_OrigDisplayRect(), |
| | 17 | m_AltDisplayRect(), m_drawRect(), |
| | 18 | m_Message(""), m_CutMessage(""), |
| | 19 | m_DefaultMessage(""), m_Cutdown(true), |
| | 20 | m_Font(new MythFontProperties()), m_colorCycling(false), |
| | 21 | m_startColor(), m_endColor(), |
| | 22 | m_numSteps(0), m_curStep(0), |
| | 23 | curR(0.0), curG(0.0), curB(0.0), |
| | 24 | incR(0.0), incG(0.0), incB(0.0) |
| 16 | 25 | { |
| 17 | | m_Message = m_DefaultMessage = ""; |
| 18 | | |
| 19 | | m_Font = new MythFontProperties(); |
| 20 | | |
| 21 | | m_OrigDisplayRect = m_AltDisplayRect = m_Area = m_drawRect = MythRect(); |
| 22 | | |
| 23 | | m_Cutdown = true; |
| 24 | | m_CutMessage = ""; |
| 25 | | |
| 26 | | m_Justification = (Qt::AlignLeft | Qt::AlignTop); |
| 27 | | |
| 28 | | m_colorCycling = false; |
| | 26 | // This is a part of a parent object (it should be set in that ctor) |
| | 27 | m_Area = MythRect(); |
| 29 | 28 | } |
| 30 | 29 | |
| 31 | 30 | MythUIText::MythUIText(const QString &text, const MythFontProperties &font, |
| 32 | 31 | QRect displayRect, QRect altDisplayRect, |
| 33 | 32 | MythUIType *parent, const QString &name) |
| 34 | | : MythUIType(parent, name) |
| | 33 | : MythUIType(parent, name), |
| | 34 | m_Justification(Qt::AlignLeft | Qt::AlignTop), |
| | 35 | m_OrigDisplayRect(displayRect), m_AltDisplayRect(altDisplayRect), |
| | 36 | m_drawRect(displayRect), m_Message(text), |
| | 37 | m_CutMessage(""), m_DefaultMessage(text), |
| | 38 | m_Cutdown(true), m_Font(new MythFontProperties()), |
| | 39 | m_colorCycling(false), m_startColor(), |
| | 40 | m_endColor(), m_numSteps(0), |
| | 41 | m_curStep(0), |
| | 42 | curR(0.0), curG(0.0), curB(0.0), |
| | 43 | incR(0.0), incG(0.0), incB(0.0) |
| 35 | 44 | { |
| 36 | | m_Message = text; |
| 37 | | m_DefaultMessage = text; |
| 38 | | |
| 39 | | m_Font = new MythFontProperties(); |
| 40 | 45 | *m_Font = font; |
| 41 | | |
| 42 | | m_OrigDisplayRect = m_Area = m_drawRect = displayRect; |
| 43 | | m_AltDisplayRect = altDisplayRect; |
| 44 | | |
| 45 | | m_Cutdown = true; |
| 46 | | m_CutMessage = ""; |
| 47 | | m_Justification = (Qt::AlignLeft | Qt::AlignTop); |
| 48 | | |
| 49 | | m_colorCycling = false; |
| | 46 | // This is a part of a parent object (it should be set in that ctor) |
| | 47 | m_Area = displayRect; |
| 50 | 48 | } |
| 51 | 49 | |
| 52 | 50 | MythUIText::~MythUIText() |
diff --git a/mythtv/libs/libmythui/mythuiwebbrowser.cpp b/mythtv/libs/libmythui/mythuiwebbrowser.cpp
index a952b0c..8e5912d 100644
|
a
|
b
|
void MythWebView::handleUnsupportedContent(QNetworkReply *reply)
|
| 147 | 147 | * \param name the name of this widget |
| 148 | 148 | */ |
| 149 | 149 | MythUIWebBrowser::MythUIWebBrowser(MythUIType *parent, const QString &name) |
| 150 | | : MythUIType(parent, name) |
| | 150 | : MythUIType(parent, name), |
| | 151 | #ifdef USING_QTWEBKIT |
| | 152 | m_browser(NULL), |
| | 153 | #endif |
| | 154 | m_image(NULL), m_active(false), |
| | 155 | m_initialized(false), m_zoom(1.0), |
| | 156 | m_bgColor("White"), m_inputToggled(false), |
| | 157 | m_lastMouseAction(""), m_mouseKeyCount(0), |
| | 158 | m_lastMouseActionTime() |
| 151 | 159 | { |
| 152 | | m_zoom = 1.0; |
| 153 | | m_bgColor = QColor("white"); |
| 154 | | m_image = NULL; |
| 155 | | m_browser = NULL; |
| 156 | | |
| 157 | | m_initialized = false; |
| 158 | | m_active = false; |
| 159 | | m_inputToggled = false; |
| 160 | | |
| 161 | 160 | SetCanTakeFocus(true); |
| 162 | 161 | } |
| 163 | 162 | |
| 164 | 163 | void MythUIWebBrowser::Finalize(void) |
| 165 | 164 | { |
| 166 | 165 | Init(); |
| 167 | | |
| 168 | 166 | MythUIType::Finalize(); |
| 169 | 167 | } |
| 170 | 168 | |