Skip to content

Commit

Permalink
Fix progress reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
kbinani committed Dec 24, 2023
1 parent d058c21 commit 6e8f6f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/ConvertXbox360ToJava.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ class ConvertXbox360ToJava: Converter {
}

func numProgressSteps() -> Int32 {
return 1
return 2
}

func description(forStep step: Int32) -> String? {
switch step {
case 0:
return "Convert"
case 1:
return "Zip"
default:
return nil
}
Expand All @@ -28,6 +30,8 @@ class ConvertXbox360ToJava: Converter {
switch step {
case 0:
return nil
case 1:
return nil
default:
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions src/Core.mm
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ Result UnsafeJavaToBedrock(id<Converter> converter, NSURL* input, NSURL *tempDir
return Result::Error(kJe2beErrorCodeConverterError, *st.error());
}

ZipProgress zipProgress(3, converter, delegate);
ZipProgress zipProgress(4, converter, delegate);
fs::path fsZipOut = fsTempRoot / fsInput.filename().replace_extension(".mcworld");
NSURL *zipOut = NSURLFromPath(fsZipOut);
auto zipResult = je2be::ZipFile::Zip(fsOutput, fsZipOut, zipProgress);
Expand Down Expand Up @@ -443,7 +443,7 @@ Result UnsafeXbox360ToBedrock(id<Converter> converter, NSURL* input, NSURL *temp
}
}

ZipProgress zipProgress(3, converter, delegate);
ZipProgress zipProgress(4, converter, delegate);
fs::path fsZipOut = fsTempRoot / fsInput.filename().replace_extension(".mcworld");
NSURL *zipOut = NSURLFromPath(fsZipOut);
auto zipResult = je2be::ZipFile::Zip(fsTempOutput, fsZipOut, zipProgress);
Expand Down

0 comments on commit 6e8f6f1

Please sign in to comment.