Commit 1c1cb31b authored by Laurent Montel's avatar 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
......@@ -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
......
......@@ -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_const(m_history)) {
for (const Move &move : qAsConst(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_const(m_history)) {
for (const Move &move : qAsConst(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_const(m_history)) {
for (const Move &move : qAsConst(m_history)) {
Q_EMIT boardChanged(move);
}
connect(this, &Game::oposerTurn, m_ai, &Ai::slotMove,
......
......@@ -135,7 +135,7 @@ void MainWindow::setupThemes() {
}
int i = 0;
for (const QString &themerc : std::as_const(themercs)) {
for (const QString &themerc : qAsConst(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_const(m_themes)) {
for (const Theme &theme : qAsConst(m_themes)) {
themes << theme.name();
}
m_themeAct->setItems(themes);
int themeId = 0;
for (const Theme &theme : std::as_const(m_themes)) {
for (const Theme &theme : qAsConst(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_const(m_themes)) {
for (const Theme &theme : qAsConst(m_themes)) {
if (themeId == theme.id()) {
m_theme = theme;
m_scene->setTheme(m_theme);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment