summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2022-02-17 21:37:46 +0100
committerBastien Nocera <hadess@hadess.net>2022-02-17 22:42:23 +0100
commitcbc3b4fca2f0df5f9688e4646c7600a472b9e738 (patch)
treeda4a65c825ebaba4bd71044802e30ace78d1eb9b /src/backend
parent1f0c4e58508f89cb0c6d1b096a1f1f094f1cbf53 (diff)
downloadtotem-cbc3b4fca2f0df5f9688e4646c7600a472b9e738.tar.gz
gst: Move unknown time special-case to helper function
This way, no translations left to be done in the time label widget.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/bacon-time-label.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/backend/bacon-time-label.c b/src/backend/bacon-time-label.c
index a10e4da78..310a86181 100644
--- a/src/backend/bacon-time-label.c
+++ b/src/backend/bacon-time-label.c
@@ -110,17 +110,10 @@ update_label_text (BaconTimeLabel *label)
if (length > 60 * 60 * 1000)
flags |= TOTEM_TIME_FLAG_FORCE_HOUR;
- if (length <= 0 ||
- _time > length) {
- if (!label->remaining) {
- label_str = totem_time_to_string (_time, flags);
- } else {
- /* translators: Unknown remaining time */
- label_str = g_strdup (_("--:--"));
- }
- } else {
+ if (length <= 0 || _time > length)
+ label_str = totem_time_to_string (label->remaining ? -1 : _time, flags);
+ else
label_str = totem_time_to_string (label->remaining ? length - _time : _time, flags);
- }
gtk_label_set_text (GTK_LABEL (label), label_str);
}