Skip to content

Commit

Permalink
Small changes to MythUIImage::Load, ::Reset and ::Clear to keep non-a…
Browse files Browse the repository at this point in the history
…nimated

GIF from not being reloaded (and then from aborting the frontend).  This is an
edge case, but an important one as weather maps are coming in as GIF at this 
time (animated and non-animated).

This seems to work and not mess up other images.  Animated GIF do act oddly
after a reload, but they recover, so if we need to tweak something else to
fix them, so be it.



git-svn-id: http://svn.mythtv.org/svn/trunk@27302 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
Beirdo committed Nov 20, 2010
1 parent 58edeb1 commit 5b5e335
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions mythtv/libs/libmythui/mythuiimage.cpp
Expand Up @@ -210,6 +210,12 @@ void MythUIImage::Clear(void)
m_Images.remove(it.key());
}
m_Delays.clear();
if (m_animatedImage)
{
m_LowNum = 0;
m_HighNum = 0;
m_animatedImage = false;
}
}

/**
Expand All @@ -221,7 +227,12 @@ void MythUIImage::Reset(void)
if (m_Filename != m_OrigFilename)
{
m_Filename = m_OrigFilename;
m_animatedImage = false;
if (m_animatedImage)
{
m_LowNum = 0;
m_HighNum = 0;
m_animatedImage = false;
}
d->m_UpdateLock.unlock();
Load();
}
Expand Down Expand Up @@ -570,7 +581,8 @@ bool MythUIImage::Load(bool allowLoadInBackground, bool forceStat)
int j = 0;
for (int i = m_LowNum; i <= m_HighNum && !m_animatedImage; i++)
{
if (!m_animatedImage && m_HighNum >= 1)
if (!m_animatedImage && m_HighNum != m_LowNum &&
bFilename.contains("%1"))
filename = bFilename.arg(i);

imagelabel = GenImageLabel(filename, w, h);
Expand Down

0 comments on commit 5b5e335

Please sign in to comment.