[Xfce4-commits] <thunar:andrzejr/utf8_collate> Removed unused functions.
Andrzej
noreply at xfce.org
Tue May 1 18:12:01 CEST 2012
Updating branch refs/heads/andrzejr/utf8_collate
to 915b4845cfd1a8c19aa38c05116fc72deb18b0c1 (commit)
from 0453a720ee9f354447ca351cabf5d5cdf4838e08 (commit)
commit 915b4845cfd1a8c19aa38c05116fc72deb18b0c1
Author: Andrzej <ndrwrdck at gmail.com>
Date: Wed May 2 01:11:21 2012 +0900
Removed unused functions.
thunar/thunar-file.c | 94 --------------------------------------------------
1 files changed, 0 insertions(+), 94 deletions(-)
diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index a4d288b..13e35d3 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -3198,100 +3198,6 @@ thunar_file_destroy (ThunarFile *file)
-static guint
-skip_leading_zeros (const gchar **ap,
- const gchar *name)
-{
- const gchar *bp;
- guint skipped_zeros = 0;
-
- /* do a backward search to check if the number starts with a '0' */
- for (bp = *ap; bp >= name; --bp)
- {
- if (*bp != '0')
- break;
- }
-
- /* if the number starts with a '0' skip all following '0' */
- if (!g_ascii_isdigit (*bp) || *bp == '0')
- {
- for (bp = *ap; *bp != '\0'; ++bp)
- {
- if (*bp != '0')
- break;
- }
-
- skipped_zeros = bp - *ap;
- *ap = bp;
- return skipped_zeros;
- }
-
- return 0;
-}
-
-
-
-static gint
-compare_by_name_using_number (const gchar *ap,
- const gchar *bp,
- const gchar *start_a,
- const gchar *start_b)
-{
- const gchar *ai;
- const gchar *bi;
- gchar ac;
- gchar bc;
- guint skipped_zeros_a;
- guint skipped_zeros_b;
-
- /* up until now the numbers match. Now compare the numbers by digit
- * count, the longest number is the largest. If the lengths are equal
- * compare the digits. */
-
- /* skip leading zeros of both numbers */
- skipped_zeros_a = skip_leading_zeros (&ap, start_a);
- skipped_zeros_b = skip_leading_zeros (&bp, start_b);
-
- /* determine the largest number */
- for (ai = ap, bi = bp;; ++ai, ++bi)
- {
- ac = *ai;
- bc = *bi;
- if (!g_ascii_isdigit (ac) || !g_ascii_isdigit (bc))
- break;
- }
-
- /* if one of the numbers still has a digit, that number is the largest. */
- if (g_ascii_isdigit (ac))
- return 1;
- else if (g_ascii_isdigit (bc))
- return -1;
-
- /* both numbers have the same length. look for the first digit that
- * is different */
- for (;; ++ap, ++bp)
- {
- ac = *ap;
- bc = *bp;
-
- /* check if the characters differ or we have a non-digit char */
- if (ac != bc || !g_ascii_isdigit (ac))
- break;
- }
-
- /* if we have reached the end of the numbers and they are still equal,
- * then they differ only in the number of leading zeros. let us always
- * sort the one with more leading zeros first. */
- if (G_UNLIKELY (!g_ascii_isdigit (ac) || !g_ascii_isdigit (bc)))
- return skipped_zeros_b - skipped_zeros_a;
-
- /* for all regular numbers that have the same length, the one with the
- * lowest different digit should be sorted first */
- return (ac - bc);
-}
-
-
-
/**
* thunar_file_compare_by_name:
* @file_a : the first #ThunarFile.
More information about the Xfce4-commits
mailing list