Skip to content

Commit

Permalink
tidy: Fix some class member naming. (libmythui/mythuitype)
Browse files Browse the repository at this point in the history
The clang-tidy "identifier naming" checker pointed out a few places
where class member function names don't use the convention of starting
with 'm_' and then using camelBack case for the rest of the variable
name.  Fix these for naming consistency across the code base.

https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html
  • Loading branch information
linuxdude42 committed Jul 27, 2020
1 parent 2a95cac commit 0a3a435
Show file tree
Hide file tree
Showing 18 changed files with 439 additions and 444 deletions.
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/captions/subtitlescreen.cpp
Expand Up @@ -1563,7 +1563,7 @@ int SubtitleScreen::GetDelay(void) const

void SubtitleScreen::Clear708Cache(uint64_t mask)
{
QList<MythUIType *> list = m_ChildrenList;
QList<MythUIType *> list = m_childrenList;
QList<MythUIType *>::iterator it;
for (it = list.begin(); it != list.end(); ++it)
{
Expand Down Expand Up @@ -1722,7 +1722,7 @@ void SubtitleScreen::Pulse(void)
long long now = currentFrame ? currentFrame->timecode : LLONG_MAX;
bool needRescale = (m_textFontZoom != m_textFontZoomPrev);

for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); it = itNext)
for (it = m_childrenList.begin(); it != m_childrenList.end(); it = itNext)
{
itNext = it + 1;
MythUIType *child = *it;
Expand Down Expand Up @@ -1796,7 +1796,7 @@ void SubtitleScreen::OptimiseDisplayedArea(void)
return;

QRegion visible;
QListIterator<MythUIType *> i(m_ChildrenList);
QListIterator<MythUIType *> i(m_childrenList);
while (i.hasNext())
{
MythUIType *img = i.next();
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/captions/teletextscreen.cpp
Expand Up @@ -117,7 +117,7 @@ void TeletextScreen::OptimiseDisplayedArea(void)
}

QRegion visible;
QListIterator<MythUIType *> i(m_ChildrenList);
QListIterator<MythUIType *> i(m_childrenList);
while (i.hasNext())
{
MythUIType *img = i.next();
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/mheg/interactivescreen.cpp
Expand Up @@ -16,7 +16,7 @@ void InteractiveScreen::Close(void)

void InteractiveScreen::UpdateArea(void)
{
if (m_ChildrenList.isEmpty())
if (m_childrenList.isEmpty())
{
m_safeArea = QRect();
}
Expand All @@ -34,7 +34,7 @@ void InteractiveScreen::OptimiseDisplayedArea(void)
UpdateArea();

QRegion visible;
QListIterator<MythUIType *> i(m_ChildrenList);
QListIterator<MythUIType *> i(m_childrenList);
while (i.hasNext())
{
MythUIType *img = i.next();
Expand Down
14 changes: 7 additions & 7 deletions mythtv/libs/libmythui/mythscreentype.cpp
Expand Up @@ -66,7 +66,7 @@ MythScreenType::MythScreenType(
m_screenStack = parent;

// Can be overridden, of course, but default to full sized.
m_Area = GetMythMainWindow()->GetUIScreenRect();
m_area = GetMythMainWindow()->GetUIScreenRect();

if (QCoreApplication::applicationName() == MYTH_APPNAME_MYTHFRONTEND)
gCoreContext->SendSystemEvent(
Expand All @@ -79,7 +79,7 @@ MythScreenType::MythScreenType(
{
m_fullScreen = fullscreen;

m_Area = GetMythMainWindow()->GetUIScreenRect();
m_area = GetMythMainWindow()->GetUIScreenRect();

if (QCoreApplication::applicationName() == MYTH_APPNAME_MYTHFRONTEND)
gCoreContext->SendSystemEvent(
Expand Down Expand Up @@ -261,7 +261,7 @@ void MythScreenType::aboutToShow(void)
// shown in front of this screen
QRegion region = GetMythMainWindow()->GetPaintWindow()->mask();
m_savedMask = region;
region = region.united(QRegion(m_Area));
region = region.united(QRegion(m_area));
GetMythMainWindow()->GetPaintWindow()->setMask(region);
}
}
Expand Down Expand Up @@ -504,8 +504,8 @@ bool MythScreenType::ParseElement(

SetArea(rectN);

m_fullScreen = (m_Area.width() >= screenArea.width() &&
m_Area.height() >= screenArea.height());
m_fullScreen = (m_area.width() >= screenArea.width() &&
m_area.height() >= screenArea.height());
}
else
{
Expand Down Expand Up @@ -550,8 +550,8 @@ void MythScreenType::CreateCopy(MythUIType * /*parent*/)

MythPainter* MythScreenType::GetPainter(void)
{
if (m_Painter)
return m_Painter;
if (m_painter)
return m_painter;
if (m_screenStack)
return MythScreenStack::GetPainter();
return GetMythPainter();
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythui/mythuibutton.cpp
Expand Up @@ -189,9 +189,9 @@ void MythUIButton::UnPush()

m_pushed = false;

if (m_HasFocus)
if (m_hasFocus)
SetState("selected");
else if (m_Enabled)
else if (m_enabled)
SetState("active");
else
SetState("disabled");
Expand All @@ -214,9 +214,9 @@ void MythUIButton::SetLocked(bool locked)
{
m_pushed = false;

if (m_HasFocus)
if (m_hasFocus)
SetState("selected");
else if (m_Enabled)
else if (m_enabled)
SetState("active");
else
SetState("disabled");
Expand Down
26 changes: 13 additions & 13 deletions mythtv/libs/libmythui/mythuibuttonlist.cpp
Expand Up @@ -43,9 +43,9 @@ MythUIButtonList::MythUIButtonList(MythUIType *parent, const QString &name,
m_showArrow(showArrow), m_showScrollBar(showScrollBar)
{
// Parent members
m_Area = area;
m_Initiator = true;
m_EnableInitiator = true;
m_area = area;
m_initiator = true;
m_enableInitiator = true;

connect(this, SIGNAL(Enabling()), this, SLOT(ToggleEnabled()));
connect(this, SIGNAL(Disabling()), this, SLOT(ToggleEnabled()));
Expand Down Expand Up @@ -1243,8 +1243,8 @@ bool MythUIButtonList::DistributeButtons(void)
else
m_topPosition = first_item;

m_Initiator = m_EnableInitiator;
if (m_MinSize.isValid())
m_initiator = m_enableInitiator;
if (m_minSize.isValid())
{
// Record the minimal area needed for the button list
SetMinArea(min_rect);
Expand Down Expand Up @@ -1630,7 +1630,7 @@ MythRect MythUIButtonList::GetButtonArea(void) const
{
if (m_contentsRect.isValid())
return m_contentsRect;
return m_Area;
return m_area;
}

MythUIButtonListItem *MythUIButtonList::GetItemFirst() const
Expand Down Expand Up @@ -2382,7 +2382,7 @@ void MythUIButtonList::Init()
if (m_scrollBar)
m_scrollBar->SetVisible(m_showScrollBar);

m_contentsRect.CalculateArea(m_Area);
m_contentsRect.CalculateArea(m_area);

m_buttontemplate = dynamic_cast<MythUIStateType *>(GetChild("buttonitem"));

Expand Down Expand Up @@ -2631,7 +2631,7 @@ bool MythUIButtonList::gestureEvent(MythGestureEvent *event)
{
// We want the relative position of the click
QPoint position = event->GetPosition() -
m_Parent->GetArea().topLeft();
m_parent->GetArea().topLeft();

MythUIType *type = GetChildAt(position, false, false);

Expand Down Expand Up @@ -2825,10 +2825,10 @@ void MythUIButtonList::SetButtonArea(const MythRect &rect)

m_contentsRect = rect;

if (m_Area.isValid())
m_contentsRect.CalculateArea(m_Area);
else if (m_Parent)
m_contentsRect.CalculateArea(m_Parent->GetFullArea());
if (m_area.isValid())
m_contentsRect.CalculateArea(m_area);
else if (m_parent)
m_contentsRect.CalculateArea(m_parent->GetFullArea());
else
m_contentsRect.CalculateArea(GetMythMainWindow()->GetUIScreenRect());
}
Expand Down Expand Up @@ -3043,7 +3043,7 @@ void MythUIButtonList::SetLCDTitles(const QString &title, const QString &columnL

void MythUIButtonList::updateLCD(void)
{
if (!m_HasFocus)
if (!m_hasFocus)
return;

LCD *lcddev = LCD::Get();
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythui/mythuibuttontree.cpp
Expand Up @@ -42,8 +42,8 @@ void MythUIButtonTree::Init()

m_listTemplate->SetVisible(false);

int width = (m_Area.width() - (m_listSpacing * (m_numLists - 1))) / m_numLists;
int height = m_Area.height();
int width = (m_area.width() - (m_listSpacing * (m_numLists - 1))) / m_numLists;
int height = m_area.height();

int i = 0;

Expand Down Expand Up @@ -628,7 +628,7 @@ bool MythUIButtonTree::gestureEvent(MythGestureEvent *event)
{
// We want the relative position of the click
QPoint position = event->GetPosition() -
m_Parent->GetArea().topLeft();
m_parent->GetArea().topLeft();

MythUIType *type = GetChildAt(position, false, false);

Expand Down
14 changes: 7 additions & 7 deletions mythtv/libs/libmythui/mythuiguidegrid.cpp
Expand Up @@ -335,7 +335,7 @@ void MythUIGuideGrid::drawCurrent(MythPainter *p, int xoffset, int yoffset, UIGT
{
int breakin = 2;
QRect area = data->m_drawArea;
area.translate(m_Area.x(), m_Area.y()); // Adjust within parent
area.translate(m_area.x(), m_area.y()); // Adjust within parent
area.translate(xoffset, yoffset); // Convert to global coordinates
area.adjust(breakin, breakin, -breakin, -breakin);
int status = data->m_recStat;
Expand Down Expand Up @@ -405,7 +405,7 @@ void MythUIGuideGrid::drawRecDecoration(MythPainter *p, int xoffset, int yoffset
{
int breakin = 1;
QRect area = data->m_drawArea;
area.translate(m_Area.x(), m_Area.y()); // Adjust within parent
area.translate(m_area.x(), m_area.y()); // Adjust within parent
area.translate(xoffset, yoffset); // Convert to global coordinates
area.adjust(breakin, breakin, -breakin, -breakin);

Expand Down Expand Up @@ -494,7 +494,7 @@ void MythUIGuideGrid::drawBox(MythPainter *p, int xoffset, int yoffset, UIGTCon
{
int breakin = 1;
QRect area = data->m_drawArea;
area.translate(m_Area.x(), m_Area.y()); // Adjust within parent
area.translate(m_area.x(), m_area.y()); // Adjust within parent
area.translate(xoffset, yoffset); // Convert to global coordinates
area.adjust(breakin, breakin, -breakin, -breakin);

Expand Down Expand Up @@ -527,7 +527,7 @@ void MythUIGuideGrid::drawBackground(MythPainter *p, int xoffset, int yoffset, U

int breakin = 1;
QRect area = data->m_drawArea;
area.translate(m_Area.x(), m_Area.y()); // Adjust within parent
area.translate(m_area.x(), m_area.y()); // Adjust within parent
QColor fillColor;

if (m_drawCategoryColors && data->m_categoryColor.isValid())
Expand Down Expand Up @@ -629,7 +629,7 @@ void MythUIGuideGrid::drawText(MythPainter *p, int xoffset, int yoffset, UIGTCon
msg += QString(" (%1)").arg(data->m_category);

QRect area = data->m_drawArea;
area.translate(m_Area.x(), m_Area.y()); // Adjust within parent
area.translate(m_area.x(), m_area.y()); // Adjust within parent
area.translate(xoffset, yoffset); // Convert to global coordinates
area.adjust(m_textOffset.x(), m_textOffset.y(),
-m_textOffset.x(), -m_textOffset.y());
Expand Down Expand Up @@ -807,9 +807,9 @@ void MythUIGuideGrid::ResetRow(int row)
void MythUIGuideGrid::SetProgPast(int ppast)
{
if (m_verticalLayout)
m_progPastCol = m_Area.y() + (m_Area.height() * ppast / 100);
m_progPastCol = m_area.y() + (m_area.height() * ppast / 100);
else
m_progPastCol = m_Area.x() + (m_Area.width() * ppast / 100);
m_progPastCol = m_area.x() + (m_area.width() * ppast / 100);

SetRedraw();
}
Expand Down
20 changes: 10 additions & 10 deletions mythtv/libs/libmythui/mythuiimage.cpp
Expand Up @@ -562,7 +562,7 @@ MythUIImage::MythUIImage(const QString &filepattern,
m_HighNum = high;

m_Delay = delayms;
m_EnableInitiator = true;
m_enableInitiator = true;

d = new MythUIImagePrivate(this);
emit DependChanged(false);
Expand All @@ -578,7 +578,7 @@ MythUIImage::MythUIImage(const QString &filename, MythUIType *parent,
m_LowNum = 0;
m_HighNum = 0;
m_Delay = -1;
m_EnableInitiator = true;
m_enableInitiator = true;

d = new MythUIImagePrivate(this);
emit DependChanged(false);
Expand All @@ -590,7 +590,7 @@ MythUIImage::MythUIImage(MythUIType *parent, const QString &name)
m_LowNum = 0;
m_HighNum = 0;
m_Delay = -1;
m_EnableInitiator = true;
m_enableInitiator = true;

d = new MythUIImagePrivate(this);
}
Expand Down Expand Up @@ -795,7 +795,7 @@ void MythUIImage::SetImage(MythImage *img)
m_ImagesLock.unlock();

m_CurPos = 0;
m_Initiator = m_EnableInitiator;
m_initiator = m_enableInitiator;
SetRedraw();

d->m_updateLock.unlock();
Expand Down Expand Up @@ -868,7 +868,7 @@ void MythUIImage::SetImages(QVector<MythImage *> *images)

m_CurPos = 0;
m_animatedImage = true;
m_Initiator = m_EnableInitiator;
m_initiator = m_enableInitiator;
SetRedraw();
}

Expand Down Expand Up @@ -968,7 +968,7 @@ bool MythUIImage::Load(bool allowLoadInBackground, bool forceStat)
{
d->m_updateLock.lockForRead();

m_Initiator = m_EnableInitiator;
m_initiator = m_enableInitiator;

QString bFilename = m_imageProperties.m_filename;

Expand Down Expand Up @@ -1255,7 +1255,7 @@ void MythUIImage::DrawSelf(MythPainter *p, int xoffset, int yoffset,
// Centre image in available space, accounting for zoom
int x = 0;
int y = 0;
QRect visibleImage = m_Effects.GetExtent(currentImageArea.size());
QRect visibleImage = m_effects.GetExtent(currentImageArea.size());

if (area.width() > visibleImage.width())
x = area.width() / 2 + visibleImage.topLeft().x();
Expand Down Expand Up @@ -1326,7 +1326,7 @@ bool MythUIImage::ParseElement(
else if (element.tagName() == "area")
{
SetArea(parseRect(element));
m_imageProperties.m_forceSize = m_Area.size();
m_imageProperties.m_forceSize = m_area.size();
}
else if (element.tagName() == "preserveaspect")
m_imageProperties.m_preserveAspect = parseBool(element);
Expand Down Expand Up @@ -1416,7 +1416,7 @@ bool MythUIImage::ParseElement(

m_NeedLoad = true;

if (m_Parent && m_Parent->IsDeferredLoading(true))
if (m_parent && m_parent->IsDeferredLoading(true))
m_NeedLoad = false;

return true;
Expand Down Expand Up @@ -1461,7 +1461,7 @@ void MythUIImage::CopyFrom(MythUIType *base)
// We need to update forceSize in case the parent area has changed
// however we only want to set forceSize if it was previously in use
if (!m_imageProperties.m_forceSize.isNull())
m_imageProperties.m_forceSize = m_Area.size();
m_imageProperties.m_forceSize = m_area.size();

m_NeedLoad = im->m_NeedLoad;

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythui/mythuiprogressbar.cpp
Expand Up @@ -185,7 +185,7 @@ void MythUIProgressBar::CreateCopy(MythUIType *parent)

void MythUIProgressBar::SetVisible(bool visible)
{
if (m_firstdepend || visible != m_Visible)
if (m_firstdepend || visible != m_visible)
{
emit DependChanged(!visible);
m_firstdepend = false;
Expand Down

0 comments on commit 0a3a435

Please sign in to comment.