1. 29 Jan, 2021 1 commit
  2. 24 Jan, 2021 16 commits
    • Julian Helfferich's avatar
      Add missing initialization · 086563d9
      Julian Helfferich authored
    • Julian Helfferich's avatar
      Refresh items also on game over · 5e9bd5a1
      Julian Helfferich authored
      If items are not refreshed, the final piece (causing the game to be
      over) will be invisible. With this change, it will be correctly
      displayed, making it obvious why the game is over.
    • Julian Helfferich's avatar
      Create SvgItemInterface · 2d6f98c5
      Julian Helfferich authored
      To be able to test the next step in the bugfix, I need to verify the
      actions taken on a KBlocksSvgItem object. Thus, I want to replace it
      with a mock object. To make this possible, I have created a
      SvgItemInterface class and replaced all necessary KBlocksSvgItem
      pointers with SvgItemInterface pointers.
    • Julian Helfferich's avatar
      Do not call setupGui() in KBlocksWin constructor · 17b25472
      Julian Helfferich authored
      This function makes it more difficult to build unit tests for
      KBlocksWin. A better way is to make this a public member and call it
      explicitely after the KBlocksWin object has been created.
    • Julian Helfferich's avatar
      Do not create KBlocksGraphics and KBlocksSound objects in KBlocksScene · 13fc0e56
      Julian Helfferich authored
      Complex objects being created in constructors is always a big headache
      for unit tests, particularly in C++, because constructor calls can't be
      avoided and neither can the work be delegated to a virtual member
      Instead of creating the objects, KBlocksScene now takes them as input
      This reduces the number of warnings in the UnitTest-KBlocksWin test
      suite to one.
    • Julian Helfferich's avatar
      Remove mpGameScene member from KBlocksView · 140e1188
      Julian Helfferich authored
      KBlocksView actually stored two pointers to the same Scene object. The
      parent QGraphicsView stores a QGraphicsScene pointer, accessible via
      scene() and setScene(). And KBlocksView also stored a SceneInterface
      pointer as a private member function.
      This could lead to confusing behavior. For example, calling setScene()
      on the KBlocksView object only replaces one of the two pointers. I have
      removed the private mpGameScene member. The scene is now always accessed
      via the scene() interface.
    • Julian Helfferich's avatar
      Move definition of TestingKBlocksWin to .cpp file · 3a0a84f9
      Julian Helfferich authored
      This requires that the cpp file is compiled into a new KBlocksTesting
      library against which the KBlocksWin test is linked.
    • Julian Helfferich's avatar
      Do not return status in deleteSingleGames() method · fcb0babd
      Julian Helfferich authored
      The status was determined by whether single games were created before
      the call to deleteSingleGames(). The better way to check this is to use
      the new hasSingleGames() functionality as it is now done in KBlocksWin.
    • Julian Helfferich's avatar
      Create new method in game logic: hasSingleGames() · 288c346a
      Julian Helfferich authored
      Using this new functionality, the KBlocksWin::stopGame() method can be
      improved and made more readable. The check if single games were created
      are now made explicit.
    • Julian Helfferich's avatar
      Fix the test and fix the crash · 1d2ae0cc
      Julian Helfferich authored
      To fix the issue, I introduced a test whether the game logic object has
      created single games (by trying to access one). Only if the game logic
      object has single games, stop game and delete single games is called.
      I have also confirmed by manual testing that the game no longer crashes
      when (re)starting a game after the first one.
      The test is not as unit-test-y as I would like: Several QWARN are
      issued. Furthermore, there is another option to improve usability:
      The last piece is also placed ontop of an existing piece, triggering a
      game over. However, this final piece is still invisible.
    • Julian Helfferich's avatar
      Add test that stopGame is not called after single games are deleted · a3e9b5fe
      Julian Helfferich authored
      To fix the bug I am targeting, stopGame() triggers an update of the
      layout, which includes processing the remaining game actions. To do
      this, the corresponding single game objects need to still exist.
      In this commit, I have just created the test. It is currently failing.
    • Julian Helfferich's avatar
      Replace KBlocksGameLogic with GameLogicInterface in KBlocksWin · e426bdca
      Julian Helfferich authored
      To be able to sense the actions performed on the game logic element, I
      want to be able to replace the GameLogic with a Mock object.
    • Julian Helfferich's avatar
      Remove unused code · 2702d854
      Julian Helfferich authored
      Removed function with fully commented-out body that was never used
    • Julian Helfferich's avatar
      Use SceneInterface also in KBlocksWin · 283a4c99
      Julian Helfferich authored
      The goal is still to be able to use a MockScene in KBlocksWin that can
      be used in unit testing.
    • Julian Helfferich's avatar
      Create SceneInterface · 454ad0ad
      Julian Helfferich authored
      Later on, I want to create a MockScene object in order to sense the
      changes done to the scene by the KBlocksWin class.
    • Julian Helfferich's avatar
      Call updateLayout() also in stopGame() · fc3fd5cd
      Julian Helfferich authored
      Calling updateLayout() means that all remaining game actions are
      processed when the game is intended to be stopped. This has the effect
      that the play area is updated before the highscore window is shown,
      not at a later time.
      BUG: 407244
  3. 21 Jan, 2021 1 commit
  4. 20 Jan, 2021 6 commits
  5. 16 Jan, 2021 4 commits
    • Julian Helfferich's avatar
      Rename source variables · fcc4eec5
      Julian Helfferich authored
      Following Albert Astals Cid's advice and make them more idiomatical.
    • Julian Helfferich's avatar
      Create variable for ecm_add_app_icon · c9c95275
      Julian Helfferich authored
      From the ecm_add_app_icon documentation:
        The given icons [...] will be added to the executable target whose
        sources are specified by <sources_var> [...]
      It will probably fail with the sources_var being defined in the
      subdirectory and used for the library. In any way, the new version
      is cleaner and therefore preferable in any case.
    • Julian Helfferich's avatar
      Include directories statement can be removed from src/CMakeLists.txt · b91d0b69
      Julian Helfferich authored
      This statement was put there since the settings.h and settings.cpp files
      would be generated in the base directory. The statement was never
      necessary, as the kconfig_add_kcfg_files command already takes care of
      the include path.
    • Julian Helfferich's avatar
      Put config files in subdirectory of src · e1cc67b6
      Julian Helfferich authored
      It is standard procedure to put the configuration files alongside the
      source files. I find it the cleanest solution to put them in a dedicated
      subdirectory, such as config/ (as done for Konsole and Yakuake, for
  6. 15 Jan, 2021 7 commits
  7. 06 Jan, 2021 1 commit
  8. 05 Jan, 2021 1 commit
  9. 02 Jan, 2021 1 commit
  10. 20 Dec, 2020 1 commit
  11. 02 Dec, 2020 1 commit