Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
lskat
Commits
18a081dd
Commit
18a081dd
authored
Nov 14, 2020
by
Friedrich W. H. Kossebau
Browse files
Use more nullptr
NO_CHANGELOG
parent
8711a8e7
Changes
14
Hide whitespace changes
Inline
Side-by-side
src/cardsprite.cpp
View file @
18a081dd
...
...
@@ -42,7 +42,7 @@
// Constructor for the view
CardSprite
::
CardSprite
(
const
Suite
suite
,
const
CardType
cardtype
,
ThemeManager
*
theme
,
int
advancePeriod
,
QGraphicsScene
*
scene
)
:
Themable
(
QStringLiteral
(
THEME_ID
),
theme
),
QGraphicsPixmapItem
(
0
)
:
Themable
(
QStringLiteral
(
THEME_ID
),
theme
),
QGraphicsPixmapItem
(
nullptr
)
{
scene
->
addItem
(
this
);
...
...
src/config_two.cpp
View file @
18a081dd
...
...
@@ -105,7 +105,7 @@ void ConfigTwo::load(KConfig *cfg)
// Retrieve a player.
Player
*
ConfigTwo
::
player
(
int
no
)
{
if
(
!
mPlayers
.
contains
(
no
))
return
0
;
if
(
!
mPlayers
.
contains
(
no
))
return
nullptr
;
return
mPlayers
[
no
];
}
...
...
src/display_two.cpp
View file @
18a081dd
...
...
@@ -304,7 +304,7 @@ CardSprite *DisplayTwo::getCardSprite(int cardValue)
{
qCCritical
(
LSKAT_LOG
)
<<
"Could not find cardsprite for card value"
<<
cardValue
<<
"Stored are"
<<
mCards
.
size
()
<<
"sprites"
;
return
0
;
return
nullptr
;
}
return
sprite
;
}
...
...
src/fromlibkdegames/cardcache.cpp
View file @
18a081dd
...
...
@@ -285,11 +285,11 @@ void LoadThread::run()
KCardCache
::
KCardCache
()
:
d
(
new
KCardCachePrivate
)
{
d
->
cache
=
0
;
d
->
cache
=
nullptr
;
d
->
cacheMutex
=
new
QMutex
();
d
->
rendererMutex
=
new
QMutex
();
d
->
svgRenderer
=
0
;
d
->
loadThread
=
0
;
d
->
svgRenderer
=
nullptr
;
d
->
loadThread
=
nullptr
;
}
KCardCache
::~
KCardCache
()
...
...
@@ -375,7 +375,7 @@ void KCardCache::setDeckName(const QString &theme)
{
QMutexLocker
l
(
d
->
rendererMutex
);
delete
d
->
svgRenderer
;
d
->
svgRenderer
=
0
;
d
->
svgRenderer
=
nullptr
;
}
d
->
deckName
=
theme
;
}
...
...
src/fromlibkdegames/kcarddialog.h
View file @
18a081dd
...
...
@@ -89,7 +89,7 @@ public:
*
* @param parent The parent widget of the widget, if any.
*/
explicit
KCardWidget
(
QWidget
*
parent
=
NULL
);
explicit
KCardWidget
(
QWidget
*
parent
=
nullptr
);
/**
* Read the settings from a config file
...
...
src/gameview.cpp
View file @
18a081dd
...
...
@@ -56,7 +56,7 @@ GameView::GameView(const QSize &size, int advancePeriod, QGraphicsScene *scene,
// Debug
mDisplayUpdateTime
=
0
;
mFrameSprite
=
new
QGraphicsTextItem
(
0
);
mFrameSprite
=
new
QGraphicsTextItem
(
nullptr
);
scene
->
addItem
(
mFrameSprite
);
mFrameSprite
->
setPos
(
QPointF
(
0.0
,
0.0
));
mFrameSprite
->
setZValue
(
1000.0
);
...
...
src/gameview.h
View file @
18a081dd
...
...
@@ -54,7 +54,7 @@ public:
* @param theme The theme manager
* @param parent The parent window
*/
GameView
(
const
QSize
&
size
,
int
advancePeriod
,
QGraphicsScene
*
scene
,
ThemeManager
*
theme
,
QWidget
*
parent
=
0
);
GameView
(
const
QSize
&
size
,
int
advancePeriod
,
QGraphicsScene
*
scene
,
ThemeManager
*
theme
,
QWidget
*
parent
=
nullptr
);
/**
* Destructor.
...
...
src/mainwindow.cpp
View file @
18a081dd
...
...
@@ -70,13 +70,13 @@ Mainwindow::Mainwindow(QWidget *parent)
:
KXmlGuiWindow
(
parent
)
{
// Reset stuff
mDeck
=
0
;
mEngine
=
0
;
mDisplay
=
0
;
mView
=
0
;
mLSkatConfig
=
0
;
mCanvas
=
0
;
mTheme
=
0
;
mDeck
=
nullptr
;
mEngine
=
nullptr
;
mDisplay
=
nullptr
;
mView
=
nullptr
;
mLSkatConfig
=
nullptr
;
mCanvas
=
nullptr
;
mTheme
=
nullptr
;
// Read theme files
QStringList
themeList
;
...
...
@@ -263,7 +263,7 @@ AbstractInput *Mainwindow::createInput(
AbstractDisplay
*
display
,
AbstractEngine
*
engine
)
{
AbstractInput
*
input
=
0
;
AbstractInput
*
input
=
nullptr
;
// Always use AI input in demo mode
if
(
global_demo_mode
)
...
...
@@ -620,7 +620,7 @@ void Mainwindow::setStartPlayer(int no)
// Set the input type for a given player number.
void
Mainwindow
::
setInputType
(
int
no
,
InputDeviceType
type
)
{
Player
*
p
=
0
;
Player
*
p
=
nullptr
;
// Player 1
if
(
no
==
0
)
{
...
...
src/mainwindow.h
View file @
18a081dd
...
...
@@ -65,7 +65,7 @@ public:
* Construct the main window.
* @param parent The parent widget
*/
explicit
Mainwindow
(
QWidget
*
parent
=
0
);
explicit
Mainwindow
(
QWidget
*
parent
=
nullptr
);
/**
* Destructor
...
...
src/pixmapsprite.cpp
View file @
18a081dd
...
...
@@ -33,7 +33,7 @@
// Constructor for the sprite
PixmapSprite
::
PixmapSprite
(
const
QString
&
id
,
ThemeManager
*
theme
,
int
advancePeriod
,
int
no
,
QGraphicsScene
*
canvas
)
:
Themable
(
id
,
theme
),
QGraphicsPixmapItem
(
0
)
:
Themable
(
id
,
theme
),
QGraphicsPixmapItem
(
nullptr
)
{
canvas
->
addItem
(
this
);
hide
();
...
...
@@ -49,7 +49,7 @@ PixmapSprite::PixmapSprite(const QString &id, ThemeManager *theme, int advancePe
// Constructor for the sprite
PixmapSprite
::
PixmapSprite
(
int
advancePeriod
,
int
no
,
QGraphicsScene
*
canvas
)
:
Themable
(),
QGraphicsPixmapItem
(
0
)
:
Themable
(),
QGraphicsPixmapItem
(
nullptr
)
{
canvas
->
addItem
(
this
);
hide
();
...
...
src/player.cpp
View file @
18a081dd
...
...
@@ -35,8 +35,8 @@ Player::Player(int id, QObject *parent)
mId
=
id
;
mCards
.
clear
();
mPoints
=
0
;
mDeck
=
0
;
mInput
=
0
;
mDeck
=
nullptr
;
mInput
=
nullptr
;
mTrump
=
Club
;
// Reset internal variables - they are set by 'load'
...
...
src/player.h
View file @
18a081dd
...
...
@@ -50,7 +50,7 @@ public:
* @param id The player number
* @param parent The parent object
*/
explicit
Player
(
int
id
,
QObject
*
parent
=
0
);
explicit
Player
(
int
id
,
QObject
*
parent
=
nullptr
);
/**
* Destructor
...
...
src/textsprite.cpp
View file @
18a081dd
...
...
@@ -29,7 +29,7 @@
// Constructor for the sprite
TextSprite
::
TextSprite
(
const
QString
&
text
,
const
QString
&
id
,
ThemeManager
*
theme
,
QGraphicsScene
*
scene
)
:
Themable
(
id
,
theme
),
QGraphicsTextItem
(
0
)
:
Themable
(
id
,
theme
),
QGraphicsTextItem
(
nullptr
)
{
scene
->
addItem
(
this
);
setPlainText
(
text
);
...
...
@@ -40,7 +40,7 @@ TextSprite::TextSprite(const QString &text, const QString &id, ThemeManager *the
// Constructor for the sprite
TextSprite
::
TextSprite
(
const
QString
&
id
,
ThemeManager
*
theme
,
QGraphicsScene
*
scene
)
:
Themable
(
id
,
theme
),
QGraphicsTextItem
(
0
)
:
Themable
(
id
,
theme
),
QGraphicsTextItem
(
nullptr
)
{
scene
->
addItem
(
this
);
hide
();
...
...
src/thememanager.cpp
View file @
18a081dd
...
...
@@ -98,7 +98,7 @@ KCardInfo convertToKCardInfo(CardDeck::Suite suite, CardDeck::CardType card)
// Constructor for the theme manager
ThemeManager
::
ThemeManager
(
const
QString
&
cardTheme
,
const
QString
&
themefile
,
QObject
*
parent
,
int
initialSize
)
:
QObject
(
parent
),
mRenderer
(
0
),
mConfig
(
0
),
mCardTheme
(
cardTheme
),
:
QObject
(
parent
),
mRenderer
(
nullptr
),
mConfig
(
nullptr
),
mCardTheme
(
cardTheme
),
mScale
(
initialSize
),
mAspectRatio
(
1.0
),
mCardAspectRatio
(
1.0
)
{
mCardCache
=
new
KCardCache
();
...
...
@@ -129,7 +129,7 @@ void ThemeManager::unregisterTheme(Themable *ob)
int
ThemeManager
::
checkTheme
()
{
// Check theme
if
(
mRenderer
==
0
)
return
1
;
if
(
mRenderer
==
nullptr
)
return
1
;
return
0
;
// OK
}
...
...
@@ -191,7 +191,7 @@ void ThemeManager::updateTheme(const QString &themefile)
bool
result
=
mRenderer
->
load
(
svgfile
);
if
(
!
result
)
{
mRenderer
=
0
;
mRenderer
=
nullptr
;
qCCritical
(
LSKAT_LOG
)
<<
"Cannot open file"
<<
svgfile
;
}
...
...
@@ -350,7 +350,7 @@ void ThemeManager::loadCardsInBackground()
Themable
::
Themable
()
{
mScale
=
1.0
;
mThemeManager
=
0
;
mThemeManager
=
nullptr
;
}
// Constructs a themable interface given its id and the master theme manager.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment