• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

KShisen

  • sources
  • kde-4.14
  • kdegames
  • kshisen
  • src
prefs.cpp
Go to the documentation of this file.
1 // This file is generated by kconfig_compiler from kshisen.kcfg.
2 // All changes you do to this file will be lost.
3 
4 #include "prefs.h"
5 
6 #include <kglobal.h>
7 #include <QtCore/QFile>
8 
9 class PrefsHelper
10 {
11  public:
12  PrefsHelper() : q(0) {}
13  ~PrefsHelper() { delete q; }
14  Prefs *q;
15 };
16 K_GLOBAL_STATIC(PrefsHelper, s_globalPrefs)
17 Prefs *Prefs::self()
18 {
19  if (!s_globalPrefs->q) {
20  new Prefs;
21  s_globalPrefs->q->readConfig();
22  }
23 
24  return s_globalPrefs->q;
25 }
26 
27 Prefs::Prefs( )
28  : KConfigSkeleton( QLatin1String( "kshisenrc" ) )
29 {
30  Q_ASSERT(!s_globalPrefs->q);
31  s_globalPrefs->q = this;
32  setCurrentGroup( QLatin1String( "General" ) );
33 
34  KConfigSkeleton::ItemString *itemTileSet;
35  itemTileSet = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Tileset_file" ), mTileSet );
36  addItem( itemTileSet, QLatin1String( "TileSet" ) );
37  KConfigSkeleton::ItemString *itemBackground;
38  itemBackground = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Background_file" ), mBackground );
39  addItem( itemBackground, QLatin1String( "Background" ) );
40 
41  setCurrentGroup( QLatin1String( "Game" ) );
42 
43  KConfigSkeleton::ItemBool *itemChineseStyle;
44  itemChineseStyle = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ChineseStyle" ), mChineseStyle, false );
45  addItem( itemChineseStyle, QLatin1String( "ChineseStyle" ) );
46  KConfigSkeleton::ItemBool *itemTilesCanSlide;
47  itemTilesCanSlide = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "TilesCanSlide" ), mTilesCanSlide, false );
48  addItem( itemTilesCanSlide, QLatin1String( "TilesCanSlide" ) );
49  KConfigSkeleton::ItemBool *itemSolvable;
50  itemSolvable = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "Solvable" ), mSolvable, false );
51  addItem( itemSolvable, QLatin1String( "Solvable" ) );
52  KConfigSkeleton::ItemBool *itemGravity;
53  itemGravity = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "Gravity" ), mGravity, true );
54  addItem( itemGravity, QLatin1String( "Gravity" ) );
55  KConfigSkeleton::ItemBool *itemSounds;
56  itemSounds = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "Sounds" ), mSounds, true );
57  addItem( itemSounds, QLatin1String( "Sounds" ) );
58  KConfigSkeleton::ItemInt *itemSpeed;
59  itemSpeed = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Speed" ), mSpeed, 2 );
60  itemSpeed->setMinValue(0);
61  itemSpeed->setMaxValue(4);
62  addItem( itemSpeed, QLatin1String( "Speed" ) );
63  KConfigSkeleton::ItemInt *itemSize;
64  itemSize = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Size" ), mSize, 2 );
65  itemSize->setMinValue(0);
66  itemSize->setMaxValue(5);
67  addItem( itemSize, QLatin1String( "Size" ) );
68  KConfigSkeleton::ItemInt *itemLevel;
69  itemLevel = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Level" ), mLevel, 1 );
70  itemLevel->setMinValue(0);
71  itemLevel->setMaxValue(2);
72  addItem( itemLevel, QLatin1String( "Level" ) );
73 }
74 
75 Prefs::~Prefs()
76 {
77  if (!s_globalPrefs.isDestroyed()) {
78  s_globalPrefs->q = 0;
79  }
80 }
81 
Prefs::mChineseStyle
bool mChineseStyle
Definition: prefs.h:252
Prefs
Definition: prefs.h:9
prefs.h
KConfigSkeleton
Prefs::mBackground
QString mBackground
Definition: prefs.h:249
Prefs::mSolvable
bool mSolvable
Definition: prefs.h:254
Prefs::mSpeed
int mSpeed
Definition: prefs.h:257
Prefs::mLevel
int mLevel
Definition: prefs.h:259
Prefs::mSounds
bool mSounds
Definition: prefs.h:256
Prefs::mGravity
bool mGravity
Definition: prefs.h:255
Prefs::Prefs
Prefs()
Definition: prefs.cpp:27
QLatin1String
Prefs::~Prefs
~Prefs()
Definition: prefs.cpp:75
Prefs::mTileSet
QString mTileSet
Definition: prefs.h:248
Prefs::mTilesCanSlide
bool mTilesCanSlide
Definition: prefs.h:253
Prefs::mSize
int mSize
Definition: prefs.h:258
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KShisen

Skip menu "KShisen"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal