After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 537774 - [PATCH] fix track editor display of duration of tracks longer than 1 hour
[PATCH] fix track editor display of duration of tracks longer than 1 hour
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: User Interface
git master
Other All
: Normal normal
: 1.2
Assigned To: Alex Hixon
Banshee Maintainers
: 538853 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-06-11 12:23 UTC by Gregor Hoffleit
Modified: 2008-08-15 22:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix display of over 1 hour long files in Track Editor (1.33 KB, patch)
2008-06-11 12:25 UTC, Gregor Hoffleit
none Details | Review
Updated file properties patch. (1.89 KB, patch)
2008-07-21 00:29 UTC, Alex Hixon
needs-work Details | Review
File properties patch, with a bit of cleanup (2.06 KB, patch)
2008-07-21 20:34 UTC, Bertrand Lorentz
none Details | Review
Revised patch to take in Gabriels's suggestions. (2.21 KB, patch)
2008-08-15 00:31 UTC, Alex Hixon
none Details | Review
Working patch of above (1.06 KB, patch)
2008-08-15 02:53 UTC, Alex Hixon
none Details | Review
Apparently a description is necessary. (2.21 KB, patch)
2008-08-15 06:52 UTC, Alex Hixon
committed Details | Review

Description Gregor Hoffleit 2008-06-11 12:23:36 UTC
In the track editor, the duration of tracks longer than 1 hour is wrong. THe attached patch fixes the problem by borrowing some code from ColumnCellDuration.

Since this problem keeps creeping up, it certainly would be better to put the formatting code for durations at some global place.
Comment 1 Gregor Hoffleit 2008-06-11 12:25:07 UTC
Created attachment 112538 [details] [review]
Patch to fix display of over 1 hour long files in Track Editor

Fixes the problem of incorrect display of duration in the Track Editor (by borrowing some code from ColumnCellDuration).
Comment 2 Bertrand Lorentz 2008-06-11 17:59:48 UTC
Thank you for your patch.

You left out some characters around your format strings (a b c and d).

I think this formatting code could go into src/Libraries/Hyena/Hyena/DateTimeUtil.cs, there's already a method that does something similar (or identical ?).
Comment 3 Bertrand Lorentz 2008-07-01 16:41:23 UTC
*** Bug 538853 has been marked as a duplicate of this bug. ***
Comment 4 Alex Hixon 2008-07-21 00:29:10 UTC
Created attachment 114890 [details] [review]
Updated file properties patch.

Updated patch as per Bertrand's suggestion.
Comment 5 Gabriel Burt 2008-07-21 20:30:43 UTC
Alex, would you please rework your patch so that the actual String.Format call is done in a method that accepts int hours, int minutes, int seconds, and that the existing one (that just takes an int) and your new one use?  Thanks!
Comment 6 Bertrand Lorentz 2008-07-21 20:34:04 UTC
Created attachment 114949 [details] [review]
File properties patch, with a bit of cleanup

Just building on Alex's work, I'm taking the opportunity to remove manual time calculations, because they give me headaches.
Comment 7 Bertrand Lorentz 2008-07-21 20:38:26 UTC
Bah, didn't see Gabriel's comment...
Feel free to ignore my patch.
Comment 8 Alex Hixon 2008-08-15 00:31:30 UTC
Created attachment 116627 [details] [review]
Revised patch to take in Gabriels's suggestions.

Updated patch that makes use of the new FormatDuration (int hours, int minutes, int seconds). Also uses TimeSpan.FromSeconds (time) as suggested by Bertrand.
Comment 9 Alex Hixon 2008-08-15 02:53:55 UTC
Created attachment 116630 [details] [review]
Working patch of above

Woops, helps if it compiles, yeah? ;)
Comment 10 Gabriel Burt 2008-08-15 05:48:20 UTC
(In reply to comment #9) 
> Woops, helps if it compiles, yeah? ;)

Did you forget the TrackEditor.cs changes?
Comment 11 Alex Hixon 2008-08-15 05:55:36 UTC
Erk, yes, I did. They're identical to the ones in the previous patch.
Comment 12 Gabriel Burt 2008-08-15 05:58:44 UTC
But...I can't mark it accepted-commit_now w/o you attaching it again.
Comment 13 Alex Hixon 2008-08-15 06:52:14 UTC
Created attachment 116634 [details] [review]
Apparently a description is necessary.

I would've figured that it included the TrackEditor.cs changes too for it to be considered accepted-commit_now; especially since it's a one/two line change, but anyway - tada!

Thanks for taking a look at this, by the way.
Comment 14 Gabriel Burt 2008-08-15 16:19:01 UTC
Thanks Alex, looks good, please commit.
Comment 15 Alex Hixon 2008-08-15 22:38:34 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.