[totem] backend: Move totem_string_to_time() to plugin
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] backend: Move totem_string_to_time() to plugin
- Date: Fri, 8 Apr 2011 16:06:30 +0000 (UTC)
commit 73f068111b97f5baa81ca370a56f7d4310aa86f8
Author: Bastien Nocera <hadess hadess net>
Date: Fri Apr 8 16:28:38 2011 +0100
backend: Move totem_string_to_time() to plugin
There's only one place it's currently used.
src/backend/video-utils.c | 22 ----------------------
src/backend/video-utils.h | 1 -
src/plugins/skipto/totem-time-entry.c | 22 ++++++++++++++++++++++
3 files changed, 22 insertions(+), 23 deletions(-)
---
diff --git a/src/backend/video-utils.c b/src/backend/video-utils.c
index 1b6c145..b4f9305 100644
--- a/src/backend/video-utils.c
+++ b/src/backend/video-utils.c
@@ -100,28 +100,6 @@ totem_time_to_string (gint64 msecs)
return g_strdup_printf (C_("short time format", "%d:%02d"), min, sec);
}
-gint64
-totem_string_to_time (const char *time_string)
-{
- int sec, min, hour, args;
-
- args = sscanf (time_string, C_("long time format", "%d:%02d:%02d"), &hour, &min, &sec);
-
- if (args == 3) {
- /* Parsed all three arguments successfully */
- return (hour * (60 * 60) + min * 60 + sec) * 1000;
- } else if (args == 2) {
- /* Only parsed the first two arguments; treat hour and min as min and sec, respectively */
- return (hour * 60 + min) * 1000;
- } else if (args == 1) {
- /* Only parsed the first argument; treat hour as sec */
- return hour * 1000;
- } else {
- /* Error! */
- return -1;
- }
-}
-
char *
totem_time_to_string_text (gint64 msecs)
{
diff --git a/src/backend/video-utils.h b/src/backend/video-utils.h
index 3080af5..0736a22 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);
-gint64 totem_string_to_time (const char *time_string);
char *totem_time_to_string_text (gint64 msecs);
gboolean totem_ratio_fits_screen (GtkWidget *widget,
diff --git a/src/plugins/skipto/totem-time-entry.c b/src/plugins/skipto/totem-time-entry.c
index 853f674..c5196c9 100644
--- a/src/plugins/skipto/totem-time-entry.c
+++ b/src/plugins/skipto/totem-time-entry.c
@@ -47,6 +47,28 @@ struct TotemTimeEntryPrivate {
G_DEFINE_TYPE (TotemTimeEntry, totem_time_entry, GTK_TYPE_SPIN_BUTTON)
+static gint64
+totem_string_to_time (const char *time_string)
+{
+ int sec, min, hour, args;
+
+ args = sscanf (time_string, C_("long time format", "%d:%02d:%02d"), &hour, &min, &sec);
+
+ if (args == 3) {
+ /* Parsed all three arguments successfully */
+ return (hour * (60 * 60) + min * 60 + sec) * 1000;
+ } else if (args == 2) {
+ /* Only parsed the first two arguments; treat hour and min as min and sec, respectively */
+ return (hour * 60 + min) * 1000;
+ } else if (args == 1) {
+ /* Only parsed the first argument; treat hour as sec */
+ return hour * 1000;
+ } else {
+ /* Error! */
+ return -1;
+ }
+}
+
static void
totem_time_entry_class_init (TotemTimeEntryClass *klass)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]