[Xfce4-commits] <thunar:master> Depend on glib 2.30 and remove some #if's.

Nick Schermer noreply at xfce.org
Sat Sep 29 15:54:01 CEST 2012


Updating branch refs/heads/master
         to 369712ba250ac7e41939c9aa4aaa0f92ec18a99f (commit)
       from b54d10fbfd88f1555b31626e49a78dbe2e9da286 (commit)

commit 369712ba250ac7e41939c9aa4aaa0f92ec18a99f
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Sep 29 14:28:43 2012 +0200

    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.

 configure.in.in                |    8 ++++----
 thunar/thunar-deep-count-job.c |    2 +-
 thunar/thunar-file.c           |    4 ----
 thunar/thunar-list-model.c     |   12 ------------
 thunar/thunar-progress-view.c  |    4 ++--
 thunar/thunar-util.c           |   14 --------------
 thunar/thunar-util.h           |    6 ------
 7 files changed, 7 insertions(+), 43 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 5e4014e..91f9e46 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -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])
diff --git a/thunar/thunar-deep-count-job.c b/thunar/thunar-deep-count-job.c
index ab858c3..8e969c8 100644
--- a/thunar/thunar-deep-count-job.c
+++ b/thunar/thunar-deep-count-job.c
@@ -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)
diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index 1c9478e..8fff580 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -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
 }
 
 
diff --git a/thunar/thunar-list-model.c b/thunar/thunar-list-model.c
index f76f648..b0402c9 100644
--- a/thunar/thunar-list-model.c
+++ b/thunar/thunar-list-model.c
@@ -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);
         }
diff --git a/thunar/thunar-progress-view.c b/thunar/thunar-progress-view.c
index af189b1..7a3d15a 100644
--- a/thunar/thunar-progress-view.c
+++ b/thunar/thunar-progress-view.c
@@ -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) */
diff --git a/thunar/thunar-util.c b/thunar/thunar-util.c
index a728bae..24f7d05 100644
--- a/thunar/thunar-util.c
+++ b/thunar/thunar-util.c
@@ -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
diff --git a/thunar/thunar-util.h b/thunar/thunar-util.h
index 53a0bcc..779f936 100644
--- a/thunar/thunar-util.h
+++ b/thunar/thunar-util.h
@@ -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__ */


More information about the Xfce4-commits mailing list