Queue size inaccurate 1.2GB shows as 2GiB
Moderator: Project members
Queue size inaccurate 1.2GB shows as 2GiB
Hi,
I was transferring 81 files that added up to a total of 1.2GB and I noticed that Filezilla 3.2.7.1 reported the Queue size as 2GiB. I searched around and found that this has been raised before as a bug ticket #4324, http://trac.filezilla-project.org/ticket/4324. It was rejected by codesquid with the following comment "Filesizes are rounded up, this is by design."
Surely this is a little unfair and overly inaccurate, rounding up from 1.2 to 2 seems misleading. It would be much better if it showed 1.2GB or 1.3GiB or something similar.
Cheers,
Mark
I was transferring 81 files that added up to a total of 1.2GB and I noticed that Filezilla 3.2.7.1 reported the Queue size as 2GiB. I searched around and found that this has been raised before as a bug ticket #4324, http://trac.filezilla-project.org/ticket/4324. It was rejected by codesquid with the following comment "Filesizes are rounded up, this is by design."
Surely this is a little unfair and overly inaccurate, rounding up from 1.2 to 2 seems misleading. It would be much better if it showed 1.2GB or 1.3GiB or something similar.
Cheers,
Mark
Re: Queue size inaccurate 1.2GB shows as 2GiB
I'd love to see that a little more accurate, too, like 1.25GB or 1.25GiB .
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org
Re: Queue size inaccurate 1.2GB shows as 2GiB
I use a modified version based on Filezilla 3.2.7.1. For a test queue, my code displays 3.06 GiB and the current Filezilla 3.2.8 displays 4 GiB.
In statusbar.cpp, line 306, for CStatusBar::DisplayQueueSize, instead of the current code:
try this:
In statusbar.cpp, line 306, for CStatusBar::DisplayQueueSize, instead of the current code:
Code: Select all
extern wxString FormatSize(const wxLongLong& size, bool add_bytes_suffix, int format, bool thousands_separator, int num_decimal_places);
void CStatusBar::DisplayQueueSize(wxLongLong totalSize, bool hasUnknown)
{
m_size = totalSize;
m_hasUnknownFiles = hasUnknown;
if (totalSize == 0 && !hasUnknown)
{
SetStatusText(_("Queue: empty"), FIELD_QUEUESIZE);
return;
}
wxString queueSize = wxString::Format(_("Queue: %s%s"), hasUnknown ? _T(">") : _T(""),
FormatSize(totalSize, true, m_sizeFormat, m_sizeFormatThousandsSep, m_sizeFormatDecimalPlaces).c_str());
SetStatusText(queueSize, FIELD_QUEUESIZE);
}
Code: Select all
void CStatusBar::DisplayQueueSize(wxLongLong totalSize, bool hasUnknown)
{
m_size = totalSize;
m_hasUnknownFiles = hasUnknown;
if (totalSize == 0 && !hasUnknown)
{
SetStatusText(_("Queue: empty"), FIELD_QUEUESIZE);
return;
}
double divider;
if (m_sizeFormat == 3)
divider = 1000.0;
else
divider = 1024.0;
double finalSize;
int p = 1;
if (totalSize > divider)
{
finalSize = totalSize.ToDouble() / divider;
}
else
finalSize = totalSize.ToDouble();
while (finalSize > divider && p < 6)
{
finalSize /= divider;
p++;
}
wxString queueSize;
if (!p)
queueSize.Printf(_("Queue: %s%0.2f bytes"), hasUnknown ? _T(">") : _T(""), finalSize);
else
{
// We stop at Exa. If someone has files bigger than that, he can afford to
// make a donation to have this changed ;)
const wxChar prefix[] = { ' ', 'K', 'M', 'G', 'T', 'P', 'E' };
queueSize.Printf(_("Queue: %s%0.2f %c"), hasUnknown ? _T(">") : _T(""), finalSize, prefix[p]);
if (m_sizeFormat == 1)
queueSize += 'i';
static wxChar byte_unit = 0;
if (!byte_unit)
{
wxString t = _("B <Unit symbol for bytes. Only translate first letter>");
byte_unit = t[0];
}
queueSize += byte_unit;
}
SetStatusText(queueSize, FIELD_QUEUESIZE);
}
Re: Queue size inaccurate 1.2GB shows as 2GiB
Excellent, thank you Tateu.
Will this now get rolled into a future version of Filezilla?
Cheers,
Mark
Will this now get rolled into a future version of Filezilla?
Cheers,
Mark
Re: Queue size inaccurate 1.2GB shows as 2GiB
Hopefully.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org
Re: Queue size inaccurate 1.2GB shows as 2GiB
Or simply use stock 3.2.8 and set the number of decimal places in the settings dialog.
Re: Queue size inaccurate 1.2GB shows as 2GiB
Oh, nice...I saw that you made some type of change with it but "Number of decimal places" is disabled when "Display size in bytes" is enabled so I didn't really catch on to it. Shouldn't "Number of decimal places" always be enabled, then?
Re: Queue size inaccurate 1.2GB shows as 2GiB
Temporarily swith to another option, set the number of decimals, then switch back.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org