diff -Nru kbreakout-14.12.3/CMakeLists.txt kbreakout-15.04.2/CMakeLists.txt --- kbreakout-14.12.3/CMakeLists.txt 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/CMakeLists.txt 2015-04-14 05:28:15.000000000 +0000 @@ -1,21 +1,44 @@ project( kbreakout ) -if(NOT COMPILING_KDEGAMES) - find_package(KDE4 REQUIRED) - include(KDE4Defaults) - include(MacroLibrary) - find_package(KDEGames 4.9.0 REQUIRED) - - add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) - add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) - include_directories(${KDEGAMES_INCLUDE_DIRS} ${KDE4_INCLUDES} ${QDBUS_INCLUDE_DIRS}) -endif(NOT COMPILING_KDEGAMES) +cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR) +set (QT_MIN_VERSION "5.3.0") -find_package(KDeclarative REQUIRED) +find_package(ECM 1.3.0 REQUIRED CONFIG) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) + +find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Qml Quick QuickWidgets Svg) +find_package(KF5 REQUIRED COMPONENTS + CoreAddons + Config + WidgetsAddons + Config + DBusAddons + I18n + GuiAddons + Service + ConfigWidgets + IconThemes + Completion + JobWidgets + XmlGui + KIO) + +find_package(KF5KDEGames 4.9.0 REQUIRED) + +include(FeatureSummary) +include(ECMInstallIcons) +include(KDEInstallDirs) +include(KDECompilerSettings) +include(KDECMakeSettings) + +add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) +add_definitions(-DTRANSLATION_DOMAIN="kbreakout") +add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII") add_subdirectory( src ) add_subdirectory( pics ) add_subdirectory( themes ) add_subdirectory( levelsets ) add_subdirectory(doc) -install( PROGRAMS kbreakout.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) +install( PROGRAMS org.kde.kbreakout.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -Nru kbreakout-14.12.3/debian/changelog kbreakout-15.04.2/debian/changelog --- kbreakout-14.12.3/debian/changelog 2015-03-13 20:50:30.000000000 +0000 +++ kbreakout-15.04.2/debian/changelog 2015-06-09 16:40:06.000000000 +0000 @@ -1,3 +1,15 @@ +kbreakout (4:15.04.2-0ubuntu1) wily; urgency=medium + + [ Scarlett Clark ] + * New upstream release + * New upstream release + * Vivid backport + + [ Jonathan Riddell ] + * New upstream release + + -- Jonathan Riddell Tue, 09 Jun 2015 18:40:06 +0200 + kbreakout (4:14.12.3-0ubuntu1) vivid; urgency=medium * New upstream release diff -Nru kbreakout-14.12.3/debian/control kbreakout-15.04.2/debian/control --- kbreakout-14.12.3/debian/control 2015-03-13 20:50:29.000000000 +0000 +++ kbreakout-15.04.2/debian/control 2015-06-09 16:40:05.000000000 +0000 @@ -1,4 +1,47 @@ Source: kbreakout +Build-Depends: cmake, + debhelper (>= 9), + extra-cmake-modules, + gettext, + kdoctools-dev, + kgendesignerplugin, + kinit-dev, + kio-dev, + libkf5archive-dev, + libkf5attica-dev, + libkf5auth-dev, + libkf5bookmarks-dev, + libkf5codecs-dev, + libkf5completion-dev, + libkf5config-dev, + libkf5configwidgets-dev, + libkf5coreaddons-dev, + libkf5crash-dev, + libkf5dbusaddons-dev, + libkf5emoticons-dev, + libkf5globalaccel-dev, + libkf5guiaddons-dev, + libkf5i18n-dev, + libkf5iconthemes-dev, + libkf5itemmodels-dev, + libkf5itemviews-dev, + libkf5jobwidgets-dev, + libkf5kdegames-dev, + libkf5kdelibs4support-dev, + libkf5notifications-dev, + libkf5parts-dev, + libkf5service-dev, + libkf5solid-dev, + libkf5sonnet-dev, + libkf5textwidgets-dev, + libkf5unitconversion-dev, + libkf5widgetsaddons-dev, + libkf5windowsystem-dev, + libkf5xmlgui-dev, + libqt5svg5-dev, + pkg-kde-tools (>> 0.15.15), + qtbase5-dev, + qtdeclarative5-dev Section: games Priority: optional Maintainer: Debian/Kubuntu Qt/KDE Maintainers @@ -9,12 +52,6 @@ George Kiagiadakis , Eshat Cakar , Maximiliano Curia -Build-Depends: cmake, - debhelper (>= 9), - kde-sc-dev-latest (>= 4:4.12), - kdelibs5-dev, - libkdegames-dev (>= 4:14.12.2), - pkg-kde-tools (>= 0.14) Standards-Version: 3.9.6 Homepage: http://games.kde.org/ Vcs-Browser: http://anonscm.debian.org/cgit/pkg-kde/applications/kbreakout.git diff -Nru kbreakout-14.12.3/debian/kbreakout.install kbreakout-15.04.2/debian/kbreakout.install --- kbreakout-14.12.3/debian/kbreakout.install 2015-03-13 20:50:29.000000000 +0000 +++ kbreakout-15.04.2/debian/kbreakout.install 2015-06-09 16:40:05.000000000 +0000 @@ -1,12 +1,4 @@ ../icons/kbreakout-16.xpm /usr/share/pixmaps ../icons/kbreakout.xpm /usr/share/pixmaps usr/games/kbreakout -usr/share/applications/kde4/kbreakout.desktop -usr/share/doc/kde/HTML/en/kbreakout/ -usr/share/icons/hicolor/128x128/apps/kbreakout.png -usr/share/icons/hicolor/16x16/apps/kbreakout.png -usr/share/icons/hicolor/22x22/apps/kbreakout.png -usr/share/icons/hicolor/32x32/apps/kbreakout.png -usr/share/icons/hicolor/48x48/apps/kbreakout.png -usr/share/icons/hicolor/64x64/apps/kbreakout.png -usr/share/kde4/apps/kbreakout/ +usr/share/* diff -Nru kbreakout-14.12.3/debian/rules kbreakout-15.04.2/debian/rules --- kbreakout-14.12.3/debian/rules 2015-03-13 20:50:29.000000000 +0000 +++ kbreakout-15.04.2/debian/rules 2015-06-09 16:40:05.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/make -f -include /usr/share/pkg-kde-tools/qt-kde-team/2/debian-qt-kde.mk +include /usr/share/pkg-kde-tools/qt-kde-team/3/debian-qt-kde.mk override_dh_auto_configure: $(overridden_command) -- -DBIN_INSTALL_DIR=/usr/games diff -Nru kbreakout-14.12.3/doc/CMakeLists.txt kbreakout-15.04.2/doc/CMakeLists.txt --- kbreakout-14.12.3/doc/CMakeLists.txt 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/doc/CMakeLists.txt 2015-04-14 05:28:15.000000000 +0000 @@ -1,4 +1,4 @@ ########### install files ############### # # -kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kbreakout) +kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kbreakout) diff -Nru kbreakout-14.12.3/doc/index.docbook kbreakout-15.04.2/doc/index.docbook --- kbreakout-14.12.3/doc/index.docbook 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/doc/index.docbook 2015-04-14 05:28:15.000000000 +0000 @@ -1,5 +1,5 @@ -KBreakout"> diff -Nru kbreakout-14.12.3/kbreakout.desktop kbreakout-15.04.2/kbreakout.desktop --- kbreakout-14.12.3/kbreakout.desktop 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/kbreakout.desktop 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ -[Desktop Entry] -Name=KBreakOut -Name[ast]=KBreakOut -Name[bs]=KBreakOut -Name[ca]=KBreakOut -Name[ca@valencia]=KBreakOut -Name[cs]=KBreakOut -Name[da]=KBreakOut -Name[de]=KBreakOut -Name[el]=KBreakOut -Name[en_GB]=KBreakOut -Name[es]=KBreakOut -Name[et]=KBreakOut -Name[eu]=KBreakOut -Name[fi]=KBreakOut -Name[fr]=KBreakOut -Name[ga]=KBreakOut -Name[gl]=KBreakOut -Name[hne]=के-ब्रेकआउट -Name[hu]=KBreakOut -Name[it]=KBreakOut -Name[ja]=KBreakOut -Name[kk]=KBreakOut -Name[km]=KBreakOut -Name[ko]=KBreakOut -Name[lt]=KBreakOut -Name[lv]=KBreakOut -Name[mr]=के-ब्रेक-आउट -Name[nb]=KBreakOut -Name[nds]=KBreakOut -Name[nl]=KBreakOut -Name[nn]=KBreakOut -Name[pl]=KBreakOut -Name[pt]=KBreakOut -Name[pt_BR]=KBreakOut -Name[ro]=KBreakOut -Name[ru]=KBreakOut -Name[sk]=KBreakOut -Name[sl]=KBreakOut -Name[sq]=KBreakOut -Name[sr]=К‑пробој -Name[sr@ijekavian]=К‑пробој -Name[sr@ijekavianlatin]=K‑proboj -Name[sr@latin]=K‑proboj -Name[sv]=Utbrytning -Name[tr]=KBreakOut -Name[ug]=KBreakOut -Name[uk]=KBreakOut -Name[wa]=sKetaedje (KBreakOut) -Name[x-test]=xxKBreakOutxx -Name[zh_CN]=KBreakOut -Name[zh_TW]=KBreakOut -Icon=kbreakout -Type=Application -Exec=kbreakout -caption %c -X-DocPath=kbreakout/index.html -GenericName=Breakout-like Game -GenericName[ast]=Xuegu asemeyáu a Breakout -GenericName[bs]=Igra cigli -GenericName[ca]=Joc similar al Breakout -GenericName[ca@valencia]=Joc similar al Breakout -GenericName[cs]=Hra typu Breakout -GenericName[da]=Breakout-lignende spil -GenericName[de]=„Breakout“-Spiel -GenericName[el]=Παιχνίδι παρόμοιο με το Breakout -GenericName[en_GB]=Breakout-like Game -GenericName[es]=Juego similar a Breakout -GenericName[et]=Breakouti moodi mäng -GenericName[eu]=Breakout-en antzeko jokoa -GenericName[fi]=Breakoutin kaltainen peli -GenericName[fr]=Jeu dans le style d'un casse-briques -GenericName[ga]=Cluiche Cosúil le Breakout -GenericName[gl]=Xogo similar ao Breakout -GenericName[hne]=ब्रेकआउट जइसन खेल -GenericName[hu]=Breakout-szerű játék -GenericName[it]=Un gioco simile a Breakout -GenericName[ja]=ブロック崩しゲーム -GenericName[kk]=Breakout-секілді ойын -GenericName[km]=ល្បែង​ដូច​នឹង Breakout -GenericName[ko]=벽돌 깨기 게임 -GenericName[lt]=Breakout-tipo žaidimas -GenericName[lv]=Klucīšu izsišanas spēle -GenericName[mr]=ब्रेकआउट सारखा खेळ -GenericName[nb]=Breakout-liknende spill -GenericName[nds]=Breakout-liek Speel -GenericName[nl]=Breakout-achtig spel -GenericName[nn]=Breakout-liknande spel -GenericName[pl]=Gra podobna do Breakout -GenericName[pt]=Jogo semelhante ao BreakOut -GenericName[pt_BR]=Jogo semelhante ao Breakout (quebra de barreiras) -GenericName[ro]=Un joc ca Breakout -GenericName[ru]=Арканоидоподобная игра -GenericName[sk]=Hra typu Breakout -GenericName[sl]=Igra podobna Breakoutu -GenericName[sq]=Lojë si BreakOut -GenericName[sr]=Игра налик на Пробој -GenericName[sr@ijekavian]=Игра налик на Пробој -GenericName[sr@ijekavianlatin]=Igra nalik na Proboj -GenericName[sr@latin]=Igra nalik na Proboj -GenericName[sv]=Spel som liknar Breakout -GenericName[tr]=Breakout-benzeri Oyun -GenericName[ug]=Breakout قا ئوخشاش ئويۇن -GenericName[uk]=Гра схожа на Breakout -GenericName[wa]=Djeu po sketer des brikes -GenericName[x-test]=xxBreakout-like Gamexx -GenericName[zh_CN]=挡板弹球游戏 -GenericName[zh_TW]=打磚塊遊戲 -X-KDE-StartupNotify=true -X-DBUS-StartupType=Multi -Categories=Qt;KDE;Game;ArcadeGame; diff -Nru kbreakout-14.12.3/org.kde.kbreakout.desktop kbreakout-15.04.2/org.kde.kbreakout.desktop --- kbreakout-14.12.3/org.kde.kbreakout.desktop 1970-01-01 00:00:00.000000000 +0000 +++ kbreakout-15.04.2/org.kde.kbreakout.desktop 2015-04-14 05:28:15.000000000 +0000 @@ -0,0 +1,111 @@ +[Desktop Entry] +Name=KBreakOut +Name[ast]=KBreakOut +Name[bs]=KBreakOut +Name[ca]=KBreakOut +Name[ca@valencia]=KBreakOut +Name[cs]=KBreakOut +Name[da]=KBreakOut +Name[de]=KBreakOut +Name[el]=KBreakOut +Name[en_GB]=KBreakOut +Name[es]=KBreakOut +Name[et]=KBreakOut +Name[eu]=KBreakOut +Name[fi]=KBreakOut +Name[fr]=KBreakOut +Name[ga]=KBreakOut +Name[gl]=KBreakOut +Name[hne]=के-ब्रेकआउट +Name[hu]=KBreakOut +Name[it]=KBreakOut +Name[ja]=KBreakOut +Name[kk]=KBreakOut +Name[km]=KBreakOut +Name[ko]=KBreakOut +Name[lt]=KBreakOut +Name[lv]=KBreakOut +Name[mr]=के-ब्रेक-आउट +Name[nb]=KBreakOut +Name[nds]=KBreakOut +Name[nl]=KBreakOut +Name[nn]=KBreakOut +Name[pl]=KBreakOut +Name[pt]=KBreakOut +Name[pt_BR]=KBreakOut +Name[ro]=KBreakOut +Name[ru]=KBreakOut +Name[sk]=KBreakOut +Name[sl]=KBreakOut +Name[sq]=KBreakOut +Name[sr]=К‑пробој +Name[sr@ijekavian]=К‑пробој +Name[sr@ijekavianlatin]=K‑proboj +Name[sr@latin]=K‑proboj +Name[sv]=Utbrytning +Name[tr]=KBreakOut +Name[ug]=KBreakOut +Name[uk]=KBreakOut +Name[wa]=sKetaedje (KBreakOut) +Name[x-test]=xxKBreakOutxx +Name[zh_CN]=KBreakOut +Name[zh_TW]=KBreakOut +Icon=kbreakout +Type=Application +Exec=kbreakout -qwindowtitle %c +X-DocPath=kbreakout/index.html +GenericName=Breakout-like Game +GenericName[ast]=Xuegu asemeyáu a Breakout +GenericName[bs]=Igra cigli +GenericName[ca]=Joc similar al Breakout +GenericName[ca@valencia]=Joc similar al Breakout +GenericName[cs]=Hra typu Breakout +GenericName[da]=Breakout-lignende spil +GenericName[de]=„Breakout“-Spiel +GenericName[el]=Παιχνίδι παρόμοιο με το Breakout +GenericName[en_GB]=Breakout-like Game +GenericName[es]=Juego similar a Breakout +GenericName[et]=Breakouti moodi mäng +GenericName[eu]=Breakout-en antzeko jokoa +GenericName[fi]=Breakoutin kaltainen peli +GenericName[fr]=Jeu dans le style d'un casse-briques +GenericName[ga]=Cluiche Cosúil le Breakout +GenericName[gl]=Xogo similar ao Breakout +GenericName[hne]=ब्रेकआउट जइसन खेल +GenericName[hu]=Breakout-szerű játék +GenericName[it]=Un gioco simile a Breakout +GenericName[ja]=ブロック崩しゲーム +GenericName[kk]=Breakout-секілді ойын +GenericName[km]=ល្បែង​ដូច​នឹង Breakout +GenericName[ko]=벽돌 깨기 게임 +GenericName[lt]=Breakout-tipo žaidimas +GenericName[lv]=Klucīšu izsišanas spēle +GenericName[mr]=ब्रेकआउट सारखा खेळ +GenericName[nb]=Breakout-liknende spill +GenericName[nds]=Breakout-liek Speel +GenericName[nl]=Breakout-achtig spel +GenericName[nn]=Breakout-liknande spel +GenericName[pl]=Gra podobna do Breakout +GenericName[pt]=Jogo semelhante ao BreakOut +GenericName[pt_BR]=Jogo semelhante ao Breakout (quebra de barreiras) +GenericName[ro]=Un joc ca Breakout +GenericName[ru]=Арканоидоподобная игра +GenericName[sk]=Hra typu Breakout +GenericName[sl]=Igra podobna Breakoutu +GenericName[sq]=Lojë si BreakOut +GenericName[sr]=Игра налик на Пробој +GenericName[sr@ijekavian]=Игра налик на Пробој +GenericName[sr@ijekavianlatin]=Igra nalik na Proboj +GenericName[sr@latin]=Igra nalik na Proboj +GenericName[sv]=Spel som liknar Breakout +GenericName[tr]=Breakout-benzeri Oyun +GenericName[ug]=Breakout قا ئوخشاش ئويۇن +GenericName[uk]=Гра схожа на Breakout +GenericName[wa]=Djeu po sketer des brikes +GenericName[x-test]=xxBreakout-like Gamexx +GenericName[zh_CN]=挡板弹球游戏 +GenericName[zh_TW]=打磚塊遊戲 +StartupNotify=true +X-DBUS-StartupType=Multi +Categories=Qt;KDE;Game;ArcadeGame; +X-DBUS-ServiceName=org.kde.kbreakout diff -Nru kbreakout-14.12.3/pics/CMakeLists.txt kbreakout-15.04.2/pics/CMakeLists.txt --- kbreakout-14.12.3/pics/CMakeLists.txt 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/pics/CMakeLists.txt 2015-04-14 05:28:15.000000000 +0000 @@ -1 +1 @@ -kde4_install_icons( ${ICON_INSTALL_DIR} ) \ No newline at end of file +ecm_install_icons( ICONS hi128-apps-kbreakout.png hi16-apps-kbreakout.png hi22-apps-kbreakout.png hi32-apps-kbreakout.png hi48-apps-kbreakout.png hi64-apps-kbreakout.png DESTINATION ${ICON_INSTALL_DIR} ) Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi128-app-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi128-app-kbreakout.png differ Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi128-apps-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi128-apps-kbreakout.png differ Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi16-app-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi16-app-kbreakout.png differ Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi16-apps-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi16-apps-kbreakout.png differ Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi22-app-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi22-app-kbreakout.png differ Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi22-apps-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi22-apps-kbreakout.png differ Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi32-app-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi32-app-kbreakout.png differ Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi32-apps-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi32-apps-kbreakout.png differ Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi48-app-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi48-app-kbreakout.png differ Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi48-apps-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi48-apps-kbreakout.png differ Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi64-app-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi64-app-kbreakout.png differ Binary files /tmp/dSIZHjAFJC/kbreakout-14.12.3/pics/hi64-apps-kbreakout.png and /tmp/3iIjCxJp1P/kbreakout-15.04.2/pics/hi64-apps-kbreakout.png differ diff -Nru kbreakout-14.12.3/README.PACKAGERS kbreakout-15.04.2/README.PACKAGERS --- kbreakout-14.12.3/README.PACKAGERS 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/README.PACKAGERS 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -EXTENDED diff -Nru kbreakout-14.12.3/src/canvaswidget.cpp kbreakout-15.04.2/src/canvaswidget.cpp --- kbreakout-14.12.3/src/canvaswidget.cpp 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/canvaswidget.cpp 2015-04-14 05:28:15.000000000 +0000 @@ -1,16 +1,16 @@ /* Copyright 2012 Viranch Mehta - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -23,8 +23,9 @@ #include #include #include +#include +#include -#include #include CanvasWidget::CanvasWidget(QWidget *parent) : @@ -32,8 +33,8 @@ m_provider(new KgThemeProvider) { m_provider->discoverThemes("appdata", QLatin1String("themes")); - m_provider->setDeclarativeEngine("themeProvider", engine()); - QString path = KStandardDirs::locate("appdata", "qml/main.qml"); + m_provider->setDeclarativeEngine(QLatin1Literal("themeProvider"), engine()); + QString path = QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1Literal("qml/main.qml")); setSource(QUrl::fromLocalFile(path)); // forward signals from QML @@ -43,7 +44,7 @@ // for handling mouse cursor connect(rootObject(), SIGNAL(pausedChanged()), this, SLOT(updateCursor())); - connect(this, SIGNAL(gameEnded(int,int,int)), this, SLOT(resetCursor())); + connect(this, &CanvasWidget::gameEnded, this, &CanvasWidget::resetCursor); } CanvasWidget::~CanvasWidget() @@ -53,14 +54,14 @@ void CanvasWidget::updateFireShortcut() { - QAction *fireAction = qobject_cast(sender()); + QAction *fireAction = qobject_cast(sender()); QString shortcut = fireAction->shortcut().toString(QKeySequence::NativeText); rootObject()->setProperty("fireShortcut", shortcut); } void CanvasWidget::resizeEvent(QResizeEvent *event) { - QDeclarativeView::resizeEvent(event); + QQuickWidget::resizeEvent(event); QMetaObject::invokeMethod(rootObject(), "updateGeometry"); } @@ -140,7 +141,7 @@ void CanvasWidget::keyPressEvent(QKeyEvent *event) { if (event->isAutoRepeat()) { - QDeclarativeView::keyPressEvent(event); + QQuickWidget::keyPressEvent(event); return; } int key = event->key(); @@ -154,7 +155,7 @@ m_barDirection = -1; break; default: - QDeclarativeView::keyPressEvent(event); + QQuickWidget::keyPressEvent(event); return; } @@ -164,7 +165,7 @@ void CanvasWidget::keyReleaseEvent(QKeyEvent *event) { if (event->isAutoRepeat()) { - QDeclarativeView::keyReleaseEvent(event); + QQuickWidget::keyReleaseEvent(event); return; } int key = event->key(); @@ -176,7 +177,7 @@ m_leftPressed = false; break; default: - QDeclarativeView::keyReleaseEvent(event); + QQuickWidget::keyReleaseEvent(event); return; } @@ -194,5 +195,5 @@ void CanvasWidget::focusOutEvent(QFocusEvent *event) { emit focusLost(); - QDeclarativeView::focusOutEvent(event); + QQuickWidget::focusOutEvent(event); } diff -Nru kbreakout-14.12.3/src/canvaswidget.h kbreakout-15.04.2/src/canvaswidget.h --- kbreakout-14.12.3/src/canvaswidget.h 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/canvaswidget.h 2015-04-14 05:28:15.000000000 +0000 @@ -1,16 +1,16 @@ /* Copyright 2012 Viranch Mehta - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -19,14 +19,17 @@ #define CANVASWIDGET_H #include - +class KgThemeProvider; class CanvasWidget : public KgDeclarativeView { Q_OBJECT public: - CanvasWidget(QWidget *parent=0); + CanvasWidget(QWidget *parent = 0); virtual ~CanvasWidget(); - KgThemeProvider* getProvider() {return m_provider;} + KgThemeProvider *getProvider() + { + return m_provider; + } signals: void levelComplete(); @@ -39,7 +42,7 @@ void setGamePaused(bool paused); void updateFireShortcut(); -private slots: +public slots: void newGame(); void showLine(QString line, int lineNumber); void putGift(QString gift, int times, QString pos); diff -Nru kbreakout-14.12.3/src/CMakeLists.txt kbreakout-15.04.2/src/CMakeLists.txt --- kbreakout-14.12.3/src/CMakeLists.txt 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/CMakeLists.txt 2015-04-14 05:28:15.000000000 +0000 @@ -1,4 +1,4 @@ -include_directories( ${CMAKE_SOURCE_DIR}/libkdegames ) +include_directories( ${CMAKE_SOURCE_DIR}/libKF5KDEGames ) set(kbreakout_SRCS main.cpp @@ -9,16 +9,16 @@ #generalsettings.cpp ) -kde4_add_ui_files(kbreakout_SRCS generalsettings.ui) +ki18n_wrap_ui(kbreakout_SRCS generalsettings.ui) -kde4_add_kcfg_files(kbreakout_SRCS settings.kcfgc ) +kconfig_add_kcfg_files(kbreakout_SRCS settings.kcfgc ) -kde4_add_app_icon(kbreakout_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../pics/hi*-app-kbreakout.png") +#kde4_add_app_icon(kbreakout_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../pics/hi*-apps-kbreakout.png") -kde4_add_executable(kbreakout ${kbreakout_SRCS}) +add_executable(kbreakout ${kbreakout_SRCS}) -target_link_libraries(kbreakout kdegames kdegamesprivate ${KDE4_KDEUI_LIBS} ${QT_QTXML_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${KDECLARATIVE_LIBRARIES}) +target_link_libraries(kbreakout KF5KDEGames KF5KDEGamesPrivate Qt5::Xml KF5::DBusAddons KF5::XmlGui) install(TARGETS kbreakout ${INSTALL_TARGETS_DEFAULT_ARGS} ) -install(FILES kbreakoutui.rc DESTINATION ${DATA_INSTALL_DIR}/kbreakout) +install(FILES kbreakoutui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kbreakout) install(DIRECTORY qml DESTINATION ${DATA_INSTALL_DIR}/kbreakout) diff -Nru kbreakout-14.12.3/src/gameengine.cpp kbreakout-15.04.2/src/gameengine.cpp --- kbreakout-14.12.3/src/gameengine.cpp 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/gameengine.cpp 2015-04-14 05:28:15.000000000 +0000 @@ -1,16 +1,16 @@ /* - Copyright 2007-2008 Fela Winkelmolen - + Copyright 2007-2008 Fela Winkelmolen + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -21,14 +21,15 @@ #include #include +#include GameEngine::GameEngine(QObject *parent) : QObject(parent) { - qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); - m_levelLoader = new LevelLoader( this ); - connect(m_levelLoader, SIGNAL(newLine(QString,int)), this, SIGNAL(newLine(QString,int))); - connect(m_levelLoader, SIGNAL(newGift(QString,int,QString)), this, SIGNAL(newGift(QString,int,QString))); + qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); + m_levelLoader = new LevelLoader(this); + connect(m_levelLoader, &LevelLoader::newLine, this, &GameEngine::newLine); + connect(m_levelLoader, &LevelLoader::newGift, this, &GameEngine::newGift); } GameEngine::~GameEngine() @@ -37,22 +38,22 @@ delete m_levelLoader; } -void GameEngine::start(const QString& l) +void GameEngine::start(const QString &l) { m_levelLoader->setLevelset(l); m_levelLoader->setLevel(0); emit loadingNewGame(); - + loadLevel(); } void GameEngine::loadLevel() { deleteAllObjects(); - + m_levelLoader->loadLevel(); - + emit ready(); } @@ -63,7 +64,7 @@ inline void GameEngine::deleteAllObjects() { - /*kDebug() << "all object deleted"; + /*qDebug() << "all object deleted"; deleteMovingObjects(); qDeleteAll(m_bricks); m_bricks.clear(); diff -Nru kbreakout-14.12.3/src/gameengine.h kbreakout-15.04.2/src/gameengine.h --- kbreakout-14.12.3/src/gameengine.h 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/gameengine.h 2015-04-14 05:28:15.000000000 +0000 @@ -1,16 +1,16 @@ /* - Copyright 2007-2008 Fela Winkelmolen - + Copyright 2007-2008 Fela Winkelmolen + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -28,7 +28,7 @@ public: GameEngine(QObject *parent = 0); ~GameEngine(); - + public slots: void start(const QString &levelset); void loadNextLevel(); diff -Nru kbreakout-14.12.3/src/globals.h kbreakout-15.04.2/src/globals.h --- kbreakout-14.12.3/src/globals.h 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/globals.h 2015-04-14 05:28:15.000000000 +0000 @@ -1,16 +1,16 @@ /* - Copyright 2007-2008 Fela Winkelmolen - + Copyright 2007-2008 Fela Winkelmolen + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -18,8 +18,6 @@ #ifndef GLOBALS_H #define GLOBALS_H -#include - // how many pixels it moves each step // should be less than the half of BALL_SIZE const int BALL_SPEED = 2; @@ -35,7 +33,7 @@ const qreal AUTO_SPEED_INCREASE = 1.05; const int BURNING_INTERVAL = 200; // how long it burns -const int BURNING_SPEED = BURNING_INTERVAL/2; // lower is faster +const int BURNING_SPEED = BURNING_INTERVAL / 2; // lower is faster const int WIDTH = 20; // how many bricks the game is wide const int HEIGHT = 24; // how many bricks the game is high @@ -60,7 +58,7 @@ const int BRICK_SCORE = 15; // relative score w.r.t the old score const qreal SCORE_AUTO_DECREASE = 0.998; -// score when i brick gets "autoremoved" +// score when i brick gets "autoremoved" // (for example becouse of a gift, of fire) const int AUTOBRICK_SCORE = BRICK_SCORE / 2; // points avarded when passing a level diff -Nru kbreakout-14.12.3/src/levelloader.cpp kbreakout-15.04.2/src/levelloader.cpp --- kbreakout-14.12.3/src/levelloader.cpp 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/levelloader.cpp 2015-04-14 05:28:15.000000000 +0000 @@ -1,16 +1,16 @@ /* - Copyright 2011 Julian Helfferich - + Copyright 2011 Julian Helfferich + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -20,16 +20,16 @@ #include #include +#include // These can be removed when KConfig style levelsets are no longer supported #include #include -#include -#include +#include LevelLoader::LevelLoader(QObject *parent) - : QObject(parent) + : QObject(parent) { m_levelname = QString(); m_level = 0; @@ -56,40 +56,40 @@ return m_levelname; } -void LevelLoader::setLevelset(const QString& levelname) +void LevelLoader::setLevelset(const QString &levelname) { - if( levelname == m_levelname ){ + if (levelname == m_levelname) { return; } m_levelname = levelname; // Loading document model // Locating the path in the filesystem - QString path = "levelsets/" + m_levelname + ".levelset"; - path = KStandardDirs::locate("appdata", path); + QString path = QLatin1String("levelsets/") + m_levelname + QLatin1String(".levelset"); + path = QStandardPaths::locate(QStandardPaths::DataLocation, path); // -- - + delete m_levelset; - - m_levelset = new QDomDocument( m_levelname ); - QFile file( path ); - if( !file.open( QIODevice::ReadOnly ) ){ - kError() << "Can't open file " << path << endl; + + m_levelset = new QDomDocument(m_levelname); + QFile file(path); + if (!file.open(QIODevice::ReadOnly)) { + qCritical() << "Can't open file " << path << endl; } - + QString errorString; int errorLine; int errorColumn; - if( !m_levelset->setContent( &file, false, &errorString, &errorLine, &errorColumn ) ){ + if (!m_levelset->setContent(&file, false, &errorString, &errorLine, &errorColumn)) { file.close(); // Testing whether levelset is of old KConfig style KConfig kconfigfile(path, KConfig::SimpleConfig); - if( kconfigfile.hasGroup( "level1" ) ){ + if (kconfigfile.hasGroup(QLatin1String("level1"))) { // Levelset is in KConfig style m_oldstyle = true; - kError() << "Warning: Using deprecated KConfig-levelset. Please change to XML-Style.\n"; + qCritical() << "Warning: Using deprecated KConfig-levelset. Please change to XML-Style.\n"; } else { - kError() << "Can't read levelset from " << path << "\nError: " << errorString << + qCritical() << "Can't read levelset from " << path << "\nError: " << errorString << " in Line " << errorLine << ", Column " << errorColumn << endl; } } else { @@ -101,63 +101,65 @@ } void LevelLoader::loadLevel() -{ +{ // Check if levelset is of KConfig-type - if( m_oldstyle ){ + if (m_oldstyle) { loadOldStyleLevel(); return; } // Selecting the correct level m_level++; - - if( m_levelset == 0 ){ - kError() << "Error: No levelset specified" << endl; + + if (m_levelset == 0) { + qCritical() << "Error: No levelset specified" << endl; return; } - + QDomElement levels = m_levelset->documentElement(); QDomNode node = levels.firstChild(); - for( int i = 1; i < m_level; i++ ){ + for (int i = 1; i < m_level; i++) { node = node.nextSibling(); } // -- - + // Load level information - if( node.isNull() || node.toElement().tagName() != "Level" ){ + if (node.isNull() || node.toElement().tagName() != QLatin1String("Level")) { // Level not found or no more levels return; } - + QDomAttr attribute; QDomElement level = node.toElement(); - if( level.isNull() ){ - kError() << "Invalid Levelset " << m_levelname << ": Can't read level information"; + if (level.isNull()) { + qCritical() << "Invalid Levelset " << m_levelname << ": Can't read level information"; } - attribute = level.attributeNode("Name"); + attribute = level.attributeNode(QLatin1String("Name")); QString levelName; - if( !attribute.isNull() ){ - levelName = level.attributeNode("Name").value(); + if (!attribute.isNull()) { + levelName = level.attributeNode(QLatin1String("Name")).value(); } node = node.firstChild(); // -- - + // Load bricks and gifts m_lineNumber = 0; - while( !node.isNull() ){ + while (!node.isNull()) { QDomElement info = node.toElement(); - if( info.isNull() ){ kError() << "Invalid levelset " << m_levelname << ": Can't read level information."; } - - if( info.tagName() == "Line" ){ + if (info.isNull()) { + qCritical() << "Invalid levelset " << m_levelname << ": Can't read level information."; + } + + if (info.tagName() == QLatin1String("Line")) { // Load one line of bricks - loadLine( info ); - } else if( info.tagName() == "Gift" ){ + loadLine(info); + } else if (info.tagName() == QLatin1String("Gift")) { // Load one gift type - loadGift( info ); + loadGift(info); } else { - kError() << "Invalid tag name " << info.tagName() << " has occured in level " - << levelName << " in levelset " << m_levelname << endl; + qCritical() << "Invalid tag name " << info.tagName() << " has occured in level " + << levelName << " in levelset " << m_levelname << endl; } - + node = node.nextSibling(); } } @@ -165,32 +167,32 @@ void LevelLoader::loadLine(QDomElement lineNode) { // Reading the line number - QDomAttr attribute = lineNode.attributeNode("Number"); - QDomElement attributeNode = lineNode.firstChildElement("Number"); - if( !attribute.isNull() ){ + QDomAttr attribute = lineNode.attributeNode(QLatin1String("Number")); + QDomElement attributeNode = lineNode.firstChildElement(QLatin1String("Number")); + if (!attribute.isNull()) { m_lineNumber = attribute.value().toInt(); - } else if( !attributeNode.isNull() ) { + } else if (!attributeNode.isNull()) { m_lineNumber = attributeNode.text().toInt(); } else { // Standard line numbering: load next line m_lineNumber++; } - + // Reading the brick information - attribute = lineNode.attributeNode("Bricks"); - attributeNode = lineNode.firstChildElement("Bricks"); + attribute = lineNode.attributeNode(QLatin1String("Bricks")); + attributeNode = lineNode.firstChildElement(QLatin1String("Bricks")); QString line; - if( !attribute.isNull() ){ + if (!attribute.isNull()) { line = attribute.value(); - } else if( !attributeNode.isNull() ) { + } else if (!attributeNode.isNull()) { line = attributeNode.text(); } else { line = lineNode.text(); } - if( line.size() > WIDTH ){ - kError() << "Invalid levelset " << m_levelname << ": too many bricks in line " - << m_lineNumber << endl; + if (line.size() > WIDTH) { + qCritical() << "Invalid levelset " << m_levelname << ": too many bricks in line " + << m_lineNumber << endl; } emit newLine(line, m_lineNumber); @@ -200,12 +202,12 @@ { bool nodeTextRead = false; // Reading the brick type - QDomAttr attribute = giftNode.attributeNode("Type"); - QDomElement attributeNode = giftNode.firstChildElement("Type"); + QDomAttr attribute = giftNode.attributeNode(QLatin1String("Type")); + QDomElement attributeNode = giftNode.firstChildElement(QLatin1String("Type")); QString giftType; - if( !attribute.isNull() ){ + if (!attribute.isNull()) { giftType = attribute.value(); - } else if( !attributeNode.isNull() ){ + } else if (!attributeNode.isNull()) { giftType = attributeNode.text(); nodeTextRead = true; } else { @@ -214,31 +216,33 @@ } // Reading number of gifts to be distributed. If not specified one gift is placed. - attribute = giftNode.attributeNode("Count"); - attributeNode = giftNode.firstChildElement("Count"); + attribute = giftNode.attributeNode(QLatin1String("Count")); + attributeNode = giftNode.firstChildElement(QLatin1String("Count")); int times = 1; bool ok = true; - if( !attribute.isNull() ){ - times = attribute.value().toInt( &ok ); - } else if( !attributeNode.isNull() ){ - times = attributeNode.text().toInt( &ok ); + if (!attribute.isNull()) { + times = attribute.value().toInt(&ok); + } else if (!attributeNode.isNull()) { + times = attributeNode.text().toInt(&ok); nodeTextRead = true; - } else if( !nodeTextRead ){ - times = giftNode.text().toInt( &ok ); - if( !ok ){ times = 1; } + } else if (!nodeTextRead) { + times = giftNode.text().toInt(&ok); + if (!ok) { + times = 1; + } } - + // If only one brick to be placed: see if position is given QString position; - if( times == 1 ){ - attribute = giftNode.attributeNode("Position"); - attributeNode = giftNode.firstChildElement("Position"); - if( !attribute.isNull() ){ + if (times == 1) { + attribute = giftNode.attributeNode(QLatin1String("Position")); + attributeNode = giftNode.firstChildElement(QLatin1String("Position")); + if (!attribute.isNull()) { position = attribute.value(); - } else if( !attributeNode.isNull() ){ + } else if (!attributeNode.isNull()) { position = attributeNode.text(); nodeTextRead = true; - } else if( !nodeTextRead && giftNode.text().contains(',') ){ + } else if (!nodeTextRead && giftNode.text().contains(QLatin1Char(','))) { position = giftNode.text(); nodeTextRead = true; } @@ -251,62 +255,64 @@ { // Selecting the correct level m_level++; - + // Loading the levelset - QString path = "levelsets/" + m_levelname + ".levelset"; - path = KStandardDirs::locate("appdata", path); + QString path = QLatin1String("levelsets/") + m_levelname + QLatin1String(".levelset"); + path = QStandardPaths::locate(QStandardPaths::DataLocation, path); KConfig file(path, KConfig::SimpleConfig); - - QString levelName("level" + QString::number(m_level)); - + + QString levelName(QLatin1String("level") + QString::number(m_level)); + if (!file.hasGroup(levelName)) { // No more levels or no levels found return; } - + // Loading level information KConfigGroup lvl = file.group(levelName); - + // add bricks - + int y = 1; - QString key("line" + QString::number(y)); - - while(lvl.hasKey(key)) { + QString key(QLatin1String("line") + QString::number(y)); + + while (lvl.hasKey(key)) { // one line of bricks to be converted QString line = lvl.readEntry(key, "error"); - if (line == "error") { - kError() << "Something strange happened!!\n"; + if (line == QLatin1String("error")) { + qCritical() << "Something strange happened!!\n"; return; } - - kDebug() << line << endl; - + + qDebug() << line << endl; + if (line.size() > WIDTH) { - kError() << "Invalid file: too many bricks\n"; + qCritical() << "Invalid file: too many bricks\n"; } emit newLine(line, y); - + ++y; - key = "line" + QString::number(y); + key = QLatin1String("line") + QString::number(y); } - + // add gifts - + for (int i = 0; i < GIFT_TYPES_COUNT; ++i) { key = GIFT_TYPES[i]; - if (!lvl.hasKey(key)) continue; - + if (!lvl.hasKey(key)) { + continue; + } + QString line = lvl.readEntry(key, "error"); - if (line == "error") { - kError() << "Impossible reading " << m_level << ":" << key << endl; + if (line == QLatin1String("error")) { + qCritical() << "Impossible reading " << m_level << ":" << key << endl; return; } bool ok; int times = line.toInt(&ok); if (!ok) { - kError() << m_levelname << ":" << key << " invalid number!!" << endl; + qCritical() << m_levelname << ":" << key << " invalid number!!" << endl; continue; } diff -Nru kbreakout-14.12.3/src/levelloader.h kbreakout-15.04.2/src/levelloader.h --- kbreakout-14.12.3/src/levelloader.h 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/levelloader.h 2015-04-14 05:28:15.000000000 +0000 @@ -1,16 +1,16 @@ /* - Copyright 20011 Julian Helfferich - + Copyright 20011 Julian Helfferich + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -27,14 +27,14 @@ { Q_OBJECT public: - LevelLoader( QObject *parent = 0 ); + LevelLoader(QObject *parent = 0); ~LevelLoader(); - + int level() const; - void setLevel( int level ); + void setLevel(int level); QString levelset() const; - void setLevelset( const QString& levelname ); - + void setLevelset(const QString &levelname); + void loadLevel(); signals: @@ -42,14 +42,14 @@ void newGift(QString giftType, int times, QString position); private: - void loadLine( QDomElement lineNode ); - void loadGift( QDomElement giftNode ); - + void loadLine(QDomElement lineNode); + void loadGift(QDomElement giftNode); + void loadOldStyleLevel(); - + QDomDocument *m_levelset; bool m_oldstyle; - + int m_lineNumber; QString m_levelname; int m_level; @@ -59,28 +59,28 @@ // Can be removed, when KConfig levelsets are no longer supported const QString GIFT_TYPES[] = { - "Gift100Points", - "Gift200Points", - "Gift500Points", - "Gift1000Points", - "GiftAddLife", - - "GiftLoseLife", - "GiftNextLevel", - "GiftSplitBall", - "GiftAddBall", - "GiftDecreaseSpeed", - - "GiftIncreaseSpeed", - "GiftUnstoppableBall", - "GiftBurningBall", - "GiftMagicWand", - "GiftMagicEye", - - "GiftEnlargeBar", - "GiftShrinkBar", - "GiftStickyBar", - "GiftMoreExplosion" + QLatin1Literal("Gift100Points"), + QLatin1Literal("Gift200Points"), + QLatin1Literal("Gift500Points"), + QLatin1Literal("Gift1000Points"), + QLatin1Literal("GiftAddLife"), + + QLatin1Literal("GiftLoseLife"), + QLatin1Literal("GiftNextLevel"), + QLatin1Literal("GiftSplitBall"), + QLatin1Literal("GiftAddBall"), + QLatin1Literal("GiftDecreaseSpeed"), + + QLatin1Literal("GiftIncreaseSpeed"), + QLatin1Literal("GiftUnstoppableBall"), + QLatin1Literal("GiftBurningBall"), + QLatin1Literal("GiftMagicWand"), + QLatin1Literal("GiftMagicEye"), + + QLatin1Literal("GiftEnlargeBar"), + QLatin1Literal("GiftShrinkBar"), + QLatin1Literal("GiftStickyBar"), + QLatin1Literal("GiftMoreExplosion") }; // IMPORTANT: keep in sync with the above diff -Nru kbreakout-14.12.3/src/main.cpp kbreakout-15.04.2/src/main.cpp --- kbreakout-14.12.3/src/main.cpp 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/main.cpp 2015-04-14 05:28:15.000000000 +0000 @@ -1,60 +1,76 @@ /* - Copyright 2007-2008 Fela Winkelmolen - + Copyright 2007-2008 Fela Winkelmolen + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ - -#include #include -#include -#include +#include +#include +#include +#include +#include #include "mainwindow.h" -int main (int argc, char *argv[]) +int main(int argc, char *argv[]) { - KAboutData aboutData("kbreakout", 0, ki18n("KBreakOut"), "1.1.0"); - aboutData.setShortDescription(ki18n("A breakout like game for KDE")); - aboutData.setLicense(KAboutData::License_GPL); - aboutData.setCopyrightStatement(ki18n("(c) 2007-2008 Fela Winkelmolen")); - aboutData.addAuthor(ki18n("Fela Winkelmolen"), - ki18n("original author and maintainer"), - "fela.kde@gmail.com"); - aboutData.addAuthor(ki18n("Eugene Trounev"), - ki18n("artwork"), - "eugene.trounev@gmail.com"); - aboutData.addAuthor(ki18n("Sean Wilson"), - ki18n("artwork"), - "suseux@gmail.com"); - aboutData.addCredit(ki18n("Lorenzo Bonomi"), - ki18n("testing"), - "lorenzo.bonomi@hotmail.it"); - aboutData.addCredit(ki18n("Brian Croom"), - ki18n("port to KGameRenderer"), - "brian.s.croom@gmail.com"); - aboutData.addCredit(ki18n("Viranch Mehta"), - ki18n("port to QtQuick"), - "viranch.mehta@gmail.com"); - - KCmdLineArgs::init( argc, argv, &aboutData ); - KApplication app; - KGlobal::locale()->insertCatalog( QLatin1String( "libkdegames" )); - - MainWindow* window = new MainWindow(); + QApplication app(argc, argv); + + Kdelibs4ConfigMigrator migrate(QStringLiteral("kbreakout")); + migrate.setConfigFiles(QStringList() << QStringLiteral("kbreakoutrc")); + migrate.setUiFiles(QStringList() << QStringLiteral("kbreakoutui.rc")); + migrate.migrate(); + + + KAboutData aboutData(QLatin1Literal("kbreakout"), i18n("KBreakOut"), QLatin1Literal("1.2.0")); + aboutData.setShortDescription(i18n("A breakout like game for KDE")); + aboutData.setLicense(KAboutLicense::GPL); + aboutData.setCopyrightStatement(i18n("(c) 2007-2008 Fela Winkelmolen")); + aboutData.addAuthor(i18n("Fela Winkelmolen"), + i18n("original author and maintainer"), + QLatin1Literal("fela.kde@gmail.com")); + aboutData.addAuthor(i18n("Eugene Trounev"), + i18n("artwork"), + QLatin1Literal("eugene.trounev@gmail.com")); + aboutData.addAuthor(i18n("Sean Wilson"), + i18n("artwork"), + QLatin1Literal("suseux@gmail.com")); + aboutData.addCredit(i18n("Lorenzo Bonomi"), + i18n("testing"), + QLatin1Literal("lorenzo.bonomi@hotmail.it")); + aboutData.addCredit(i18n("Brian Croom"), + i18n("port to KGameRenderer"), + QLatin1Literal("brian.s.croom@gmail.com")); + aboutData.addCredit(i18n("Viranch Mehta"), + i18n("port to QtQuick"), + QLatin1Literal("viranch.mehta@gmail.com")); + + QCommandLineParser parser; + KAboutData::setApplicationData(aboutData); + parser.addVersionOption(); + parser.addHelpOption(); + aboutData.setupCommandLine(&parser); + parser.process(app); + aboutData.processCommandLine(&parser); + + app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kbreakout"))); + + KDBusService service; + MainWindow *window = new MainWindow(); Q_UNUSED(window); - + return app.exec(); } diff -Nru kbreakout-14.12.3/src/mainwindow.cpp kbreakout-15.04.2/src/mainwindow.cpp --- kbreakout-14.12.3/src/mainwindow.cpp 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/mainwindow.cpp 2015-04-14 05:28:15.000000000 +0000 @@ -1,17 +1,17 @@ /* - Copyright 2007-2009 Fela Winkelmolen + Copyright 2007-2009 Fela Winkelmolen Copyright 2010 Brian Croom - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -25,14 +25,13 @@ #include -#include -#include -#include +#include +#include +#include #include -#include #include #include -#include +#include #include #include #include @@ -40,7 +39,6 @@ #include #include - class GeneralSettings : public QWidget { public: @@ -53,39 +51,31 @@ Ui::GeneralSettings ui; }; -MainWindow::MainWindow(QWidget *parent) +MainWindow::MainWindow(QWidget *parent) : KXmlGuiWindow(parent), canvasWidget(new CanvasWidget(this)) { gameEngine = new GameEngine(this); - - connect(canvasWidget, SIGNAL(focusLost()), - this, SLOT(pauseGame())); - - connect(canvasWidget, SIGNAL(levelComplete()), - gameEngine, SLOT(loadNextLevel())); - connect(canvasWidget, SIGNAL(gameEnded(int,int,int)), - SLOT(handleEndedGame(int,int,int))); - connect(canvasWidget, SIGNAL(mousePressed()), - this, SLOT(handleMousePressed())); - - connect(gameEngine, SIGNAL(loadingNewGame()), - canvasWidget, SLOT(newGame())); - connect(gameEngine, SIGNAL(newLine(QString,int)), - canvasWidget, SLOT(showLine(QString,int))); - connect(gameEngine, SIGNAL(newGift(QString,int,QString)), - canvasWidget, SLOT(putGift(QString,int,QString))); - connect(gameEngine, SIGNAL(ready()), - canvasWidget, SLOT(startGame())); - + + connect(canvasWidget, &CanvasWidget::focusLost, this, &MainWindow::pauseGame); + + connect(canvasWidget, &CanvasWidget::levelComplete, gameEngine, &GameEngine::loadNextLevel); + connect(canvasWidget, &CanvasWidget::gameEnded, this, &MainWindow::handleEndedGame); + connect(canvasWidget, &CanvasWidget::mousePressed, this, &MainWindow::handleMousePressed); + + connect(gameEngine, &GameEngine::loadingNewGame, canvasWidget, &CanvasWidget::newGame); + connect(gameEngine, &GameEngine::newLine, canvasWidget, &CanvasWidget::showLine); + connect(gameEngine, &GameEngine::newGift, canvasWidget, &CanvasWidget::putGift); + connect(gameEngine, &GameEngine::ready, canvasWidget, &CanvasWidget::startGame); + setCentralWidget(canvasWidget); - + setupActions(); setFocusProxy(canvasWidget); - + QSize defaultSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); - setupGUI(defaultSize, - KXmlGuiWindow::Keys | KXmlGuiWindow::Save| KXmlGuiWindow::Create); + setupGUI(defaultSize, + KXmlGuiWindow::Keys | KXmlGuiWindow::Save | KXmlGuiWindow::Create); if (isFullScreen()) { menuBar()->hide(); @@ -94,48 +84,45 @@ } // show here (instead of in main) else the mouse can't be grabbed - show(); - gameEngine->start("default"); + show(); + gameEngine->start(QLatin1Literal("default")); } - + MainWindow::~MainWindow() { delete gameEngine; delete canvasWidget; } - + void MainWindow::setupActions() { - KStandardGameAction::gameNew(this, SLOT(startNewGame()), + KStandardGameAction::gameNew(this, SLOT(startNewGame()), actionCollection()); - + KStandardGameAction::quit(this, SLOT(close()), actionCollection()); - - KStandardGameAction::highscores(this, SLOT(showHighscores()), - actionCollection()); - - KStandardAction::preferences(this, SLOT(configureSettings()), - actionCollection()); - KAction *fullScreenAction = KStandardAction::fullScreen(this, - SLOT(viewFullScreen(bool)), this, actionCollection()); + KStandardGameAction::highscores(this, SLOT(showHighscores()), + actionCollection()); + + KStandardAction::preferences(this, SLOT(configureSettings()), + actionCollection()); + + QAction *fullScreenAction = KStandardAction::fullScreen(this, + SLOT(viewFullScreen(bool)), this, actionCollection()); // set the default primary shortcut as alternate shortcut // and make F the default - QKeySequence defaultShortcut = fullScreenAction->shortcut().primary(); - QKeySequence newPrimary(i18nc("Key (shortcut) to toggle full screen", "F")); - KShortcut fullScreenShortcut(newPrimary, defaultShortcut); + QKeySequence fullScreenShortcut(i18nc("Key (shortcut) to toggle full screen", "F")); fullScreenAction->setShortcut(fullScreenShortcut); - - KAction *fireAction = new KAction(this); + QAction *fireAction = new QAction(this); fireAction->setText(i18n("Fire the ball")); - fireAction->setShortcut(Qt::Key_Space); - fireAction->setIcon(KIcon( QLatin1String( "kbreakout" ))); - connect(fireAction, SIGNAL(triggered()), this, SLOT(fire())); - connect(fireAction, SIGNAL(changed()), canvasWidget, SLOT(updateFireShortcut())); - actionCollection()->addAction( QLatin1String( "fire" ), fireAction); + actionCollection()->setDefaultShortcut(fireAction, Qt::Key_Space); + fireAction->setIcon(QIcon::fromTheme(QLatin1String("kbreakout"))); + connect(fireAction, &QAction::triggered, this, &MainWindow::fire); + connect(fireAction, &QAction::changed, canvasWidget, &CanvasWidget::updateFireShortcut); + actionCollection()->addAction(QLatin1String("fire"), fireAction); pauseAction = KStandardGameAction::pause(this, - SLOT(setGamePaused(bool)), actionCollection()); + SLOT(setGamePaused(bool)), actionCollection()); // set custom keys QList keys; keys.append(i18nc("Key (shortcut) to pause the game", "P")); @@ -143,35 +130,35 @@ // the following won't work (no more than 2 shortcuts allowed..) // TODO: make the pause key work //keys.append(Qt::Key_Pause); - pauseAction->setShortcut(KShortcut(keys)); + pauseAction->setShortcuts(keys); } void MainWindow::configureSettings() { - if (KConfigDialog::showDialog("settings")) { + if (KConfigDialog::showDialog(QLatin1Literal("settings"))) { return; } // else it doesn't exist, thus create the dialog - - KConfigDialog *dialog = new KConfigDialog(this, "settings", - Settings::self()); + + KConfigDialog *dialog = new KConfigDialog(this, QLatin1Literal("settings"), + Settings::self()); dialog->setModal(true); - + dialog->addPage(new KgThemeSelector(canvasWidget->getProvider()), - i18n("Theme"), "games-config-theme" ); - + i18n("Theme"), QLatin1Literal("games-config-theme")); + // TODO: when will the page be destroyed? - dialog->addPage(new GeneralSettings( dialog ), + dialog->addPage(new GeneralSettings(dialog), i18nc("General settings", "General"), - "games-config-options"); - + QLatin1Literal("games-config-options")); + dialog->show(); } void MainWindow::showHighscores() { KScoreDialog ksdialog(KScoreDialog::Name | KScoreDialog::Level, this); - ksdialog.addField(KScoreDialog::Custom1, i18n(" Time (hh:mm)"), "moves"); + ksdialog.addField(KScoreDialog::Custom1, i18n(" Time (hh:mm)"), QLatin1Literal("moves")); ksdialog.exec(); } @@ -179,15 +166,15 @@ void MainWindow::startNewGame() { int ret = KMessageBox::warningYesNo( - this, - i18n("Starting a new game will end the current one!"), - i18n("New Game"), - KGuiItem(i18n("Start a New Game")), - KStandardGuiItem::cancel()); - + this, + i18n("Starting a new game will end the current one!"), + i18n("New Game"), + KGuiItem(i18n("Start a New Game")), + KStandardGuiItem::cancel()); + if (ret == KMessageBox::Yes) { pauseAction->setChecked(false); - gameEngine->start("default"); + gameEngine->start(QLatin1Literal("default")); } } @@ -205,13 +192,13 @@ void MainWindow::handleEndedGame(int score, int level, int time) { - + QTime t = QTime(0, 0).addSecs(time); // TODO: check int overflow and fix 24 hours "overflow" - QString timeString = t.toString("HH:mm"); - + QString timeString = t.toString(QLatin1Literal("HH:mm")); + const int ALL_LEVELS = -1; - + KScoreDialog::FieldInfo scoreInfo; scoreInfo[KScoreDialog::Score].setNum(score); scoreInfo[KScoreDialog::Custom1] = timeString; @@ -220,15 +207,15 @@ } else { scoreInfo[KScoreDialog::Level].setNum(level); } - + QPointer ksdialog = - new KScoreDialog(KScoreDialog::Name | KScoreDialog::Level, this); - ksdialog->addField(KScoreDialog::Custom1, i18n("Time (hh:mm)"), "moves"); + new KScoreDialog(KScoreDialog::Name | KScoreDialog::Level, this); + ksdialog->addField(KScoreDialog::Custom1, i18n("Time (hh:mm)"), QLatin1Literal("moves")); ksdialog->addScore(scoreInfo); ksdialog->exec(); - - if ( ksdialog ) { - gameEngine->start("default"); + + if (ksdialog) { + gameEngine->start(QLatin1Literal("default")); delete ksdialog; } } @@ -265,36 +252,38 @@ } // not fire on click - + // check if dontAskFireOnClick is set // we want to override it's default effect // if it's set to _any_ value we want to keep the // settings of fireOnClick at false bool dontAsk = false; // true if dontAskFireOnClick was set +#if 0 //QT5 KConfig config(componentData(), "kbreakoutrc"); if (config.hasGroup("Notification Messages")) { - KConfigGroup group( &config, "Notification Messages"); - if (group.hasKey("dontAskFireOnClick")) + KConfigGroup group(&config, "Notification Messages"); + if (group.hasKey("dontAskFireOnClick")) { dontAsk = true; + } } - +#endif if (dontAsk == false) { // ask the user if he wants to fire on mouse click - int res = KMessageBox::questionYesNo( - this, - i18n("Do you want to fire the ball on mouse click?\n" - "Answering Yes will make the game steal the\n" - "mouse cursor, pause the game to get\n" - "the cursor back."), - i18n("Fire on click?"), - KStandardGuiItem::yes(), - KStandardGuiItem::no(), - "dontAskFireOnClick" // doesntAskAgainName - ); - + int res = KMessageBox::questionYesNo( + this, + i18n("Do you want to fire the ball on mouse click?\n" + "Answering Yes will make the game steal the\n" + "mouse cursor, pause the game to get\n" + "the cursor back."), + i18n("Fire on click?"), + KStandardGuiItem::yes(), + KStandardGuiItem::no(), + QLatin1Literal("dontAskFireOnClick") // doesntAskAgainName + ); + if (res == KMessageBox::Yes) { - Settings::setFireOnClick(true); - Settings::self()->writeConfig(); + Settings::setFireOnClick(true); + Settings::self()->save(); } } } diff -Nru kbreakout-14.12.3/src/mainwindow.h kbreakout-15.04.2/src/mainwindow.h --- kbreakout-14.12.3/src/mainwindow.h 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/mainwindow.h 2015-04-14 05:28:15.000000000 +0000 @@ -1,17 +1,17 @@ /* - Copyright 2007-2008 Fela Winkelmolen + Copyright 2007-2008 Fela Winkelmolen Copyright 2010 Brian Croom - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -22,7 +22,6 @@ #include class GameEngine; -class KgThemeProvider; class CanvasWidget; class KToggleAction; @@ -30,7 +29,7 @@ { Q_OBJECT public: - MainWindow(QWidget *parent=0); + MainWindow(QWidget *parent = 0); ~MainWindow(); private slots: @@ -45,15 +44,15 @@ void setGamePaused(bool paused); void viewFullScreen(bool fullScreen); void handleMousePressed(); - + private: void setupActions(); KToggleAction *pauseAction; - + CanvasWidget *canvasWidget; GameEngine *gameEngine; - + }; - + #endif diff -Nru kbreakout-14.12.3/src/qml/Ball.qml kbreakout-15.04.2/src/qml/Ball.qml --- kbreakout-14.12.3/src/qml/Ball.qml 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/qml/Ball.qml 2015-04-14 05:28:15.000000000 +0000 @@ -15,7 +15,7 @@ along with this program. If not, see . */ -import QtQuick 1.1 +import QtQuick 2.3 import org.kde.games.core 0.1 as KgCore import "globals.js" as Globals diff -Nru kbreakout-14.12.3/src/qml/Bar.qml kbreakout-15.04.2/src/qml/Bar.qml --- kbreakout-14.12.3/src/qml/Bar.qml 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/qml/Bar.qml 2015-04-14 05:28:15.000000000 +0000 @@ -15,7 +15,7 @@ along with this program. If not, see . */ -import QtQuick 1.1 +import QtQuick 2.3 import org.kde.games.core 0.1 as KgCore import "globals.js" as Globals diff -Nru kbreakout-14.12.3/src/qml/Brick.qml kbreakout-15.04.2/src/qml/Brick.qml --- kbreakout-14.12.3/src/qml/Brick.qml 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/qml/Brick.qml 2015-04-14 05:28:15.000000000 +0000 @@ -15,7 +15,7 @@ along with this program. If not, see . */ -import QtQuick 1.1 +import QtQuick 2.3 import org.kde.games.core 0.1 as KgCore import "globals.js" as Globals diff -Nru kbreakout-14.12.3/src/qml/CanvasItem.qml kbreakout-15.04.2/src/qml/CanvasItem.qml --- kbreakout-14.12.3/src/qml/CanvasItem.qml 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/qml/CanvasItem.qml 2015-04-14 05:28:15.000000000 +0000 @@ -15,7 +15,7 @@ along with this program. If not, see . */ -import QtQuick 1.1 +import QtQuick 2.3 import org.kde.games.core 0.1 as KgCore KgCore.KgItem { diff -Nru kbreakout-14.12.3/src/qml/Gift.qml kbreakout-15.04.2/src/qml/Gift.qml --- kbreakout-14.12.3/src/qml/Gift.qml 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/qml/Gift.qml 2015-04-14 05:28:15.000000000 +0000 @@ -15,7 +15,7 @@ along with this program. If not, see . */ -import QtQuick 1.1 +import QtQuick 2.3 import org.kde.games.core 0.1 as KgCore import "globals.js" as Globals diff -Nru kbreakout-14.12.3/src/qml/main.qml kbreakout-15.04.2/src/qml/main.qml --- kbreakout-14.12.3/src/qml/main.qml 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/qml/main.qml 2015-04-14 05:28:15.000000000 +0000 @@ -15,7 +15,7 @@ along with this program. If not, see . */ -import QtQuick 1.1 +import QtQuick 2.3 import org.kde.games.core 0.1 as KgCore import "globals.js" as Globals import "logic.js" as Logic diff -Nru kbreakout-14.12.3/src/qml/Singleshot.qml kbreakout-15.04.2/src/qml/Singleshot.qml --- kbreakout-14.12.3/src/qml/Singleshot.qml 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/qml/Singleshot.qml 2015-04-14 05:28:15.000000000 +0000 @@ -15,7 +15,7 @@ along with this program. If not, see . */ -import QtQuick 1.1 +import QtQuick 2.3 Timer { signal timeout(variant target) diff -Nru kbreakout-14.12.3/src/qml/TextItem.qml kbreakout-15.04.2/src/qml/TextItem.qml --- kbreakout-14.12.3/src/qml/TextItem.qml 2014-12-30 08:53:49.000000000 +0000 +++ kbreakout-15.04.2/src/qml/TextItem.qml 2015-04-14 05:28:15.000000000 +0000 @@ -15,7 +15,7 @@ along with this program. If not, see . */ -import QtQuick 1.1 +import QtQuick 2.3 import org.kde.games.core 0.1 as KgCore import "globals.js" as Globals