Skip to content

Commit

Permalink
Fixed a bug prevent user from creating GPT table
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagamma committed Aug 2, 2024
1 parent e931810 commit a173ff6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/parted.devices.pas
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ TPartedDevice = record
// Parse for device info from "parted -l -m" string
function ParseDevicesFromStringArray(const SA: TStringDynArray): TPartedDeviceArray;
function QueryDeviceArray: TPartedDeviceArray;
// This is for checking device and partitions
function QueryDeviceExists(const APath: String): TExecResult;
function QueryCreateGPT(const APath: String): TExecResult;

Expand Down
5 changes: 4 additions & 1 deletion src/ui.main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ procedure TUIMain.HandleEvent(var E: TEvent);
if not IsDeviceWindowOpened(LDevice^) then
begin
try
QueryDeviceExists(Path);
QueryDeviceAndPartitions(Path, LDevice^);
if LDevice^.Table = 'unknown' then // This device has no partition table, wanna create it?
begin
Expand All @@ -246,6 +245,10 @@ procedure TUIMain.HandleEvent(var E: TEvent);
// Query for device again
QueryDeviceAndPartitions(Path, LDevice^);
LoadingStop;
end else
begin
Self.ClearEvent(E);
Exit;
end;
end;
LoadingStart(S_LoadingPartitions);
Expand Down

0 comments on commit a173ff6

Please sign in to comment.