From 585635371a182d2b3cd5400f6d26d8e20ade6dbd Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 23 Dec 2024 12:09:37 +0100 Subject: Drop Application.GTKVersion_2_xxx_Up ...and related quirks along with it. Assume latest gtk2 release. --- UChecksum.pas | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) (limited to 'UChecksum.pas') diff --git a/UChecksum.pas b/UChecksum.pas index 0de5fda..8b3dbb7 100644 --- a/UChecksum.pas +++ b/UChecksum.pas @@ -334,7 +334,6 @@ begin List.Add(Item); ListItem := FileList.Items.Add; ListItem.Data := Item; - if not Application.GTKVersion_2_0_5_Up then ListItem.SetValue(0, Item); end; end; @@ -343,14 +342,11 @@ const StatusStr : array[0..3] of string = ('?', 'OK', 'BAD', 'N/A'); var Data: TFileListItem; Path: PGtkTreePath; begin - if not Application.GTKVersion_2_0_5_Up then gtk_tree_model_get(tree_model, iter, 0, @Data, -1) - else begin - Path := gtk_tree_model_get_path(tree_model, iter); - if not Assigned(Path) then Exit; - (Sender as TGTKListView).ConvertPathToChild(Path); - Data := List[gtk_tree_path_get_indices(Path)^]; - gtk_tree_path_free(Path); - end; + Path := gtk_tree_model_get_path(tree_model, iter); + if not Assigned(Path) then Exit; + (Sender as TGTKListView).ConvertPathToChild(Path); + Data := List[gtk_tree_path_get_indices(Path)^]; + gtk_tree_path_free(Path); case gtk_tree_view_column_get_sort_column_id(tree_column) of 0: g_object_set(cell, 'text', StrToUTF8(PChar(Format('[%s] %s', [StatusStr[Data.Status], Data.Name]))), nil); -1: if not Data.IsMD5 then g_object_set(cell, 'text', PChar('0x' + IntToHex(Data.CRC, 8)), nil) @@ -363,19 +359,14 @@ var Data1, Data2: TFileListItem; Path: PGtkTreePath; begin Result := 0; - if not Application.GTKVersion_2_0_5_Up then begin - gtk_tree_model_get(model, a, 0, @Data1, -1); - gtk_tree_model_get(model, b, 0, @Data2, -1); - end else begin - Path := gtk_tree_model_get_path(model, a); - if not Assigned(Path) then Exit; - Data1 := List[gtk_tree_path_get_indices(Path)^]; - gtk_tree_path_free(Path); - Path := gtk_tree_model_get_path(model, b); - if not Assigned(Path) then Exit; - Data2 := List[gtk_tree_path_get_indices(Path)^]; - gtk_tree_path_free(Path); - end; + Path := gtk_tree_model_get_path(model, a); + if not Assigned(Path) then Exit; + Data1 := List[gtk_tree_path_get_indices(Path)^]; + gtk_tree_path_free(Path); + Path := gtk_tree_model_get_path(model, b); + if not Assigned(Path) then Exit; + Data2 := List[gtk_tree_path_get_indices(Path)^]; + gtk_tree_path_free(Path); if (Sender as TGTKView).SortColumnID = 0 then Result := CompareTextsEx(PChar(Data1.Name), PChar(Data2.Name)); end; -- cgit v1.2.3