Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
Bovo
Commits
1c1cb31b
Commit
1c1cb31b
authored
Jan 15, 2022
by
Laurent Montel
Browse files
For c++11 as random_shuffle is removed in c++17 freebsd
parent
90f360bb
Pipeline
#123682
passed with stage
in 44 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
1c1cb31b
...
...
@@ -44,7 +44,8 @@ kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
kde_enable_exceptions
()
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02)
add_definitions
(
-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055900
)
# Force c++11 as random_shuffle is removed in freebsd c++17
set
(
CMAKE_CXX_STANDARD 11
)
set
(
bovogame_SRCS
game/game.cc
...
...
game/game.cc
View file @
1c1cb31b
...
...
@@ -147,7 +147,7 @@ bool Game::save(const QString& filename) const {
QString
fileContent
;
fileContent
.
append
(
QStringLiteral
(
"<bovo width=
\"
%1
\"
height=
\"
%2
\"
>"
)
.
arg
(
QStringLiteral
(
""
)).
arg
(
QStringLiteral
(
""
)));
for
(
const
Move
&
move
:
std
::
as_c
onst
(
m_history
))
{
for
(
const
Move
&
move
:
qAsC
onst
(
m_history
))
{
fileContent
.
append
(
QStringLiteral
(
"<move player=
\"
%1
\"
x=
\"
%2
\"
y=
\"
%3
\"
/>"
).
arg
(
move
.
player
()).
arg
(
move
.
x
()).
arg
(
move
.
y
()));
}
...
...
@@ -157,7 +157,7 @@ bool Game::save(const QString& filename) const {
QStringList
Game
::
saveLast
()
const
{
QStringList
save
;
for
(
const
Move
&
move
:
std
::
as_c
onst
(
m_history
))
{
for
(
const
Move
&
move
:
qAsC
onst
(
m_history
))
{
save
<<
QStringLiteral
(
"%1:%2,%3"
).
arg
(
move
.
player
())
.
arg
(
move
.
x
()).
arg
(
move
.
y
());
}
...
...
@@ -180,7 +180,7 @@ void Game::start() {
void
Game
::
startRestored
()
{
connect
(
this
,
&
Game
::
boardChanged
,
m_ai
,
&
Ai
::
changeBoard
);
for
(
const
Move
&
move
:
std
::
as_c
onst
(
m_history
))
{
for
(
const
Move
&
move
:
qAsC
onst
(
m_history
))
{
Q_EMIT
boardChanged
(
move
);
}
connect
(
this
,
&
Game
::
oposerTurn
,
m_ai
,
&
Ai
::
slotMove
,
...
...
gui/mainwindow.cc
View file @
1c1cb31b
...
...
@@ -135,7 +135,7 @@ void MainWindow::setupThemes() {
}
int
i
=
0
;
for
(
const
QString
&
themerc
:
std
::
as_c
onst
(
themercs
))
{
for
(
const
QString
&
themerc
:
qAsC
onst
(
themercs
))
{
KConfig
config
(
themerc
);
KConfigGroup
configGroup
(
&
config
,
"Config"
);
const
QString
pathName
=
configGroup
.
readEntry
(
"Path"
,
QString
());
...
...
@@ -203,12 +203,12 @@ void MainWindow::setupActions() {
m_themeAct
=
new
KSelectAction
(
i18n
(
"Theme"
),
this
);
QStringList
themes
;
for
(
const
Theme
&
theme
:
std
::
as_c
onst
(
m_themes
))
{
for
(
const
Theme
&
theme
:
qAsC
onst
(
m_themes
))
{
themes
<<
theme
.
name
();
}
m_themeAct
->
setItems
(
themes
);
int
themeId
=
0
;
for
(
const
Theme
&
theme
:
std
::
as_c
onst
(
m_themes
))
{
for
(
const
Theme
&
theme
:
qAsC
onst
(
m_themes
))
{
if
(
theme
.
path
()
==
m_theme
.
path
())
{
themeId
=
theme
.
id
();
break
;
...
...
@@ -456,7 +456,7 @@ void MainWindow::changeSkill() {
}
void
MainWindow
::
changeTheme
(
int
themeId
)
{
for
(
const
Theme
&
theme
:
std
::
as_c
onst
(
m_themes
))
{
for
(
const
Theme
&
theme
:
qAsC
onst
(
m_themes
))
{
if
(
themeId
==
theme
.
id
())
{
m_theme
=
theme
;
m_scene
->
setTheme
(
m_theme
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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