diff options
author | Monsta <[email protected]> | 2015-01-12 16:04:13 +0300 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2015-01-13 11:55:00 +0100 |
commit | 53ec021ce6e0ee923bd86e11b4f516b2a19bc2e8 (patch) | |
tree | bc422498f805a6ae0b5495157a7482616ec16259 /libcaja-private/caja-file.c | |
parent | d327a96cfb61acd0ce606c4bf80349454b66bd44 (diff) | |
download | caja-53ec021ce6e0ee923bd86e11b4f516b2a19bc2e8.tar.bz2 caja-53ec021ce6e0ee923bd86e11b4f516b2a19bc2e8.tar.xz |
drop support for GLib < 2.36
Closes https://github.com/mate-desktop/caja/pull/372
Diffstat (limited to 'libcaja-private/caja-file.c')
-rw-r--r-- | libcaja-private/caja-file.c | 60 |
1 files changed, 21 insertions, 39 deletions
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c index d41c2b45..2e3ad466 100644 --- a/libcaja-private/caja-file.c +++ b/libcaja-private/caja-file.c @@ -72,8 +72,6 @@ #include <unistd.h> #include <sys/stat.h> -#include <src/glibcompat.h> /* for g_list_free_full */ - #ifdef HAVE_SELINUX #include <selinux/selinux.h> #endif @@ -5958,14 +5956,10 @@ caja_file_get_size_as_string (CajaFile *file) return NULL; } - #if GLIB_CHECK_VERSION(2, 30, 0) - if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) - return g_format_size_full (file->details->size, G_FORMAT_SIZE_IEC_UNITS); - else - return g_format_size (file->details->size); - #else // Since 2.16 - return g_format_size_for_display(file->details->size); - #endif + if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) + return g_format_size_full (file->details->size, G_FORMAT_SIZE_IEC_UNITS); + else + return g_format_size (file->details->size); } /** @@ -5985,8 +5979,8 @@ caja_file_get_size_as_string_with_real_size (CajaFile *file) { guint item_count; gboolean count_unreadable; - char * formated; - char * formated_plus_real; + char * formatted; + char * formatted_plus_real; char * real_size; if (file == NULL) { @@ -6006,21 +6000,17 @@ caja_file_get_size_as_string_with_real_size (CajaFile *file) return NULL; } - #if GLIB_CHECK_VERSION(2, 30, 0) - if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) - formated = g_format_size_full (file->details->size, G_FORMAT_SIZE_IEC_UNITS); - else - formated = g_format_size(file->details->size); - #else - formated = g_format_size_for_display(file->details->size); - #endif + if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) + formatted = g_format_size_full (file->details->size, G_FORMAT_SIZE_IEC_UNITS); + else + formatted = g_format_size(file->details->size); /* Do this in a separate stage so that we don't have to put G_GUINT64_FORMAT in the translated string */ real_size = g_strdup_printf (_("%"G_GUINT64_FORMAT), (guint64) file->details->size); - formated_plus_real = g_strdup_printf (_("%s (%s bytes)"), formated, real_size); + formatted_plus_real = g_strdup_printf (_("%s (%s bytes)"), formatted, real_size); g_free (real_size); - g_free (formated); - return formated_plus_real; + g_free (formatted); + return formatted_plus_real; } @@ -6081,14 +6071,10 @@ caja_file_get_deep_count_as_string_internal (CajaFile *file, */ if (report_size) { - #if GLIB_CHECK_VERSION(2, 30, 0) - if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) - return g_format_size_full (total_size, G_FORMAT_SIZE_IEC_UNITS); - else - return g_format_size(total_size); - #else - return g_format_size_for_display(total_size); - #endif + if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) + return g_format_size_full (total_size, G_FORMAT_SIZE_IEC_UNITS); + else + return g_format_size(total_size); } return format_item_count_for_display (report_directory_count @@ -6899,14 +6885,10 @@ caja_file_get_volume_free_space (CajaFile *file) if (directory->details->free_space != (guint64) -1) { - #if GLIB_CHECK_VERSION(2, 30, 0) - if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) - res = g_format_size_full (directory->details->free_space, G_FORMAT_SIZE_IEC_UNITS); - else - res = g_format_size(directory->details->free_space); - #else - res = g_format_size_for_display(directory->details->free_space); - #endif + if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_USE_IEC_UNITS)) + res = g_format_size_full (directory->details->free_space, G_FORMAT_SIZE_IEC_UNITS); + else + res = g_format_size(directory->details->free_space); } return res; |