[Kde-games-devel] KDE/kdegames
Stefan Majewsky
majewsky at gmx.net
Fri Sep 17 20:32:52 CEST 2010
SVN commit 1176446 by majewsky:
Initialize KGameRenderer instances with default theme, not current theme.
To do so, export default theme setting from KConfigSkeleton class.
CCMAIL:kde-games-devel at kde.org
M +1 -1 bomber/src/bomberwidget.cpp
M +1 -0 bomber/src/settings.kcfgc
M +2 -1 kbreakout/src/mainwindow.cpp
M +2 -1 kbreakout/src/settings.kcfgc
M +1 -1 kdiamond/src/game.cpp
M +1 -0 kdiamond/src/settings.kcfgc
M +1 -0 kmines/kmines.kcfg
M +2 -1 kmines/scene.cpp
M +1 -0 kmines/settings.kcfgc
M +5 -1 knetwalk/src/scene.cpp
M +1 -0 knetwalk/src/settings.kcfgc
--- trunk/KDE/kdegames/bomber/src/bomberwidget.cpp #1176445:1176446
@@ -34,7 +34,7 @@
BomberGameWidget::BomberGameWidget(QWidget *parent) :
KGameCanvasWidget(parent), m_state(BeforeFirstGame), m_level(0),m_lives(0), m_time(0)
- , m_renderer("themes/kbomber.desktop")
+ , m_renderer(BomberSettings::defaultThemeValue())
{
m_renderer.setTheme(BomberSettings::theme());
--- trunk/KDE/kdegames/bomber/src/settings.kcfgc #1176445:1176446
@@ -3,4 +3,5 @@
ClassName=BomberSettings
Singleton=true
Mutators=true
+DefaultValueGetters=Theme
# will create the necessary code for setting those variables
--- trunk/KDE/kdegames/kbreakout/src/mainwindow.cpp #1176445:1176446
@@ -59,9 +59,10 @@
MainWindow::MainWindow(QWidget *parent)
: KXmlGuiWindow(parent),
- renderer(Settings::theme()),
+ renderer(Settings::defaultThemeValue()),
canvasWidget(new CanvasWidget(&renderer, this))
{
+ renderer.setTheme(Settings::theme());
// TODO: find a better way..
Item::setCanvas(canvasWidget);
Item::setRenderer(&renderer);
--- trunk/KDE/kdegames/kbreakout/src/settings.kcfgc #1176445:1176446
@@ -2,4 +2,5 @@
File=kbreakout.kcfg
ClassName=Settings
Singleton=true
-Mutators=true
\ No newline at end of file
+Mutators=true
+DefaultValueGetters=Theme
\ No newline at end of file
--- trunk/KDE/kdegames/kdiamond/src/game.cpp #1176445:1176446
@@ -37,7 +37,7 @@
class Renderer : public KGameRenderer
{
public:
- Renderer() : KGameRenderer("themes/default.desktop")
+ Renderer() : KGameRenderer(Settings::defaultThemeValue(), 10)
{
setFrameSuffix(QString::fromLatin1("-%1"));
setTheme(Settings::theme());
--- trunk/KDE/kdegames/kdiamond/src/settings.kcfgc #1176445:1176446
@@ -2,3 +2,4 @@
ClassName=Settings
Singleton=true
Mutators=true
+DefaultValueGetters=Theme
--- trunk/KDE/kdegames/kmines/kmines.kcfg #1176445:1176446
@@ -12,6 +12,7 @@
</entry>
<entry name="Theme" type="String" key="Theme">
<label>The graphical theme to be used.</label>
+ <default>themes/default.desktop</default>
</entry>
</group>
<group name="Options">
--- trunk/KDE/kdegames/kmines/scene.cpp #1176445:1176446
@@ -40,8 +40,9 @@
// -------------- KMinesScene --------------------
KMinesScene::KMinesScene( QObject* parent )
- : QGraphicsScene(parent), m_renderer(Settings::theme())
+ : QGraphicsScene(parent), m_renderer(Settings::defaultThemeValue())
{
+ m_renderer.setTheme(Settings::theme());
setItemIndexMethod( NoIndex );
m_fieldItem = new MineFieldItem(&m_renderer);
connect(m_fieldItem, SIGNAL(flaggedMinesCountChanged(int)), SIGNAL(minesCountChanged(int)));
--- trunk/KDE/kdegames/kmines/settings.kcfgc #1176445:1176446
@@ -3,3 +3,4 @@
ClassName=Settings
Singleton=true
Mutators=true
+DefaultValueGetters=Theme
--- trunk/KDE/kdegames/knetwalk/src/scene.cpp #1176445:1176446
@@ -26,7 +26,11 @@
#include <KMessageBox>
#include <KLocale>
-Renderer::Renderer() : KGameRenderer(Settings::theme()) {}
+Renderer::Renderer()
+ : KGameRenderer(Settings::defaultThemeValue())
+{
+ setTheme(Settings::theme());
+}
Renderer* Renderer::self()
{
--- trunk/KDE/kdegames/knetwalk/src/settings.kcfgc #1176445:1176446
@@ -3,3 +3,4 @@
ClassName=Settings
Singleton=true
Mutators=username,skill
+DefaultValueGetters=Theme
More information about the kde-games-devel
mailing list