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

fix(apport-kde): Fix showing progress in the progress bar #151

Merged
merged 2 commits into from
Mar 30, 2023

Conversation

bdrung
Copy link
Collaborator

@bdrung bdrung commented Mar 30, 2023

Commit 57c674a tries to fix following crash:

$ ubuntu-bug dolphin
Traceback (most recent call last):
  File "/usr/share/apport/apport-kde", line 532, in <module>
    sys.exit(UserInterface.run_argv())
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 717, in run_argv
    return self.run_report_bug()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 558, in run_report_bug
    self.file_report()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 1391, in file_report
    self.ui_set_upload_progress(__upload_progress)
  File "/usr/share/apport/apport-kde", line 442, in ui_set_upload_progress
    self.progress.set(progress)
  File "/usr/share/apport/apport-kde", line 129, in set
    progress.setValue(value * 1000)
TypeError: setValue(self, int): argument 1 has unexpected type 'float'

The value is a float between 0 and 1. Converting the value to integer before multiplying by 1000 result only two values for the progress bar: 0% and 100%.

See https://launchpad.net/bugs/1876068 for the origin.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Commit 57c674a tries to fix following crash:

```
$ ubuntu-bug dolphin
Traceback (most recent call last):
  File "/usr/share/apport/apport-kde", line 532, in <module>
    sys.exit(UserInterface.run_argv())
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 717, in run_argv
    return self.run_report_bug()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 558, in run_report_bug
    self.file_report()
  File "/usr/lib/python3/dist-packages/apport/ui.py", line 1391, in file_report
    self.ui_set_upload_progress(__upload_progress)
  File "/usr/share/apport/apport-kde", line 442, in ui_set_upload_progress
    self.progress.set(progress)
  File "/usr/share/apport/apport-kde", line 129, in set
    progress.setValue(value * 1000)
TypeError: setValue(self, int): argument 1 has unexpected type 'float'
```

The value is a float between 0 and 1. Converting the value to integer
before multiplying by 1000 result only two values for the progress bar:
0% and 100%.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Merging #151 (a96228f) into main (22f4525) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #151      +/-   ##
==========================================
+ Coverage   81.95%   82.00%   +0.04%     
==========================================
  Files          87       87              
  Lines       18197    18206       +9     
==========================================
+ Hits        14914    14929      +15     
+ Misses       3283     3277       -6     
Impacted Files Coverage Δ
apport/ui.py 70.18% <100.00%> (ø)
bin/apport-cli 25.30% <100.00%> (+0.30%) ⬆️
gtk/apport-gtk 77.46% <100.00%> (+0.05%) ⬆️
kde/apport-kde 83.18% <100.00%> (+1.83%) ⬆️
tests/integration/test_ui.py 97.35% <100.00%> (ø)
tests/system/test_ui_kde.py 96.64% <100.00%> (+0.06%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@LaurentBonnaud
Copy link

Thanks a lot for this fix!

@schopin-pro schopin-pro merged commit f2a4e9e into canonical:main Mar 30, 2023
@bdrung bdrung deleted the fix-progress-bar branch March 30, 2023 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants