diff -Nru ddrescueview-0.4~alpha4/changelog.txt ddrescueview-0.4.5/changelog.txt --- ddrescueview-0.4~alpha4/changelog.txt 2020-09-01 14:23:54.000000000 +0000 +++ ddrescueview-0.4.5/changelog.txt 2022-02-25 08:17:58.000000000 +0000 @@ -1,5 +1,15 @@ +#### v0.4.5 #### +Released 2022-02-25 + +- Fixed an issue that emerged with the mapfile backup mechanism in ddrescue 1.24 and later. + When an update interval was set in ddrescueview, the program would be stuck on the backup version + of the mapfile, causing no progress to be shown over time. + With this patch, ddrescueview avoids the issue by re-opening the file every time it needs to be read. +- Abandoned the nonsensical versioning scheme (alpha x - labled versions) + #### v0.4 alpha 4 #### Released 2020-09-01 + - Updated to compile on FPC 3.2.0 without errors. Thanks to Peter Green for the patch. - It's now possible to select a range on the Zoom Bar using right click dragging, just like on the Block Grid. - Added an option in the Settings to zoom in on mouse position without centering the Block Grid on that position. diff -Nru ddrescueview-0.4~alpha4/debian/changelog ddrescueview-0.4.5/debian/changelog --- ddrescueview-0.4~alpha4/debian/changelog 2022-03-09 23:48:39.000000000 +0000 +++ ddrescueview-0.4.5/debian/changelog 2022-04-11 19:29:55.000000000 +0000 @@ -1,8 +1,15 @@ -ddrescueview (0.4~alpha4-2build1) jammy; urgency=medium +ddrescueview (0.4.5-1) unstable; urgency=medium - * No-change rebuild against latest gdk-pixbuf + [ Debian Janitor ] + * Fix field name typo in debian/copyright (Uptream-Contact => + Upstream-Contact). - -- Jeremy Bicha Wed, 09 Mar 2022 18:48:39 -0500 + [ Graham Inggs ] + * New upstream release + * Update debian/copyright + * Bump Standards-Version to 4.6.0, no changes + + -- Graham Inggs Mon, 11 Apr 2022 19:29:55 +0000 ddrescueview (0.4~alpha4-2) unstable; urgency=medium diff -Nru ddrescueview-0.4~alpha4/debian/control ddrescueview-0.4.5/debian/control --- ddrescueview-0.4~alpha4/debian/control 2020-10-25 18:04:02.000000000 +0000 +++ ddrescueview-0.4.5/debian/control 2022-04-11 19:22:34.000000000 +0000 @@ -9,7 +9,7 @@ lcl-units, lcl-utils, libgtk2.0-dev -Standards-Version: 4.5.0 +Standards-Version: 4.6.0 Rules-Requires-Root: no Vcs-Git: https://salsa.debian.org/pascal-team/ddrescueview.git Vcs-Browser: https://salsa.debian.org/pascal-team/ddrescueview diff -Nru ddrescueview-0.4~alpha4/debian/copyright ddrescueview-0.4.5/debian/copyright --- ddrescueview-0.4~alpha4/debian/copyright 2020-09-02 20:02:45.000000000 +0000 +++ ddrescueview-0.4.5/debian/copyright 2022-04-11 19:20:41.000000000 +0000 @@ -1,14 +1,14 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ddrescueview -Uptream-Contact: Martin Bittermann Source: https://sourceforge.net/projects/ddrescueview/ +Upstream-Contact: Martin Bittermann Files: * -Copyright: 2013-2020 Martin Bittermann +Copyright: 2013-2022 Martin Bittermann License: GPL-3.0+ Files: debian/* -Copyright: 2015-2020 Graham Inggs +Copyright: 2015-2022 Graham Inggs License: GPL-3.0+ License: GPL-3.0+ diff -Nru ddrescueview-0.4~alpha4/source/About.pas ddrescueview-0.4.5/source/About.pas --- ddrescueview-0.4~alpha4/source/About.pas 2020-08-30 21:30:41.000000000 +0000 +++ ddrescueview-0.4.5/source/About.pas 2022-02-23 10:29:26.000000000 +0000 @@ -1,7 +1,7 @@ (* About.pas - About Box unit - Copyright (C) 2013 - 2020 Martin Bittermann (martinbittermann@gmx.de) + Copyright (C) 2013 - 2022 Martin Bittermann (martinbittermann@gmx.de) This file is part of ddrescueview. @@ -50,7 +50,7 @@ AboutBox: TAboutBox; implementation -uses Shared; +uses Shared, SysUtils; {$R *.lfm} @@ -58,8 +58,8 @@ procedure TAboutBox.FormCreate(Sender: TObject); begin - Version.Caption := 'Version ' + VERSION_MAJOR + '.' + VERSION_MINOR + - ' ' + VERSION_SUFFIX; + Version.Caption := Format('Version %s.%s.%s %s', + [VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_SUFFIX]); end; procedure TAboutBox.FormShow(Sender: TObject); diff -Nru ddrescueview-0.4~alpha4/source/BlockInspector.pas ddrescueview-0.4.5/source/BlockInspector.pas --- ddrescueview-0.4~alpha4/source/BlockInspector.pas 2020-08-28 21:21:45.000000000 +0000 +++ ddrescueview-0.4.5/source/BlockInspector.pas 2022-02-23 10:09:54.000000000 +0000 @@ -1,7 +1,7 @@ (* BlockInspector.pas - Grid Block Inspector unit - Copyright (C) 2013 - 2020 Martin Bittermann (martinbittermann@gmx.de) + Copyright (C) 2013 - 2022 Martin Bittermann (martinbittermann@gmx.de) This file is part of ddrescueview. diff -Nru ddrescueview-0.4~alpha4/source/ddrescueview.lpi ddrescueview-0.4.5/source/ddrescueview.lpi --- ddrescueview-0.4~alpha4/source/ddrescueview.lpi 2020-09-01 14:33:16.000000000 +0000 +++ ddrescueview-0.4.5/source/ddrescueview.lpi 2022-02-25 15:47:26.000000000 +0000 @@ -24,12 +24,13 @@ + - + - - + + @@ -76,7 +77,47 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -114,7 +155,7 @@ - + @@ -197,7 +238,6 @@ - @@ -222,17 +262,4 @@ - - - - - - - - - - - - - diff -Nru ddrescueview-0.4~alpha4/source/ddrescueview.lpr ddrescueview-0.4.5/source/ddrescueview.lpr --- ddrescueview-0.4~alpha4/source/ddrescueview.lpr 2020-08-20 23:13:42.000000000 +0000 +++ ddrescueview-0.4.5/source/ddrescueview.lpr 2022-02-23 10:09:58.000000000 +0000 @@ -1,7 +1,7 @@ (* ddrescueview.lpr - main program of ddrescueview - Copyright (C) 2013 - 2020 Martin Bittermann (martinbittermann@gmx.de) + Copyright (C) 2013 - 2022 Martin Bittermann (martinbittermann@gmx.de) This file is part of ddrescueview. diff -Nru ddrescueview-0.4~alpha4/source/GUI.lfm ddrescueview-0.4.5/source/GUI.lfm --- ddrescueview-0.4~alpha4/source/GUI.lfm 2020-08-28 01:11:47.000000000 +0000 +++ ddrescueview-0.4.5/source/GUI.lfm 2022-02-25 15:47:26.000000000 +0000 @@ -1,11 +1,11 @@ object MainForm: TMainForm - Left = 1251 + Left = 985 Height = 439 - Top = 468 + Top = 396 Width = 615 AllowDropFiles = True Caption = 'ddrescueview' - ClientHeight = 419 + ClientHeight = 415 ClientWidth = 615 Color = clForm Constraints.MinHeight = 200 @@ -21,21 +21,21 @@ LCLVersion = '2.0.10.0' object TopPanel: TPanel Left = 0 - Height = 96 + Height = 113 Top = 0 Width = 615 Align = alTop AutoSize = True BevelOuter = bvNone - ClientHeight = 96 + ClientHeight = 113 ClientWidth = 615 ParentFont = False TabOrder = 0 object RescueStatusBox: TGroupBox Left = 4 - Height = 92 + Height = 109 Top = 2 - Width = 528 + Width = 548 Align = alLeft AutoSize = True BorderSpacing.Left = 4 @@ -43,15 +43,15 @@ BorderSpacing.Right = 4 BorderSpacing.Bottom = 2 Caption = 'Rescue status' - ClientHeight = 72 - ClientWidth = 524 + ClientHeight = 92 + ClientWidth = 546 ParentFont = False TabOrder = 0 object RSCol1Panel: TPanel Left = 6 - Height = 70 + Height = 90 Top = 0 - Width = 153 + Width = 161 Align = alLeft AutoSize = True BorderSpacing.Left = 6 @@ -64,15 +64,15 @@ ChildSizing.VerticalSpacing = 2 ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 2 - ClientHeight = 70 - ClientWidth = 153 + ClientHeight = 90 + ClientWidth = 161 TabOrder = 0 object lblInputSize: TLabel Left = 2 - Height = 15 + Height = 16 Hint = 'Size of the rescue device' - Top = 2 - Width = 67 + Top = 4 + Width = 75 BorderSpacing.CellAlignVertical = ccaCenter Caption = 'Input size:' ParentColor = False @@ -80,8 +80,8 @@ end object EditInputSize: TEdit AnchorSideLeft.Side = asrBottom - Left = 71 - Height = 15 + Left = 79 + Height = 20 Top = 2 Width = 80 BorderSpacing.Left = 2 @@ -96,10 +96,10 @@ end object lblDomainSize: TLabel Left = 2 - Height = 15 + Height = 16 Hint = 'Size of the rescue domain' - Top = 19 - Width = 67 + Top = 26 + Width = 75 BorderSpacing.CellAlignVertical = ccaCenter Caption = 'Domain size:' ParentColor = False @@ -108,9 +108,9 @@ end object EditDomainSize: TEdit AnchorSideLeft.Side = asrBottom - Left = 71 - Height = 15 - Top = 19 + Left = 79 + Height = 20 + Top = 24 Width = 80 BorderSpacing.Left = 2 BorderStyle = bsNone @@ -125,19 +125,19 @@ end object lblErrorCount: TLabel Left = 2 - Height = 15 + Height = 16 Hint = 'Number of distinct bad sector areas' - Top = 36 - Width = 67 + Top = 48 + Width = 75 BorderSpacing.CellAlignVertical = ccaCenter Caption = 'Error count:' ParentColor = False end object EditErrorCount: TEdit AnchorSideLeft.Side = asrBottom - Left = 71 - Height = 15 - Top = 36 + Left = 79 + Height = 20 + Top = 46 Width = 80 BorderSpacing.Left = 2 BorderStyle = bsNone @@ -151,10 +151,10 @@ end object lblPending: TLabel Left = 2 - Height = 15 + Height = 16 Hint = 'Total size of pending areas (non-tried + non-trimmed + non-scraped)' - Top = 53 - Width = 67 + Top = 70 + Width = 75 BorderSpacing.CellAlignVertical = ccaCenter Caption = 'Pending:' ParentColor = False @@ -162,9 +162,9 @@ end object EditPending: TEdit AnchorSideLeft.Side = asrBottom - Left = 71 - Height = 15 - Top = 53 + Left = 79 + Height = 20 + Top = 68 Width = 80 BorderSpacing.Left = 2 BorderStyle = bsNone @@ -178,10 +178,10 @@ end end object RSCol2Panel: TPanel - Left = 165 - Height = 70 + Left = 173 + Height = 90 Top = 0 - Width = 175 + Width = 183 Align = alLeft AutoSize = True BorderSpacing.Left = 6 @@ -194,13 +194,13 @@ ChildSizing.VerticalSpacing = 2 ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 3 - ClientHeight = 70 - ClientWidth = 175 + ClientHeight = 90 + ClientWidth = 183 TabOrder = 1 object ShapeFinished: TShape Left = 2 Height = 10 - Top = 4 + Top = 7 Width = 10 BorderSpacing.CellAlignHorizontal = ccaCenter BorderSpacing.CellAlignVertical = ccaCenter @@ -210,10 +210,10 @@ end object lblRescued: TLabel Left = 14 - Height = 15 + Height = 16 Hint = 'Rescued data block' - Top = 2 - Width = 77 + Top = 4 + Width = 85 BorderSpacing.CellAlignVertical = ccaCenter Caption = 'Rescued:' ParentColor = False @@ -221,8 +221,8 @@ end object EditRescued: TEdit AnchorSideLeft.Side = asrBottom - Left = 93 - Height = 15 + Left = 101 + Height = 20 Top = 2 Width = 80 BorderSpacing.Left = 2 @@ -238,7 +238,7 @@ object ShapeOutsideDomain: TShape Left = 2 Height = 10 - Top = 21 + Top = 29 Width = 10 BorderSpacing.CellAlignHorizontal = ccaCenter BorderSpacing.CellAlignVertical = ccaCenter @@ -249,10 +249,10 @@ end object lblOutsideDomain: TLabel Left = 14 - Height = 15 + Height = 16 Hint = 'Block outside the rescue domain specified in the domain log file' - Top = 19 - Width = 77 + Top = 26 + Width = 85 BorderSpacing.CellAlignVertical = ccaCenter Caption = 'Not in domain' ParentColor = False @@ -261,9 +261,9 @@ end object EditOutsideDomain: TEdit AnchorSideLeft.Side = asrBottom - Left = 93 - Height = 15 - Top = 19 + Left = 101 + Height = 20 + Top = 24 Width = 80 BorderSpacing.Left = 2 BorderStyle = bsNone @@ -279,7 +279,7 @@ object ShapeBad: TShape Left = 2 Height = 10 - Top = 38 + Top = 51 Width = 10 BorderSpacing.CellAlignHorizontal = ccaCenter BorderSpacing.CellAlignVertical = ccaCenter @@ -289,10 +289,10 @@ end object lblBadSectors: TLabel Left = 14 - Height = 15 + Height = 16 Hint = 'Block which failed to read on the previous attempt' - Top = 36 - Width = 77 + Top = 48 + Width = 85 BorderSpacing.CellAlignVertical = ccaCenter Caption = 'Bad sectors:' ParentColor = False @@ -300,9 +300,9 @@ end object EditBadSectors: TEdit AnchorSideLeft.Side = asrBottom - Left = 93 - Height = 15 - Top = 36 + Left = 101 + Height = 20 + Top = 46 Width = 80 BorderSpacing.Left = 2 BorderStyle = bsNone @@ -317,7 +317,7 @@ object ShapeActive: TShape Left = 2 Height = 10 - Top = 55 + Top = 73 Width = 10 BorderSpacing.CellAlignHorizontal = ccaCenter BorderSpacing.CellAlignVertical = ccaCenter @@ -328,10 +328,10 @@ end object lblCurrentPos: TLabel Left = 14 - Height = 15 + Height = 16 Hint = 'Current read position on the rescue device' - Top = 53 - Width = 77 + Top = 70 + Width = 85 BorderSpacing.CellAlignVertical = ccaCenter Caption = 'Current pos:' ParentColor = False @@ -339,9 +339,9 @@ end object EditCurrentPos: TEdit AnchorSideLeft.Side = asrBottom - Left = 93 - Height = 15 - Top = 53 + Left = 101 + Height = 20 + Top = 68 Width = 80 BorderSpacing.Left = 2 BorderStyle = bsNone @@ -355,10 +355,10 @@ end end object RSCol3Panel: TPanel - Left = 346 - Height = 70 + Left = 362 + Height = 90 Top = 0 - Width = 172 + Width = 178 Align = alLeft AutoSize = True BorderSpacing.Left = 6 @@ -371,13 +371,13 @@ ChildSizing.VerticalSpacing = 2 ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 3 - ClientHeight = 70 - ClientWidth = 172 + ClientHeight = 90 + ClientWidth = 178 TabOrder = 2 object ShapeNonTried: TShape Left = 2 Height = 10 - Top = 4 + Top = 7 Width = 10 BorderSpacing.CellAlignHorizontal = ccaCenter BorderSpacing.CellAlignVertical = ccaCenter @@ -387,10 +387,10 @@ end object lblNonTried: TLabel Left = 14 - Height = 15 + Height = 16 Hint = 'Block that has not yet been attempted to read' - Top = 2 - Width = 74 + Top = 4 + Width = 80 BorderSpacing.CellAlignVertical = ccaCenter Caption = 'Non-tried' ParentColor = False @@ -398,8 +398,8 @@ end object EditNontried: TEdit AnchorSideLeft.Side = asrBottom - Left = 90 - Height = 15 + Left = 96 + Height = 20 Top = 2 Width = 80 BorderSpacing.Left = 2 @@ -415,7 +415,7 @@ object ShapeNonTrimmed: TShape Left = 2 Height = 10 - Top = 21 + Top = 29 Width = 10 BorderSpacing.CellAlignHorizontal = ccaCenter BorderSpacing.CellAlignVertical = ccaCenter @@ -425,10 +425,10 @@ end object lblNonTrimmed: TLabel Left = 14 - Height = 15 + Height = 16 Hint = 'Block that was skipped by ddrescue on a read error (or slow read), to maximize performance. May contain readable data.' - Top = 19 - Width = 74 + Top = 26 + Width = 80 BorderSpacing.CellAlignVertical = ccaCenter Caption = 'Non-trimmed' ParentColor = False @@ -436,9 +436,9 @@ end object EditNontrimmed: TEdit AnchorSideLeft.Side = asrBottom - Left = 90 - Height = 15 - Top = 19 + Left = 96 + Height = 20 + Top = 24 Width = 80 BorderSpacing.Left = 2 BorderStyle = bsNone @@ -453,7 +453,7 @@ object ShapeNonScraped: TShape Left = 2 Height = 10 - Top = 38 + Top = 51 Width = 10 BorderSpacing.CellAlignHorizontal = ccaCenter BorderSpacing.CellAlignVertical = ccaCenter @@ -463,10 +463,10 @@ end object lblNonScraped: TLabel Left = 14 - Height = 15 + Height = 16 Hint = 'Trimmed block that has yet to be scraped (pre-1.19 ddrescue: Trimmed block that has yet to be split). May contain readable data.' - Top = 36 - Width = 74 + Top = 48 + Width = 80 BorderSpacing.CellAlignVertical = ccaCenter Caption = 'Non-scraped' ParentColor = False @@ -474,9 +474,9 @@ end object EditNonscraped: TEdit AnchorSideLeft.Side = asrBottom - Left = 90 - Height = 15 - Top = 36 + Left = 96 + Height = 20 + Top = 46 Width = 80 BorderSpacing.Left = 2 BorderStyle = bsNone @@ -492,7 +492,7 @@ end object TopPiePanel: TPanel Left = 549 - Height = 92 + Height = 109 Top = 2 Width = 64 Align = alRight @@ -502,13 +502,13 @@ ChildSizing.EnlargeVertical = crsHomogenousSpaceResize ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 - ClientHeight = 92 + ClientHeight = 109 ClientWidth = 64 TabOrder = 1 object PieImage: TImage Left = 0 Height = 64 - Top = 14 + Top = 23 Width = 64 BorderSpacing.CellAlignVertical = ccaCenter Constraints.MaxHeight = 64 @@ -520,24 +520,24 @@ end object MainPanel: TPanel Left = 0 - Height = 300 - Top = 96 + Height = 284 + Top = 113 Width = 615 Align = alClient BevelOuter = bvNone - ClientHeight = 300 + ClientHeight = 284 ClientWidth = 615 TabOrder = 1 object ZoomPanel: TPanel Left = 0 - Height = 245 + Height = 229 Top = 0 Width = 50 Align = alLeft BevelOuter = bvNone BorderStyle = bsSingle - ClientHeight = 241 - ClientWidth = 46 + ClientHeight = 227 + ClientWidth = 48 Color = clGray Constraints.MinHeight = 30 Constraints.MinWidth = 30 @@ -545,9 +545,9 @@ TabOrder = 0 object ZoomImage: TImage Left = 0 - Height = 241 + Height = 227 Top = 0 - Width = 46 + Width = 48 Align = alClient Constraints.MinHeight = 25 Constraints.MinWidth = 25 @@ -556,7 +556,7 @@ OnMouseUp = ZoomImageMouseUp end object BtnCloseZoomBar: TSpeedButton - Left = 30 + Left = 32 Height = 13 Hint = 'Close zoom bar' Top = 2 @@ -584,14 +584,14 @@ end object GridPanel: TPanel Left = 50 - Height = 245 + Height = 229 Top = 0 Width = 565 Align = alClient BevelOuter = bvNone BorderStyle = bsSingle - ClientHeight = 241 - ClientWidth = 561 + ClientHeight = 227 + ClientWidth = 563 Color = clGray Constraints.MinHeight = 30 Constraints.MinWidth = 30 @@ -600,9 +600,9 @@ OnResize = GridPanelResize object BlockImage: TImage Left = 0 - Height = 241 + Height = 227 Top = 0 - Width = 561 + Width = 563 Align = alClient Constraints.MinHeight = 25 Constraints.MinWidth = 25 @@ -615,7 +615,7 @@ object BottomPanel: TPanel Left = 0 Height = 50 - Top = 250 + Top = 234 Width = 615 Align = alBottom BevelOuter = bvNone @@ -665,7 +665,7 @@ Cursor = crVSplit Left = 0 Height = 5 - Top = 245 + Top = 229 Width = 615 Align = alBottom AutoSnap = False @@ -678,8 +678,8 @@ end object StatusBar: TStatusBar Left = 0 - Height = 23 - Top = 396 + Height = 18 + Top = 397 Width = 615 Panels = < item diff -Nru ddrescueview-0.4~alpha4/source/GUI.pas ddrescueview-0.4.5/source/GUI.pas --- ddrescueview-0.4~alpha4/source/GUI.pas 2020-08-28 01:12:58.000000000 +0000 +++ ddrescueview-0.4.5/source/GUI.pas 2022-02-25 15:47:26.000000000 +0000 @@ -1,7 +1,7 @@ (* GUI.pas - Main GUI unit - Copyright (C) 2013 - 2020 Martin Bittermann (martinbittermann@gmx.de) + Copyright (C) 2013 - 2022 Martin Bittermann (martinbittermann@gmx.de) This file is part of ddrescueview. diff -Nru ddrescueview-0.4~alpha4/source/imgblockstore.pas ddrescueview-0.4.5/source/imgblockstore.pas --- ddrescueview-0.4~alpha4/source/imgblockstore.pas 2020-08-28 01:03:50.000000000 +0000 +++ ddrescueview-0.4.5/source/imgblockstore.pas 2022-02-23 10:10:00.000000000 +0000 @@ -1,7 +1,7 @@ (* ImgBlockStore.pas - Image Block Storage unit - Copyright (C) 2013 - 2020 Martin Bittermann (martinbittermann@gmx.de) + Copyright (C) 2013 - 2022 Martin Bittermann (martinbittermann@gmx.de) This file is part of ddrescueview. diff -Nru ddrescueview-0.4~alpha4/source/Parser.pas ddrescueview-0.4.5/source/Parser.pas --- ddrescueview-0.4~alpha4/source/Parser.pas 2020-08-21 00:10:45.000000000 +0000 +++ ddrescueview-0.4.5/source/Parser.pas 2022-02-23 10:11:12.000000000 +0000 @@ -1,7 +1,7 @@ (* Parser.pas - Mapfile parser unit - Copyright (C) 2013 - 2020 Martin Bittermann (martinbittermann@gmx.de) + Copyright (C) 2013 - 2022 Martin Bittermann (martinbittermann@gmx.de) This file is part of ddrescueview. @@ -36,7 +36,6 @@ FRescueStatus : TRescueStatus; FComments : TStringList; // comment lines of mapfile FVersion : String; // ddrescue version in first comment line / for future use? - FMapStream : TStream; FFileName : String; procedure logMsg(msg : String); function isEmptyLine(strLine : String) : boolean; @@ -45,14 +44,14 @@ constructor Create; destructor Destroy; override; procedure OpenFile(filename : String); - procedure CloseFile; + procedure CloseFile(); function parse(forceSameDevSize : Boolean) : Boolean; function hasFile() : boolean; property rescueStatus : TRescueStatus read FRescueStatus; property map : TMap read FMap; property CommentLines : TStringList read FComments; property Version : String read FVersion; - property MapFileName :String read FFileName; + property MapFileName : String read FFileName; end; @@ -79,7 +78,7 @@ destructor Destroy; override; procedure OpenFile(filename : String); procedure OpenDomainFile(filename : String); - procedure CloseFile; + procedure CloseFile(); function parse(forceSameDevSize : Boolean) : Boolean; function hasFile() : boolean; function hasDomFile() : Boolean; @@ -130,7 +129,7 @@ postParse; end; -procedure TMapParser.CloseFile; +procedure TMapParser.CloseFile(); begin FDomParser.CloseFile; FMapParser.CloseFile; @@ -140,7 +139,7 @@ FPONotifyObservers(self, ooDeleteItem, nil); end; -procedure TMapParser.postParse; +procedure TMapParser.postParse(); var ResMap, DomMap: TMap; i, iRes, iDom : Longint; @@ -241,22 +240,41 @@ postParse; end; -function TMapParser.hasFile: boolean; +function TMapParser.hasFile(): boolean; begin result:=FHasFile; end; -function TMapParser.hasDomFile: Boolean; +function TMapParser.hasDomFile(): Boolean; begin result:=FHasFile and FDomParser.hasFile; end; -function TMapParser.getMap: TMap; +function TMapParser.getMap(): TMap; begin if not FDomParser.hasFile then result:=FMapParser.map else result:=FMap; end; +function TMapParser.getCommentLines(): TStringList; +begin + getCommentLines:=FMapParser.FComments; +end; + +function TMapParser.getVersion(): String; +begin + getVersion:=FMapParser.FVersion; +end; + +function TMapParser.getMapFileName(): String; +begin + getMapFileName:=FMapParser.FFileName; +end; + +function TMapParser.getDomFileName(): String; +begin + getDomFileName:=FDomParser.FFileName; +end; { TSimpleParser } @@ -273,11 +291,14 @@ end; procedure TSimpleParser.OpenFile(filename : String); +var mapStream : TFileStream; begin try - CloseFile(); // close already open file - // open the mapfile using shared read access, so ddrescue can still write to it. - FMapStream := TFileStream.Create(filename, fmOpenRead or fmShareDenyNone); + if hasFile() then CloseFile(); // close already open file + // check mapfile access once, and close the file again. + mapStream := TFileStream.Create(filename, fmOpenRead or fmShareDenyNone); + FreeAndNil(mapStream); + // file checked, it can be considered 'open' now. FComments := TStringList.Create; FFileName := filename; parse(false); // start parsing after opening @@ -293,7 +314,6 @@ begin FFileName := ''; FreeAndNil(FComments); - FreeAndNil(FMapStream); FRescueStatus := emptyRescueStatus; SetLength(FMap, 0); FPONotifyObservers(self, ooDeleteItem, nil); @@ -325,6 +345,7 @@ line : string; token : array[0..2] of string; i, mapEntry, lineIdx, idx : Integer; + mapStream : TFileStream = nil; mapStrings : TStringList = nil; prevHadFile, statuslineFound : boolean; newMap : TMap; @@ -336,8 +357,8 @@ {$ENDIF} begin result:=False; - // make sure the file is open - if not hasFile then begin + // make sure the parser has a file + if not hasFile() then begin logMsg('Parser: No mapfile opened.'); FPONotifyObservers(self, ooChange, nil); exit; @@ -345,27 +366,27 @@ {$IFDEF VerboseProfiler} lTimeStart := Now(); {$ENDIF} - // read file contents into string list + // open the file and read its contents into string list try - mapStrings := TStringList.Create; - if FMapStream.Seek(0, soFromBeginning) <> 0 then - raise Exception.Create('Seek error!'); - mapStrings.LoadFromStream(FMapStream); - if (FMapStream.Size = 0) or (mapStrings.Count = 0) then begin - logMsg('Parser: mapfile seems empty, trying to reopen.'); - FreeAndNil(FMapStream); - FMapStream := TFileStream.Create(FFilename, fmOpenRead or fmShareDenyNone); - FMapStream.Seek(0, soFromBeginning); - mapStrings.LoadFromStream(FMapStream); - end; - logMsg('Reading mapfile: ' +IntToStr(mapStrings.Count) + ' lines.'); - except - on E : Exception do begin - logMsg('Error: Cannot read mapfile: '+E.Message+'('+E.ClassName+')'); - FreeAndNil(mapStrings); - FPONotifyObservers(self, ooChange, nil); - exit; + try + mapStream := TFileStream.Create(FFilename, fmOpenRead or fmShareDenyNone); + if mapStream.Seek(0, soFromBeginning) <> 0 then + raise Exception.Create('Seek error!'); + mapStrings := TStringList.Create; + mapStrings.LoadFromStream(mapStream); + if mapStrings.Count = 0 then + raise Exception.Create('File is empty!'); + logMsg('Reading mapfile: ' +IntToStr(mapStrings.Count) + ' lines.'); + except + on E : Exception do begin + logMsg('Error: Cannot read mapfile: '+E.Message+'('+E.ClassName+')'); + FreeAndNil(mapStrings); + FPONotifyObservers(self, ooChange, nil); + exit; + end; end; + finally + FreeAndNil(mapStream); // close the map file immediately after reading end; {$IFDEF VerboseProfiler} @@ -503,27 +524,9 @@ else FPONotifyObservers(self, ooAddItem, nil); // notify of new file end; -function TSimpleParser.hasFile: boolean; -begin - hasFile:=Assigned(FMapStream); -end; - -function TMapParser.getCommentLines(): TStringList; +function TSimpleParser.hasFile(): boolean; begin - getCommentLines:=FMapParser.FComments;end; - -function TMapParser.getVersion(): String; -begin - getVersion:=FMapParser.FVersion; + hasFile:=Length(FFileName) > 0; end; -function TMapParser.getMapFileName(): String; -begin - getMapFileName:=FMapParser.FFileName; -end; - -function TMapParser.getDomFileName(): String; -begin - getDomFileName:=FDomParser.FFileName; -end; end. diff -Nru ddrescueview-0.4~alpha4/source/settings.pas ddrescueview-0.4.5/source/settings.pas --- ddrescueview-0.4~alpha4/source/settings.pas 2020-08-26 14:20:05.000000000 +0000 +++ ddrescueview-0.4.5/source/settings.pas 2022-02-23 10:10:02.000000000 +0000 @@ -1,7 +1,7 @@ (* Settings.pas - Settings GUI unit - Copyright (C) 2013 - 2020 Martin Bittermann (martinbittermann@gmx.de) + Copyright (C) 2013 - 2022 Martin Bittermann (martinbittermann@gmx.de) This file is part of ddrescueview. diff -Nru ddrescueview-0.4~alpha4/source/Shared.pas ddrescueview-0.4.5/source/Shared.pas --- ddrescueview-0.4~alpha4/source/Shared.pas 2020-08-28 01:23:24.000000000 +0000 +++ ddrescueview-0.4.5/source/Shared.pas 2022-02-23 10:30:24.000000000 +0000 @@ -1,7 +1,7 @@ (* Shared.pas - Shared functionality - Copyright (C) 2013 - 2020 Martin Bittermann (martinbittermann@gmx.de) + Copyright (C) 2013 - 2022 Martin Bittermann (martinbittermann@gmx.de) This file is part of ddrescueview. @@ -130,7 +130,8 @@ PROGRAM_TITLE = 'ddrescueview'; VERSION_MAJOR = '0'; VERSION_MINOR = '4'; - VERSION_SUFFIX = 'alpha 4'; + VERSION_PATCH = '5'; + VERSION_SUFFIX = ''; emptyRescueStatus : TRescueStatus = (devicesize : 0; suggestedBlockSize : DEF_BSIZE; pos : 0; rescued : 0; nontried : 0; bad : 0; nonscraped : 0; nontrimmed : 0; outsidedomain : 0;