Skip to content

Commit

Permalink
fix: Duplicate files on drag-and-drop
Browse files Browse the repository at this point in the history
Closes: #12
  • Loading branch information
gcarreno committed Feb 3, 2021
1 parent 8765a6f commit ddc71f2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/application/ljv.application.version.pas
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
interface

const
cVersion = '0.1.8.31';
cVersion = '0.1.8.32';
cVersionMajor = 0;
cVersionMinor = 1;
cVersionRevision = 8;
cVersionBuild = 31;
cVersionBuild = 32;

implementation

Expand Down
20 changes: 17 additions & 3 deletions src/forms/ljv.forms.main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,8 @@ function TfrmMain.FormatBytes(ABytes: Int64): String;
procedure TfrmMain.AddFile(const AFilename: String);
var
len: Integer;
isDuplicate: Boolean;
filename: String;
begin
if Pos('*', AFilename) > 0 then
begin
Expand All @@ -552,9 +554,21 @@ procedure TfrmMain.AddFile(const AFilename: String);
begin
if FileExists(AFilename) then
begin
len:= Length(FFileList);
SetLength(FFileList, len + 1);
FFileList[len]:= ExpandFileName(AFilename);
isDuplicate:= False;
for filename in FFileList do
begin
if filename = AFilename then
begin
isDuplicate:= True;
break;
end;
end;
if not isDuplicate then
begin
len:= Length(FFileList);
SetLength(FFileList, len + 1);
FFileList[len]:= ExpandFileName(AFilename);
end;
end;
end;
end;
Expand Down
2 changes: 1 addition & 1 deletion src/lazJSONViewer.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<UseVersionInfo Value="True"/>
<MinorVersionNr Value="1"/>
<RevisionNr Value="8"/>
<BuildNr Value="31"/>
<BuildNr Value="32"/>
<Language Value="0809"/>
</VersionInfo>
<BuildModes Count="4">
Expand Down

0 comments on commit ddc71f2

Please sign in to comment.