fix: Report a message while calculating total size of files to transfer. (#362)

* fix: Report a message while calculating total size of files to transfer.

Currently, in case of huge transfers the app may look frozen while calculating the transfer size. We should at least report to the user we are actually doing something.

closes #361

* ci: windows runner
This commit is contained in:
Christian Visintin
2025-10-02 20:58:26 +02:00
committed by GitHub
parent 205d2813ad
commit 05c8613279
3 changed files with 19 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ env:
jobs:
build:
runs-on: windows-2019
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

View File

@@ -49,6 +49,7 @@ Released on 20/09/2025
- [Issue 356](https://github.com/veeso/termscp/issues/356): Fixed SSH auth issue not trying with the password if any RSA key was found.
- [Issue 334](https://github.com/veeso/termscp/issues/334): SMB support for MacOS with vendored build of libsmbclient.
- [Issue 337](https://github.com/veeso/termscp/issues/337): Migrated to libssh.org on Linux and MacOS for better ssh agent support.
- [Issue 361](https://github.com/veeso/termscp/issues/361): Report a message while calculating total size of files to transfer.
## 0.18.0

View File

@@ -1260,7 +1260,10 @@ impl FileTransferActivity {
/// Get total size of transfer for host_bridgehost
fn get_total_transfer_size_host(&mut self, entry: &File) -> usize {
if entry.is_dir() {
// mount message to tell we are calculating size
self.mount_blocking_wait("Calculating transfer size…");
let sz = if entry.is_dir() {
// List dir
match self.host_bridge.list_dir(entry.path()) {
Ok(files) => files
@@ -1281,12 +1284,18 @@ impl FileTransferActivity {
}
} else {
entry.metadata.size as usize
}
};
self.umount_wait();
sz
}
/// Get total size of transfer for remote host
fn get_total_transfer_size_remote(&mut self, entry: &File) -> usize {
if entry.is_dir() {
// mount message to tell we are calculating size
self.mount_blocking_wait("Calculating transfer size…");
let sz = if entry.is_dir() {
// List directory
match self.client.list_dir(entry.path()) {
Ok(files) => files
@@ -1307,7 +1316,11 @@ impl FileTransferActivity {
}
} else {
entry.metadata.size as usize
}
};
self.umount_wait();
sz
}
// file changed