Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/docto' into docto
Browse files Browse the repository at this point in the history
  • Loading branch information
Toby Allen committed Feb 8, 2024
2 parents ddfc179 + 2280c98 commit e1f8766
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
16 changes: 10 additions & 6 deletions src/MainUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -576,11 +576,11 @@ function TDocumentConverter.Execute: string;
if not DoExecute then HaltWithError(201, 'Input File, Output File and FileFormat must all be specified');

// Set Output Filename if Dir Provided.
if (InputIsFile and OutputIsDir) then
if ( OutputIsDir) then
begin
if OutputExt = '' then
begin
OutputExt := '.' + FormatsExtensions.Values[OutputFileFormatString];
OutputExt := '.' + FormatsExtensions.Values[OutputFileFormatString];
loginfo('Output Extension is ' + outputExt, CHATTY);
end;

Expand Down Expand Up @@ -649,6 +649,7 @@ function TDocumentConverter.Execute: string;

StartTime := GettickCount();
logdebug('Executing Conversion ... ',VERBOSE);
logdebug('Executing Conversion ... ' + FileToCreate,VERBOSE);
ConversionInfo := ExecuteConversion(FileToConvert, FileToCreate, OutputFileFormat);

if ConversionInfo.Successful then
Expand All @@ -665,11 +666,14 @@ function TDocumentConverter.Execute: string;
// Check if file needs to be deleted.
if RemoveFileOnConvert then
begin
// Check file exists and Delete if requested
if FileExists(FileToCreate) then
// Check file has been converted and Delete if requested
if FileExists(ConversionInfo.OutputFile) then
begin
DeleteFile(FileToConvert);
Loginfo('Deleted:' + FileToConvert,STANDARD);
if FileExists(ConversionInfo.InputFile) then
begin
DeleteFile(ConversionInfo.InputFile);
Loginfo('Deleted:' + ConversionInfo.InputFile,STANDARD);
end;
end;
end;

Expand Down
6 changes: 3 additions & 3 deletions src/docto.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@
<VerInfo_PreRelease>false</VerInfo_PreRelease>
<VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion>
<VerInfo_AutoGenVersion>false</VerInfo_AutoGenVersion>
<VerInfo_Release>41</VerInfo_Release>
<VerInfo_Release>42</VerInfo_Release>
<Icon_MainIcon>docto_Icon2.ico</Icon_MainIcon>
<VerInfo_Keys>CompanyName=Toflidium Software;FileDescription=DocTo - Convert doc files to any available format;FileVersion=1.9.41.69;InternalName=;LegalCopyright=Toby Allen;LegalTrademarks=;OriginalFilename=docto.exe;ProductName=DocTo;ProductVersion=1.6;Comments=https://github.com/tobya/DocTo;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Keys>CompanyName=Toflidium Software;FileDescription=DocTo - Convert doc files to any available format;FileVersion=1.10.42.69;InternalName=;LegalCopyright=Toby Allen;LegalTrademarks=;OriginalFilename=docto.exe;ProductName=DocTo;ProductVersion=1.6;Comments=https://github.com/tobya/DocTo;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<DCC_ExeOutput>..\exe</DCC_ExeOutput>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<VerInfo_MinorVer>9</VerInfo_MinorVer>
<VerInfo_MinorVer>10</VerInfo_MinorVer>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_3_Win64)'!=''">
<VerInfo_MajorVer>1</VerInfo_MajorVer>
Expand Down

0 comments on commit e1f8766

Please sign in to comment.