1. 23 Aug, 2017 1 commit
  2. 27 Jul, 2017 1 commit
    • Julian Helfferich's avatar
      Fix incorrect resize before game is started · 6ee61601
      Julian Helfferich authored
      When the game window is resized before a game is started, the game scene is not correctly rescaled. When starting the game it might be too small (it seems never to be too large).
      
      This commit fixes the bug by triggering a fitInView() call of the gameView. The same function is triggered by a resize event.
      
      BUGS: 380464
      REVIEW: 130167
      6ee61601
  3. 15 Jul, 2017 1 commit
  4. 13 Jun, 2017 1 commit
  5. 08 Jun, 2017 1 commit
  6. 17 Mar, 2017 1 commit
  7. 13 Mar, 2017 1 commit
  8. 30 Jan, 2017 1 commit
  9. 20 Dec, 2016 2 commits
  10. 19 Aug, 2016 1 commit
  11. 12 Jun, 2016 1 commit
  12. 11 May, 2016 1 commit
    • Julian Helfferich's avatar
      Move QLoggingCategories to KBlocks_debug.h and KBlocks_debug.cpp · 76c2a223
      Julian Helfferich authored
      Before, the logging categories were declared in KBlocksDefine.h. They
      are moved into the new file KBlocks_debug.h to be consistent with other
      KDE Games. Similarly, the QLoggingCategory declaration from
      AI/KBlocksAITypeDefine.h is moved to KBlocks_debug.h. The file
      AI/KBlocksAITypeDefine.cpp is no longer needed.
      76c2a223
  13. 10 May, 2016 1 commit
  14. 30 Apr, 2016 2 commits
    • Julian Helfferich's avatar
      Fix Coverity #76255: Calling risky function · 12860515
      Julian Helfferich authored
      When loading a plain text replay file, fscanf() was used. The use of
      this function is discouraged as it can lead to buffer overflows if the
      string read is larger than the reserved buffer.
      
      Now, the C-style functions are replaced with their C++ equivalents.
      This means the data is read from an ifstream and stored to a string via
      an istringstream.
      12860515
    • Frederik Schwarzer's avatar
      Add .gitignore file. · 0a4622ce
      Frederik Schwarzer authored
      0a4622ce
  15. 26 Apr, 2016 3 commits
    • Julian Helfferich's avatar
      Check for NULL pointers · 4c443768
      Julian Helfferich authored
      If the replay file can not be loaded, several pointers are set to NULL.
      In this case, several member functions crash if called.
      
      At the moment, these functions are not called since main checks if the
      replay file has been loaded successfully. However, if the check is
      omitted and the replay file cannot be loaded, the program crashes.
      
      I have added checks for NULL pointers in the member functions of
      KBlocksRepWin. Now, the program does not crash even if the check is
      omitted.
      4c443768
    • Julian Helfferich's avatar
      Fix Coverity #76268: Uninitialized members · 1b65c40f
      Julian Helfferich authored
      If the passed replay file can not be loaded, several pointers are not
      set. They are currently not accessed since an error is shown in
      main.cpp when the file cannot be loaded, but it is good practice to set
      them anyhow.
      1b65c40f
    • Julian Helfferich's avatar
      Fix Coverity #76262: Unchecked dynamic_cast · 9a1d8558
      Julian Helfferich authored
      dynamic_cast can return a NULL pointer. I added a check that the
      pointer is not NULL before it is dereferenced.
      9a1d8558
  16. 25 Apr, 2016 1 commit
  17. 24 Apr, 2016 1 commit
    • Julian Helfferich's avatar
      Fix Coverity #76278: Uninitialized member · 2c10cda9
      Julian Helfferich authored
      Member mRunning was uninitialized in the constructor of
      KBlocksPlayNetwork. Even though this member, which indicates whether a
      game is executed, is always initialized before it is used, it is good
      practice to initialize it in the constructor.
      
      It is now set to False in the constructor, indicating that no game is
      executed.
      2c10cda9
  18. 22 Apr, 2016 2 commits
  19. 21 Apr, 2016 4 commits
    • Julian Helfferich's avatar
      Fix Coverity #76275: Uninitialized pointer · 12c29cde
      Julian Helfferich authored
      The pointer mpGame in GamePlayerInterface was not initialized in the
      constructor.
      
      I noticed that both childs of GamePlayerInterface -- KBlocksDummyAI and
      KBlocksAIPlayer -- redeclare and hide mpGame instead of using the
      parent class member.
      
      I have removed the duplicate members in the child classes and initialize
      the pointer with nullptr.
      12c29cde
    • Julian Helfferich's avatar
      Fix Coverity #76274: Uninitialized members · 05ebfcbb
      Julian Helfferich authored
      In KBlocksGameLogic constructor mInitialInterval and mLevelUpInterval
      are uninitialized. I have set them to their default values for AI mode.
      
      This patch actually fixes Coverity #76280 while the fix for
      Coverity #76280 in fact fixed Coverity #76274. The confusion was due to
      the fact that both members were missing in both constructors and
      Coverity tracks them as separate issues. Now, both are fixed.
      05ebfcbb
    • Julian Helfferich's avatar
      Fix Coverity #76273: Uninitialized members · 75ddf0f4
      Julian Helfferich authored
      Pointer maGameList is not initialized in the constructor of
      GameLogicInterface. This class is an abstract base class and the pointer
      is initialized in the constructor of the only child class.
      
      Nonetheless, I have now set the pointer to nullptr in the initializer
      list of GameLogicInterface.
      75ddf0f4
    • Julian Helfferich's avatar
      Fix Coverity #76272: Uninitialized members · 700908db
      Julian Helfferich authored
      In KBlocksGameReplayer constructor some member variables remain
      uninitialized in case the replay file cannot be opened. In this case,
      the game replayer is useless and the list of records always empty.
      
      However, I set the variables anyhow.
      700908db
  20. 20 Apr, 2016 3 commits
  21. 19 Apr, 2016 1 commit
    • Julian Helfferich's avatar
      Fix Coverity #76269: Uninitialized member · 9cea9079
      Julian Helfferich authored
      The uninitialized member in question is the pointer mMessageBox. The
      message box will be created in createGameItemGroups() and deleted in
      deleteGameItemGroups(). I set the pointer to nullptr in the constructor.
      9cea9079
  22. 17 Apr, 2016 1 commit
    • Julian Helfferich's avatar
      Fix Coverity #76268: Comment out unused member variable · c9b88347
      Julian Helfferich authored
      Coverity complained that the member variable wasn't initialized. I
      found out, that it is, in fact, never used. Thus, I commented it out. I
      didn't remove it as it indicates functionality that isn't implemented
      but makes sense from a design view.
      c9b88347
  23. 14 Apr, 2016 1 commit
    • Julian Helfferich's avatar
      Fix Coverity #76267: Initialize values for SingleGameInterface · 1a646cd2
      Julian Helfferich authored
      Use initializer list to set member variables to their default values.
      The SingleGameInterface constructor should, however, only be called
      from the KBlocksSingleGame constructor which subsequently sets the
      variables to other values determined from the parameters to
      KBlocksSingleGame().
      
      Nonetheless, it is good practice to make sure that all variables will
      be initialized.
      1a646cd2
  24. 10 Apr, 2016 1 commit
  25. 07 Apr, 2016 1 commit
  26. 03 Apr, 2016 1 commit
    • Julian Helfferich's avatar
      Fix Coverity #76266: Initialize members, make constructor protected · 06321d62
      Julian Helfferich authored
      FieldInterface is a purely abstract class used as a base class for
      KBlocksField. Thus its constructor should be protected meaning that it
      can be called during the construction of KBlocksField, but calling
      FieldInterface fi = new FieldInterface() would fail.
      
      Also, the member variables are now initialized to their default values
      maBoard = nullptr, mWidth = 0, and mHeight = 0.
      06321d62
  27. 02 Apr, 2016 1 commit
    • Julian Helfferich's avatar
      Fix Coverty #76265: Make check for array bounds explicit · 2b096066
      Julian Helfferich authored
      Before, the function KBlocksField::getCell() checked that the variable
      cx was in bounds, i.e. larger than zero and smaller than the width of
      the play field. The check that cx is in bounds is important as it is
      used to index an array.
      
      Now, the check is done explicitely in KBlocksAIPlanner::process. It is
      good practice not to rely too much on a subfunction.
      2b096066
  28. 31 Mar, 2016 1 commit
    • Julian Helfferich's avatar
      Replace QDebug wich QLoggingCategory · 8e1227d4
      Julian Helfferich authored
      qDebug() and qWarning() have been used in KBlocksSound and
      KBlocksGraphics. I have replaced all occurences with qCDebug() and
      qCWarning(), using two new logging categories "KBlocks.Sound" and
      "KBlocks.Graphics".
      8e1227d4
  29. 30 Mar, 2016 2 commits
    • Julian Helfferich's avatar
      Fix Coverty #76262: Check for NULL pointer · 3994f7c3
      Julian Helfferich authored
      KBlocksAIPlayer::planning() did not check if pointer mpPlanner is NULL.
      This check has been added and if mpPlanner is NULL a warning is issued
      and the function left.
      
      I have tested this case by commenting out the creation of the Planner.
      As expected, the AI issues warnings that no planner has been set and
      behaves extremely stupid (all Blocks just drop without moving or
      rotating). No crash is encountered.
      3994f7c3
    • Julian Helfferich's avatar
      Introduce QLoggingCategories · eb9ad859
      Julian Helfferich authored
      QLoggingCategories KBlocksGeneral and KBlocksAI are introduced in
      KBlocksDefine.{h,cpp} and AI/KBlocksTypeDefine.{h,cpp}.
      eb9ad859