[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegames/kmines
From:       Dmitry Suzdalev <dimsuz () gmail ! com>
Date:       2007-10-24 9:06:33
Message-ID: 1193216793.104030.19072.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 728800 by dimsuz:

Fix bug spotted by Fela - cache was not discarded when no kminesrc present. Now it is :)

 M  +12 -3     renderer.cpp  


--- trunk/KDE/kdegames/kmines/renderer.cpp #728799:728800
@@ -116,17 +116,25 @@
         kDebug() << "Notice: not loading the same theme";
         return true; // this is not an error
     }
+
+    m_currentTheme = themeName;
+
     KGameTheme theme;
-    if ( !theme.load( themeName ) )
+    if ( themeName.isEmpty() || !theme.load( themeName ) )
     {
         kDebug()<< "Failed to load theme" << Settings::theme();
         kDebug() << "Trying to load default";
         if(!theme.loadDefault())
             return false;
+        // in this case we need to discard any previously cached theme:
+        // we loading default
+        discardCache = true;
+        // set it to something - not be empty - so we
+        // do discard cache on next loadTheme
+        // (see discardCache above)
+        m_currentTheme = "default";
     }
 
-    m_currentTheme = themeName;
-
     bool res = m_renderer->load( theme.graphics() );
     kDebug() << "loading" << theme.graphics();
     if ( !res )
@@ -137,6 +145,7 @@
         kDebug() << "discarding cache";
         m_cache->discard();
     }
+
     return true;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic