diff options
author | Bertrand Lorentz <bertrand.lorentz@gmail.com> | 2013-04-07 21:59:53 +0200 |
---|---|---|
committer | Bertrand Lorentz <bertrand.lorentz@gmail.com> | 2013-04-07 22:05:00 +0200 |
commit | bc31ad620e9e15fe619314c979986742be7ee3a9 (patch) | |
tree | 798df8e99701d09df5b288a5794f64cb2838d134 | |
parent | 5700f55202f8d2f48f3d13fff5f498c89ef4cfda (diff) |
DapPropertiesDialog: Make sure progress bar value is valid (bgo#696700)
-rw-r--r-- | src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapPropertiesDialog.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapPropertiesDialog.cs b/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapPropertiesDialog.cs index d439faa22..a317b67d6 100644 --- a/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapPropertiesDialog.cs +++ b/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapPropertiesDialog.cs @@ -143,7 +143,8 @@ namespace Banshee.Dap private ProgressBar UsedProgressBar { get { ProgressBar usedBar = new ProgressBar(); - usedBar.Fraction = (double)source.BytesUsed / (double)source.BytesCapacity; + double progress = (double)source.BytesUsed / (double)source.BytesCapacity; + usedBar.Fraction = Math.Max (0.0, Math.Min (1.0, progress)); usedBar.Text = String.Format ( Catalog.GetString("{0} of {1}"), new Hyena.Query.FileSizeQueryValue (source.BytesUsed).ToUserQuery (), |