Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Games
KsirK
Commits
f1932a69
Commit
f1932a69
authored
Jul 03, 2010
by
Stefan Majewsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring: Simplify unnecessarily complicated deletion statements.
svn path=/trunk/KDE/kdegames/ksirk/; revision=1145635
parent
d372db35
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
41 deletions
+8
-41
ksirk/Dialogs/newGameDialogImpl.cpp
ksirk/Dialogs/newGameDialogImpl.cpp
+1
-4
ksirk/GameLogic/gameautomaton.cpp
ksirk/GameLogic/gameautomaton.cpp
+2
-8
ksirk/kgamewinslots.cpp
ksirk/kgamewinslots.cpp
+1
-4
ksirkskineditor/onu.cpp
ksirkskineditor/onu.cpp
+4
-25
No files found.
ksirk/Dialogs/newGameDialogImpl.cpp
View file @
f1932a69
...
...
@@ -117,10 +117,7 @@ void NewGameWidget::fillSkinsCombo()
kDebug
()
<<
"Filling skins combo"
;
skinCombo
->
clear
();
foreach
(
GameLogic
::
ONU
*
onu
,
m_newGameSetup
->
worlds
())
{
delete
onu
;
}
qDeleteAll
(
m_newGameSetup
->
worlds
());
KStandardDirs
*
m_dirs
=
KGlobal
::
dirs
();
QStringList
skinsDirs
=
m_dirs
->
findDirs
(
"appdata"
,
"skins"
);
...
...
ksirk/GameLogic/gameautomaton.cpp
View file @
f1932a69
...
...
@@ -199,10 +199,7 @@ GameAutomaton::GameAutomaton() :
GameAutomaton
::~
GameAutomaton
()
{
kDebug
();
foreach
(
Goal
*
goal
,
m_goals
)
{
delete
goal
;
}
qDeleteAll
(
m_goals
);
}
void
GameAutomaton
::
init
(
KGameWindow
*
gw
)
...
...
@@ -2637,10 +2634,7 @@ void GameAutomaton::removeAllPlayers()
{
kDebug
();
m_currentPlayer
=
""
;
foreach
(
KPlayer
*
p
,
*
playerList
())
{
delete
p
;
}
qDeleteAll
(
*
playerList
());
playerList
()
->
clear
();
}
...
...
ksirk/kgamewinslots.cpp
View file @
f1932a69
...
...
@@ -1179,10 +1179,7 @@ void KGameWindow::slotNewPlayerCancel()
{
kDebug
();
/// @TODO other uninits to do
foreach
(
NewPlayerData
*
player
,
m_newGameSetup
->
players
())
{
delete
player
;
}
qDeleteAll
(
m_newGameSetup
->
players
());
m_newGameSetup
->
players
().
clear
();
m_centralWidget
->
setCurrentIndex
(
m_stackWidgetBeforeNewGame
);
}
...
...
ksirkskineditor/onu.cpp
View file @
f1932a69
...
...
@@ -384,31 +384,10 @@ ONU::ONU(const QString& configDir):
ONU
::~
ONU
()
{
QList
<
Country
*>::
iterator
countriesIt
,
countriesIt_end
;
countriesIt
=
m_countries
.
begin
();
countriesIt_end
=
m_countries
.
end
();
for
(;
countriesIt
!=
countriesIt_end
;
countriesIt
++
)
{
delete
*
countriesIt
;
}
QList
<
Nationality
*>::
iterator
nationalitiesIt
,
nationalitiesIt_end
;
nationalitiesIt
=
m_nationalities
.
begin
();
nationalitiesIt_end
=
m_nationalities
.
end
();
for
(;
nationalitiesIt
!=
nationalitiesIt_end
;
nationalitiesIt
++
)
{
delete
*
nationalitiesIt
;
}
QList
<
Continent
*>::
iterator
continentsIt
,
continentsIt_end
;
continentsIt
=
m_continents
.
begin
();
continentsIt_end
=
m_continents
.
end
();
for
(;
continentsIt
!=
continentsIt_end
;
continentsIt
++
)
{
delete
*
continentsIt
;
}
foreach
(
Goal
*
goal
,
m_goals
)
{
delete
goal
;
}
qDeleteAll
(
m_countries
);
qDeleteAll
(
m_nationalities
);
qDeleteAll
(
m_continents
);
qDeleteAll
(
m_goals
);
}
void
ONU
::
saveConfig
(
const
QString
&
configFileName
)
...
...
Write
Preview
Markdown
is supported
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