Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong system information #2222

Closed
2 tasks done
3119369616 opened this issue Jan 31, 2024 · 1 comment · Fixed by #2223
Closed
2 tasks done

Wrong system information #2222

3119369616 opened this issue Jan 31, 2024 · 1 comment · Fixed by #2223
Labels
bug Something isn't working

Comments

@3119369616
Copy link

3119369616 commented Jan 31, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

My real memory size is 16GB, but it is displayed incorrectly in the sample program system_information.
image

What is the expected behavior?

Show correct total memory size and used memory size.

Version

master

Operating System

Windows

Do you have any log output?

No console output
@3119369616 3119369616 added the bug Something isn't working label Jan 31, 2024
@brianch
Copy link
Contributor

brianch commented Jan 31, 2024

From what I see, here we call sysinfo's total_memory(), which returns the value in bytes and not kylobytes as the documentation in Iced's Information struct says.

And so, in the example, changing:

ByteSize::kb(information.memory_total).to_string();

to

ByteSize::b(information.memory_total).to_string();

Fix the issue.

I can send a PR later to changing the example and the docs text if that's ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants