5 #ifndef USE_STABLE_LIBGNOMEUI
6 #include <libgnomeui/gnome-icon-lookup.h>
10 #include <sys/types.h>
12 #include "egg-recent-util.h"
18 #define EGG_RECENT_UTIL_HOSTNAME_SIZE 512
20 /* ripped out of gedit2 */
22 egg_recent_util_escape_underlines (const gchar* text)
29 g_return_val_if_fail (text != NULL, NULL);
31 length = strlen (text);
33 str = g_string_new ("");
41 next = g_utf8_next_char (p);
46 g_string_append (str, "__");
49 g_string_append_len (str, p, next - p);
56 return g_string_free (str, FALSE);
60 egg_recent_util_get_icon (GtkIconTheme *theme, const gchar *uri,
61 const gchar *mime_type, int size)
63 #ifndef USE_STABLE_LIBGNOMEUI
67 icon = gnome_icon_lookup (theme, NULL, uri, NULL, NULL,
70 g_return_val_if_fail (icon != NULL, NULL);
72 pixbuf = gtk_icon_theme_load_icon (theme, icon, size, 0, NULL);
81 egg_recent_util_get_unique_id (void)
83 char hostname[EGG_RECENT_UTIL_HOSTNAME_SIZE];
89 gethostname (hostname, EGG_RECENT_UTIL_HOSTNAME_SIZE);
92 DWORD size = EGG_RECENT_UTIL_HOSTNAME_SIZE;
93 GetComputerName (hostname, &size);
98 rand = g_random_int ();
101 return g_strdup_printf ("%s-%d-%d-%d", hostname, (int)time, (int)rand, (int)pid);