Commit 369712ba authored by Nick Schermer's avatar Nick Schermer

Depend on glib 2.30 and remove some #if's.

Nearly all gtk 2.24 distros have 2.32 or newer, so
don't depend on 2.28 and use 2.30.
parent b54d10fb
......@@ -139,10 +139,10 @@ dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
XDT_CHECK_PACKAGE([EXO], [exo-1], [0.6.0])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.28.0])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.28.0])
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.28.0])
XDT_CHECK_PACKAGE([GMODULE], [gmodule-2.0], [2.28.0])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.30.0])
XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.30.0])
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.30.0])
XDT_CHECK_PACKAGE([GMODULE], [gmodule-2.0], [2.30.0])
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.24.0])
XDT_CHECK_PACKAGE([GDK_PIXBUF], [gdk-pixbuf-2.0], [2.14.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.9.0])
......
......@@ -267,7 +267,7 @@ thunar_deep_count_job_process (ExoJob *job,
/* emit status update whenever we've finished a directory,
* but not more than four times per second */
real_time = thunar_util_get_real_time ();
real_time = g_get_real_time ();
if (real_time >= count_job->last_time)
{
if (count_job->last_time != 0)
......
......@@ -1682,11 +1682,7 @@ gchar *
thunar_file_get_size_string (const ThunarFile *file)
{
_thunar_return_val_if_fail (THUNAR_IS_FILE (file), NULL);
#if GLIB_CHECK_VERSION (2, 30, 0)
return g_format_size (thunar_file_get_size (file));
#else
return g_format_size_for_display (thunar_file_get_size (file));
#endif
}
......
......@@ -2289,11 +2289,7 @@ thunar_list_model_get_statusbar_text (ThunarListModel *store,
if (G_LIKELY (file != NULL && thunar_file_get_free_space (file, &size)))
{
/* humanize the free space */
#if GLIB_CHECK_VERSION (2, 30, 0)
fspace_string = g_format_size (size);
#else
fspace_string = g_format_size_for_display (size);
#endif
/* check if we have atleast one file in this folder */
if (G_LIKELY (store->nrows > 0))
......@@ -2303,11 +2299,7 @@ thunar_list_model_get_statusbar_text (ThunarListModel *store,
size_summary += thunar_file_get_size (row->data);
/* humanize the size summary */
#if GLIB_CHECK_VERSION (2, 30, 0)
size_string = g_format_size (size_summary);
#else
size_string = g_format_size_for_display (size_summary);
#endif
/* generate a text which includes the size of all items in the folder */
text = g_strdup_printf (ngettext ("%d item (%s), Free space: %s", "%d items (%s), Free space: %s", store->nrows),
......@@ -2410,11 +2402,7 @@ thunar_list_model_get_statusbar_text (ThunarListModel *store,
if (size_summary > 0)
{
#if GLIB_CHECK_VERSION (2, 30, 0)
size_string = g_format_size (size_summary);
#else
size_string = g_format_size_for_display (size_summary);
#endif
text = g_strdup_printf (ngettext ("%d item selected (%s)", "%d items selected (%s)", n), n, size_string);
g_free (size_string);
}
......
......@@ -177,7 +177,7 @@ thunar_progress_view_init (ThunarProgressView *view)
GtkWidget *hbox;
/* remember the current time as start time */
view->start_time = thunar_util_get_real_time ();
view->start_time = g_get_real_time ();
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_add (GTK_CONTAINER (view), vbox);
......@@ -473,7 +473,7 @@ thunar_progress_view_percent (ThunarProgressView *view,
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (view->progress_bar), percent / 100.0);
/* check if we should update the time display (every 400ms) */
current_time = thunar_util_get_real_time ();
current_time = g_get_real_time ();
if (current_time - view->last_update_time > (400 * 1000))
{
/* calculate the remaining time (in seconds) */
......
......@@ -419,17 +419,3 @@ thunar_util_change_working_directory (const gchar *new_directory)
return old_directory;
}
#if !GLIB_CHECK_VERSION (2, 28, 0)
gint64
thunar_util_get_real_time (void)
{
GTimeVal tv;
g_get_current_time (&tv);
return (((gint64) tv.tv_sec) * G_USEC_PER_SEC) + tv.tv_usec;
}
#endif
......@@ -42,12 +42,6 @@ time_t thunar_util_time_from_rfc3339 (const gchar *date_string) G_
gchar *thunar_util_change_working_directory (const gchar *new_directory) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
#if GLIB_CHECK_VERSION (2, 28, 0)
#define thunar_util_get_real_time g_get_real_time
#else
gint64 thunar_util_get_real_time (void);
#endif
G_END_DECLS;
#endif /* !__THUNAR_UTIL_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment