Skip to content

Commit

Permalink
If the downloadable themes cache dir doesn't exist, force redownload.
Browse files Browse the repository at this point in the history
This should fix an issue with the Theme Chooser sometimes showing
only locally installed themes by default forcing the user to manually
refresh the downloadable themes list via the popup menu.  If the
downloadable themes cache dir does not exist, we trigger a download
attempt automatically when entering the Theme Chooser.
  • Loading branch information
cpinkham committed Mar 10, 2012
1 parent 5201fb9 commit c114dd5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mythtv/programs/mythfrontend/themechooser.cpp
Expand Up @@ -195,6 +195,8 @@ void ThemeChooser::Load(void)
QString themeSite = QString("%1/%2")
.arg(gCoreContext->GetSetting("ThemeRepositoryURL",
"http://themes.mythtv.org/themes/repository")).arg(MythVersion);
QDir remoteThemesDir(GetMythUI()->GetThemeCacheDir()
.append("/themechooser/").append(MythVersion));

int downloadFailures =
gCoreContext->GetNumSetting("ThemeInfoDownloadFailures", 0);
Expand All @@ -208,6 +210,9 @@ void ThemeChooser::Load(void)
"remote theme list download").arg(remoteThemesFile));
m_refreshDownloadableThemes = true;
}

if (!remoteThemesDir.exists())
m_refreshDownloadableThemes = true;
}
else if (downloadFailures < 2) // (and themes.zip does not exist)
{
Expand Down Expand Up @@ -243,9 +248,6 @@ void ThemeChooser::Load(void)
}
}

QDir remoteThemesDir(GetMythUI()->GetThemeCacheDir()
.append("/themechooser/").append(MythVersion));

if ((QFile::exists(remoteThemesFile)) &&
(remoteThemesDir.exists()))
{
Expand Down

0 comments on commit c114dd5

Please sign in to comment.