[gnome-shell] format: move shell_format_int_alternative_output() to ShellJS



commit 49d8e6da404d9d715ec1a1544d6645ce9a83cf28
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Apr 10 11:21:19 2012 -0400

    format: move shell_format_int_alternative_output() to ShellJS
    
    gnome-shell-extension-prefs uses format(), but can't pull in Shell
    (which is a dependency for the module), since that in turn would pull in
    Meta. Fix this by moving the introspected int format function to ShellJS
    instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673106

 js/misc/format.js |    4 ++--
 src/shell-js.c    |   12 ++++++++++++
 src/shell-js.h    |    2 ++
 src/shell-util.c  |   12 ------------
 src/shell-util.h  |    2 --
 5 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/js/misc/format.js b/js/misc/format.js
index 74972ac..c30a1ba 100644
--- a/js/misc/format.js
+++ b/js/misc/format.js
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Shell = imports.gi.Shell;
+const ShellJS = imports.gi.ShellJS;
 
 /*
  * This function is intended to extend the String object and provide
@@ -50,7 +50,7 @@ function format() {
                         case 'd':
                             let intV = parseInt(args[i++]);
                             if (hasAlternativeIntFlag)
-                                s = Shell.format_int_alternative_output(intV);
+                                s = ShellJS.format_int_alternative_output(intV);
                             else
                                 s = intV.toString();
                             break;
diff --git a/src/shell-js.c b/src/shell-js.c
index 8267fdc..6657b48 100644
--- a/src/shell-js.c
+++ b/src/shell-js.c
@@ -79,3 +79,15 @@ shell_js_add_extension_importer (const char  *target_object_script,
   JS_EndRequest (context);
   return ret;
 }
+
+/**
+ * shell_js_format_int_alternative_output:
+ * @intval:
+ *
+ * Returns: (transfer full):
+ */
+gchar *
+shell_js_format_int_alternative_output (gint intval)
+{
+  return g_strdup_printf ("%Id", intval);
+}
diff --git a/src/shell-js.h b/src/shell-js.h
index 26cbf4d..fd85304 100644
--- a/src/shell-js.h
+++ b/src/shell-js.h
@@ -11,6 +11,8 @@ gboolean shell_js_add_extension_importer (const char   *target_object_script,
                                           const char   *directory,
                                           GError      **error);
 
+gchar   *shell_js_format_int_alternative_output (gint intval);
+
 G_BEGIN_DECLS
 
 #endif /* __SHELL_JS_H__ */
diff --git a/src/shell-util.c b/src/shell-util.c
index e7be812..0a1baab 100644
--- a/src/shell-util.c
+++ b/src/shell-util.c
@@ -868,15 +868,3 @@ shell_util_wifexited (int  status,
 
   return ret;
 }
-
-/**
- * shell_format_int_alternative_output:
- * @intval:
- *
- * Returns: (transfer full):
- */
-gchar *
-shell_format_int_alternative_output (gint intval)
-{
-  return g_strdup_printf ("%Id", intval);
-}
diff --git a/src/shell-util.h b/src/shell-util.h
index 2b21886..9208099 100644
--- a/src/shell-util.h
+++ b/src/shell-util.h
@@ -52,8 +52,6 @@ gboolean shell_session_is_active_for_systemd (void);
 gboolean shell_util_wifexited                  (int               status,
                                                 int              *exit);
 
-gchar    *shell_format_int_alternative_output  (gint              intval);
-
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]