Skip to content

Commit

Permalink
Fixed Qt5 crash. Do not use image browser by default due to needed ex…
Browse files Browse the repository at this point in the history
…tra permissions.
  • Loading branch information
chronoscz committed Dec 16, 2024
1 parent 2a20fa8 commit 5da0ba0
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Install/flatpak/0001-avoid-crash-on-Qt5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From d73455025d71226472e7eb880da36f6fb85c5df0 Mon Sep 17 00:00:00 2001
From: Johann ELSASS <circular@fastmail.com>
Date: Thu, 6 Oct 2022 21:44:47 +0200
Subject: [PATCH] avoid crash on Qt5

---
lazpaint/lazpaintinstance.pas | 1 +
lazpaint/lazpaintmainform.pas | 1 +
2 files changed, 2 insertions(+)

diff --git a/lazpaint/lazpaintinstance.pas b/lazpaint/lazpaintinstance.pas
index 5da9ac6..b5f624b 100644
--- a/lazpaint/lazpaintinstance.pas
+++ b/lazpaint/lazpaintinstance.pas
@@ -374,6 +374,7 @@ procedure TLazPaintInstance.ReportActionProgress(AProgressPercent: integer);
var
delay: Integer;
begin
+ {$IFDEF LCLqt5}exit;{$ENDIF}
if AProgressPercent < 100 then delay := 10000 else delay := 1000;
if Assigned(FMain) then FMain.UpdatingPopup:= true;
try
diff --git a/lazpaint/lazpaintmainform.pas b/lazpaint/lazpaintmainform.pas
index 0fe875c..708cb24 100644
--- a/lazpaint/lazpaintmainform.pas
+++ b/lazpaint/lazpaintmainform.pas
@@ -2695,6 +2695,7 @@ end;

procedure TFMain.TimerUpdateTimer(Sender: TObject);
begin
+ if FLazPaintInstance = nil then exit;
TimerUpdate.Enabled := false;
if ToolManager.ToolSleeping and not spacePressed and
([ssLeft,ssRight,ssMiddle] * FLayout.MouseButtonState = []) then
--
2.43.0

4 changes: 4 additions & 0 deletions Install/flatpak/io.github.bgrabitmap.LazPaint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ modules:
path: io.github.bgrabitmap.LazPaint.metainfo.xml
- type: patch
path: 0001-515-runtime-fix-for-Qt.patch
- type: patch
path: 0001-avoid-crash-on-Qt5.patch
- type: patch
path: no-image-browser-by-default.patch
buildsystem: simple
build-commands:
- |
Expand Down
13 changes: 13 additions & 0 deletions Install/flatpak/no-image-browser-by-default.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lazpaint/uconfig.pas b/lazpaint/uconfig.pas
index ee16357..b13b491 100644
--- a/lazpaint/uconfig.pas
+++ b/lazpaint/uconfig.pas
@@ -804,7 +804,7 @@ end;

function TLazPaintConfig.DefaultUseImageBrowser: boolean;
begin
- result := iniOptions.ReadBool('General','UseImageBrowser',{$IFDEF DARWIN}false{$ELSE}true{$ENDIF});
+ result := iniOptions.ReadBool('General','UseImageBrowser',{$IFDEF DARWIN}false{$ELSE}false{$ENDIF});
end;

procedure TLazPaintConfig.SetDefaultUseImageBrowser(value: boolean);

0 comments on commit 5da0ba0

Please sign in to comment.