Skip to content
This repository
Browse code

Merge pull request #3287 from Montellese/skin_change

fix crash/freeze when changing skin after installing a new skin addon
  • Loading branch information...
commit 6510dfaf589c643d7c38e325a5253384497950b0 2 parents c23ec59 + 27aecf9
Martijn Kaijser authored September 22, 2013
9  xbmc/Application.cpp
@@ -1567,7 +1567,7 @@ void CApplication::OnSettingChanged(const CSetting *setting)
1567 1567
   if (settingId == "lookandfeel.skin" ||
1568 1568
       settingId == "lookandfeel.font" ||
1569 1569
       settingId == "lookandfeel.skincolors")
1570  
-    ReloadSkin();
  1570
+    CApplicationMessenger::Get().ExecBuiltIn("ReloadSkin");
1571 1571
   else if (settingId == "lookandfeel.skintheme")
1572 1572
   {
1573 1573
     // also set the default color theme
@@ -1582,7 +1582,7 @@ void CApplication::OnSettingChanged(const CSetting *setting)
1582 1582
     if (!StringUtils::EqualsNoCase(colorTheme, CSettings::Get().GetString("lookandfeel.skincolors")))
1583 1583
       CSettings::Get().SetString("lookandfeel.skincolors", colorTheme);
1584 1584
     else
1585  
-      ReloadSkin();
  1585
+      CApplicationMessenger::Get().ExecBuiltIn("ReloadSkin");
1586 1586
   }
1587 1587
   else if (settingId == "lookandfeel.skinzoom")
1588 1588
     g_windowManager.SendMessage(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_WINDOW_RESIZE);
@@ -1768,7 +1768,7 @@ void CApplication::LoadSkin(const SkinPtr& skin)
1768 1768
   if (!skin)
1769 1769
   {
1770 1770
     CLog::Log(LOGERROR, "failed to load requested skin, fallback to \"%s\" skin", defaultSkin.c_str());
1771  
-    CSettings::Get().SetString("lookandfeel.skin", defaultSkin);
  1771
+    CSettings::Get().GetSetting("lookandfeel.skin")->Reset();
1772 1772
     return ;
1773 1773
   }
1774 1774
 
@@ -1780,8 +1780,7 @@ void CApplication::LoadSkin(const SkinPtr& skin)
1780 1780
     if (strcmpi(skin->ID().c_str(), defaultSkin.c_str()) != 0)
1781 1781
     {
1782 1782
       CLog::Log(LOGERROR, "home.xml doesn't exist in skin: %s, fallback to \"%s\" skin", skin->ID().c_str(), defaultSkin.c_str());
1783  
-      CSettings::Get().SetString("lookandfeel.skin", defaultSkin);
1784  
-      LoadSkin(defaultSkin);
  1783
+      CSettings::Get().GetSetting("lookandfeel.skin")->Reset();
1785 1784
       CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Error, g_localizeStrings.Get(24102), g_localizeStrings.Get(24103));
1786 1785
       return ;
1787 1786
     }
3  xbmc/addons/AddonInstaller.cpp
@@ -698,14 +698,13 @@ void CAddonInstallJob::OnPostInstall(bool reloadAddon)
698 698
     if (reloadAddon || (!m_update && CGUIDialogYesNo::ShowAndGetInput(m_addon->Name(),
699 699
                                                         g_localizeStrings.Get(24099),"","")))
700 700
     {
701  
-      CSettings::Get().SetString("lookandfeel.skin",m_addon->ID().c_str());
702 701
       CGUIDialogKaiToast *toast = (CGUIDialogKaiToast *)g_windowManager.GetWindow(WINDOW_DIALOG_KAI_TOAST);
703 702
       if (toast)
704 703
       {
705 704
         toast->ResetTimer();
706 705
         toast->Close(true);
707 706
       }
708  
-      CApplicationMessenger::Get().ExecBuiltIn("ReloadSkin");
  707
+      CSettings::Get().SetString("lookandfeel.skin",m_addon->ID().c_str());
709 708
     }
710 709
   }
711 710
 

0 notes on commit 6510dfa

Please sign in to comment.
Something went wrong with that request. Please try again.