[totem] properties: Move totem_time_to_string_text()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] properties: Move totem_time_to_string_text()
- Date: Fri, 8 Apr 2011 16:06:35 +0000 (UTC)
commit da59a451624c837ffbd7cd269ae7390bc0145b88
Author: Bastien Nocera <hadess hadess net>
Date: Fri Apr 8 16:34:12 2011 +0100
properties: Move totem_time_to_string_text()
To the only place that uses it.
src/backend/video-utils.c | 43 ------------------------
src/backend/video-utils.h | 1 -
src/properties/bacon-video-widget-properties.c | 43 ++++++++++++++++++++++++
3 files changed, 43 insertions(+), 44 deletions(-)
---
diff --git a/src/backend/video-utils.c b/src/backend/video-utils.c
index b4f9305..e4737d8 100644
--- a/src/backend/video-utils.c
+++ b/src/backend/video-utils.c
@@ -100,49 +100,6 @@ totem_time_to_string (gint64 msecs)
return g_strdup_printf (C_("short time format", "%d:%02d"), min, sec);
}
-char *
-totem_time_to_string_text (gint64 msecs)
-{
- char *secs, *mins, *hours, *string;
- int sec, min, hour, _time;
-
- _time = (int) (msecs / 1000);
- sec = _time % 60;
- _time = _time - sec;
- min = (_time % (60*60)) / 60;
- _time = _time - (min * 60);
- hour = _time / (60*60);
-
- hours = g_strdup_printf (ngettext ("%d hour", "%d hours", hour), hour);
-
- mins = g_strdup_printf (ngettext ("%d minute",
- "%d minutes", min), min);
-
- secs = g_strdup_printf (ngettext ("%d second",
- "%d seconds", sec), sec);
-
- if (hour > 0)
- {
- /* hour:minutes:seconds */
- string = g_strdup_printf (_("%s %s %s"), hours, mins, secs);
- } else if (min > 0) {
- /* minutes:seconds */
- string = g_strdup_printf (_("%s %s"), mins, secs);
- } else if (sec > 0) {
- /* seconds */
- string = g_strdup_printf (_("%s"), secs);
- } else {
- /* 0 seconds */
- string = g_strdup (_("0 seconds"));
- }
-
- g_free (hours);
- g_free (mins);
- g_free (secs);
-
- return string;
-}
-
static gboolean
totem_ratio_fits_screen_generic (GtkWidget *video_widget,
int new_w, int new_h,
diff --git a/src/backend/video-utils.h b/src/backend/video-utils.h
index 0736a22..eb3a147 100644
--- a/src/backend/video-utils.h
+++ b/src/backend/video-utils.h
@@ -32,7 +32,6 @@ void totem_gdk_window_set_invisible_cursor (GdkWindow *window);
void totem_gdk_window_set_waiting_cursor (GdkWindow *window);
char *totem_time_to_string (gint64 msecs);
-char *totem_time_to_string_text (gint64 msecs);
gboolean totem_ratio_fits_screen (GtkWidget *widget,
int video_width,
diff --git a/src/properties/bacon-video-widget-properties.c b/src/properties/bacon-video-widget-properties.c
index 5822f9c..e3ad125 100644
--- a/src/properties/bacon-video-widget-properties.c
+++ b/src/properties/bacon-video-widget-properties.c
@@ -138,6 +138,49 @@ bacon_video_widget_properties_reset (BaconVideoWidgetProperties *props)
bacon_video_widget_properties_set_label (props, "channels", _("0 Channels"));
}
+static char *
+totem_time_to_string_text (gint64 msecs)
+{
+ char *secs, *mins, *hours, *string;
+ int sec, min, hour, _time;
+
+ _time = (int) (msecs / 1000);
+ sec = _time % 60;
+ _time = _time - sec;
+ min = (_time % (60*60)) / 60;
+ _time = _time - (min * 60);
+ hour = _time / (60*60);
+
+ hours = g_strdup_printf (ngettext ("%d hour", "%d hours", hour), hour);
+
+ mins = g_strdup_printf (ngettext ("%d minute",
+ "%d minutes", min), min);
+
+ secs = g_strdup_printf (ngettext ("%d second",
+ "%d seconds", sec), sec);
+
+ if (hour > 0)
+ {
+ /* hour:minutes:seconds */
+ string = g_strdup_printf (_("%s %s %s"), hours, mins, secs);
+ } else if (min > 0) {
+ /* minutes:seconds */
+ string = g_strdup_printf (_("%s %s"), mins, secs);
+ } else if (sec > 0) {
+ /* seconds */
+ string = g_strdup_printf (_("%s"), secs);
+ } else {
+ /* 0 seconds */
+ string = g_strdup (_("0 seconds"));
+ }
+
+ g_free (hours);
+ g_free (mins);
+ g_free (secs);
+
+ return string;
+}
+
void
bacon_video_widget_properties_set_duration (BaconVideoWidgetProperties *props,
int _time)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]