1. 19 Apr, 2020 6 commits
    • Mario Aichinger's avatar
      Add save and reset state functionality to the crop tool · 3da2a238
      Mario Aichinger authored
      Summary:
      The state is saved after the crop tool emits CropTool::done and gets
      recalled if a new CropTool is created. The state also gets reset by
      hitting the newly added reset button in the QDialogButtonBox of the
      CropTool. The state also gets reset if the saved crop rectangle is
      not within the image which is about to be cropped.
      
      The use case for this is cropping the multiple images to the same
      area. Like removing boarders of a series of pictures taken in a
      photo both.
      
      Test Plan:
      Select the first image. Use the crop tool to crop it to region.
      Click "Crop".
      Select an image with the same or a larger size.
      Select the crop tool.
      The selection area should now be the same as used on the first image.
      Hitting the reset button should reset all parameters to the defaults.
      
      Alternatively: instead of the second (equal or larger) image select a image smaller than the crop area.
      Again use the crop tool.
      The selection should now cover the whole image.
      
      Reviewers: #gwenview, ngraham
      
      Reviewed By: #gwenview, ngraham
      
      Subscribers: ngraham
      
      Tags: #gwenview
      
      Differential Revision: https://phabricator.kde.org/D28480
      3da2a238
    • Martin Tobias Holmedahl Sandsmark's avatar
      Fix leaking ThumbnailGenerators · 4f7d35d1
      Martin Tobias Holmedahl Sandsmark authored
      The logic for deleting ThumbnailGenerators was kind of broken, so fix
      that.
      
      Not sure if this is the right approach, but it doesn't seem racy (and
      can't trigger any races), and doesn't leak anymore.
      
      Test Plan: Run with asan and ubsan, open folders with many thumbnails,
      scroll around.
      
      Reviewed By: ngraham
      
      Differential Revision: https://phabricator.kde.org/D28346
      4f7d35d1
    • Martin Tobias Holmedahl Sandsmark's avatar
      Fix undefined behavior by calling on almost destroyed object · 2f48c626
      Martin Tobias Holmedahl Sandsmark authored
      Because mView is in the process of being destroyed we shouldn't try to touch it too much.
      
      Warning from ubsan:
          runtime error: member call on address 0x606000118e80 which does not
          point to an object of type 'QAbstractScrollArea'
      
      Reviewed By: ngraham
      
      Differential Revision: https://phabricator.kde.org/D28342
      2f48c626
    • Martin Tobias Holmedahl Sandsmark's avatar
      Fix leak of Rows in infocontextmanageritem · 24e88113
      Martin Tobias Holmedahl Sandsmark authored
      Pretty straightforward, KeyValueWidget didn't delete its rows.
      
      Reviewed By: ngraham
      
      Differential Revision: https://phabricator.kde.org/D28343
      24e88113
    • Martin Tobias Holmedahl Sandsmark's avatar
      Fix memory leak in CMS · e2e90597
      Martin Tobias Holmedahl Sandsmark authored
      Quoting iccjpeg.h:
        * IMPORTANT: the data at **icc_data_ptr has been allocated with malloc()
        * and must be freed by the caller with free() when the caller no longer
        * needs it.  (Alternatively, we could write this routine to use the
        * IJG library's memory allocator, so that the data would be freed implicitly
        * at jpeg_finish_decompress() time.  But it seems likely that many apps
        * will prefer to have the data stick around after decompression finishes.)
      
      Reviewed By: ngraham
      
      Differential Revision: https://phabricator.kde.org/D28344
      e2e90597
    • Martin Tobias Holmedahl Sandsmark's avatar
      Fix segfault/call on invalid pointer · 6cc5a511
      Martin Tobias Holmedahl Sandsmark authored
      We didn't set the AbstractImageView in AbstractImageViewPrivate early
      enough, and createAlphaBackgroundTexture() tried to call stuff on q.
      
      Quote from asan:
      
      ==161679==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fa8cdcc193a bp 0x7ffe601e4a00 sp 0x7ffe601e48f0 T0)
      ==161679==The signal is caused by a READ memory access.
      ==161679==Hint: address points to the zero page.
          #0 0x7fa8cdcc1939 in Gwenview::AbstractImageViewPrivate::createAlphaBackgroundTexture() (gwenview/build/bin/libgwenviewlib.so.5+0x108a939)
          #1 0x7fa8cdcc28b8 in Gwenview::AbstractImageViewPrivate::AbstractImageViewPrivate() (gwenview/build/bin/libgwenviewlib.so.5+0x108b8b8)
          #2 0x7fa8cdca46a2 in Gwenview::AbstractImageView::AbstractImageView(QGraphicsItem*) ../lib/documentview/abstractimageview.cpp:145
          #3 0x7fa8cdd500a5 in Gwenview::RasterImageView::RasterImageView(QGraphicsItem*) ../lib/documentview/rasterimageview.cpp:194
      
      Reviewed By: ngraham
      
      Differential Revision: https://phabricator.kde.org/D28345
      6cc5a511
  2. 15 Apr, 2020 1 commit
  3. 06 Apr, 2020 2 commits
    • Martin Tobias Holmedahl Sandsmark's avatar
      Don't fill disk with thumbnails if thumbnail saving is turned off · a585df06
      Martin Tobias Holmedahl Sandsmark authored
      Even if "low resource usage mode" is turned on, which says it avoids
      storing thumbnails to disk to save space, it still stores thumbnails to
      disk. It just deletes _all_ thumbnails afterwards (even those not from
      gwenview itself).
      
      This was also kind of racy, because thumbnailwriter could still be
      running, but the folders would be deleted, so it spammed a ton of error
      messages.
      
      Test Plan:
      Doesn't store thumbnails when it shouldn't anymore, doesn't
      delete thumbnails from other applications nor the thumbnail folders,
      thumbnailwriter doesn't spaz out during exit, stores thumbnails when it
      should.
      
      Differential Revision: https://phabricator.kde.org/D28375
      a585df06
    • Martin Tobias Holmedahl Sandsmark's avatar
      Make it possible to shut up gwenview with e.g. kdebugdialog · 662c29b3
      Martin Tobias Holmedahl Sandsmark authored
      exiv2 lets us register a log handler, so it's fairly straight forward to
      put our own that maps it to qC{Warning,Debug,Info} with a proper
      category. This allows people who're not interested in exiv2 spam turn it
      off.
      
      It only shows "Critical" by default, so supress everything, the warning
      messages aren't really useful and the "real" error messages are already
      stored in Exiv2ImageLoader.
      
      Differential Revision: https://phabricator.kde.org/D28376
      662c29b3
  4. 31 Mar, 2020 1 commit
  5. 28 Mar, 2020 1 commit
  6. 27 Mar, 2020 1 commit
  7. 17 Mar, 2020 2 commits
    • Nate Graham's avatar
      Merge branch 'release/20.04' · 4fa4d1fc
      Nate Graham authored
      4fa4d1fc
    • Nate Graham's avatar
      Give Exit Full Screen and Configure buttons text and adjust wording · 435d2ad1
      Nate Graham authored
      Summary:
      Unlike Kate, Gwenview's {nav Exit Full Screen} button is icons-only, impeding
      discoverability. This patch shows its action's text, and adjusts that text to be more
      consistent with the typical wording.
      
      In the process, the button below it is also given visible text to avoid making it look
      odd in its layout.
      
      To accomplish this technically, the `FullScreenToolBar` class's `addAction()` function
      is given a new optional parameter for specifying if and where the button's text should
      appear, which is then used to give the aforementioned buttons visible text according to
      the user's toolbutton text display preferences. The actions are also no longer marked
      with the Low Priority status, which forces them to be always icons-only and was
      previously redundant since icons-only status was forced in a different way. Fixed now.
      
      BUG: 385314
      FIXED-IN: 20.04.0
      
      Test Plan: {F8176526}
      
      Reviewers: #gwenview, #vdg, broulik
      
      Reviewed By: broulik
      
      Tags: #gwenview
      
      Differential Revision: https://phabricator.kde.org/D28052
      435d2ad1
  8. 16 Mar, 2020 2 commits
  9. 15 Mar, 2020 2 commits
  10. 20 Feb, 2020 1 commit
  11. 19 Feb, 2020 2 commits
  12. 16 Feb, 2020 1 commit
  13. 03 Feb, 2020 2 commits
  14. 02 Feb, 2020 1 commit
  15. 09 Jan, 2020 4 commits
  16. 08 Jan, 2020 1 commit
    • Tasos Sahanidis's avatar
      Prevent drag & drop if left mouse button isn't pressed · f17fb1bd
      Tasos Sahanidis authored
      Summary:
      It is possible to begin a drag & drop sequence using the forward/backward mouse buttons while moving the cursor.
      For example:
      
      > QGraphicsSceneMouseEvent(GraphicsSceneMouseMove, buttons=ForwardButton|XButton2|ExtraButton2, pos=347,127, scenePos=347,127, screenPos=398,255)
      
      This patch only allows drag & drop if the left mouse button is pressed.
      Touch events should not be affected as they are handled separately.
      
      Reviewers: ngraham
      
      Reviewed By: ngraham
      
      Subscribers: ngraham
      
      Tags: #gwenview
      
      Differential Revision: https://phabricator.kde.org/D26507
      f17fb1bd
  17. 06 Jan, 2020 1 commit
  18. 05 Jan, 2020 1 commit
  19. 04 Jan, 2020 1 commit
  20. 03 Jan, 2020 1 commit
  21. 28 Dec, 2019 1 commit
  22. 26 Dec, 2019 1 commit
    • Madhav Kanbur's avatar
      Add button to toggle sidebar in fullscreen mode · db6ca614
      Madhav Kanbur authored
      Summary:
      Previously, there was no way to toggle the sidebar in
      fullscreen view mode except for the keyboard shortcut F4. This patch
      adds a button to toggle the sidebar from the fullscreen toolbar.
      BUG: 414694
      
      Test Plan:
      Tested the button in fullscreen (view) mode. Button works
      as expected, and preserves existing behavior of all other sidebar
      toggle mechanisms as well.
      
      Reviewers: #vdg, #gwenview, ngraham
      
      Subscribers: #gwenview
      
      Tags: #gwenview
      
      Differential Revision: https://phabricator.kde.org/D26230
      db6ca614
  23. 19 Dec, 2019 1 commit
  24. 07 Dec, 2019 1 commit
  25. 05 Dec, 2019 2 commits