View | Details | Raw Unified | Return to bug 11167
Collapse All | Expand All

(-)a/exo-mount/exo-mount-hal.c (+32 lines)
Lines 34-39 Link Here
34
#include <unistd.h>
34
#include <unistd.h>
35
#endif
35
#endif
36
36
37
#include <langinfo.h>
38
37
#include <libhal-storage.h>
39
#include <libhal-storage.h>
38
40
39
#include <exo-hal/exo-hal.h>
41
#include <exo-hal/exo-hal.h>
Lines 616-621 oom: g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM, g_strerror (ENOMEM)) Link Here
616
618
617
619
618
/**
620
/**
621
 * exo_mount_hal_iocharset:
622
 *
623
 * Determines the preferred iocharset for filesystems
624
 * that support it.
625
 *
626
 * Return value: iocharset string or %NULL if none.
627
 **/
628
static const gchar*
629
exo_mount_hal_iocharset ()
630
{
631
  const gchar* cs = g_getenv("EXO_MOUNT_IOCHARSET");
632
  if (cs != NULL)
633
    return cs;
634
635
  const char* codeset = nl_langinfo (CODESET);
636
  if (codeset && !strcmp (codeset, "UTF-8"))
637
    return "utf8";
638
639
  return NULL;
640
}
641
642
643
644
/**
619
 * exo_mount_hal_device_mount:
645
 * exo_mount_hal_device_mount:
620
 * @device : an #ExoMountHalDevice.
646
 * @device : an #ExoMountHalDevice.
621
 * @error  : return location for errors or %NULL.
647
 * @error  : return location for errors or %NULL.
Lines 676-681 exo_mount_hal_device_mount (ExoMountHalDevice *device, Link Here
676
              /* however this one is FreeBSD specific */
702
              /* however this one is FreeBSD specific */
677
              options[n++] = g_strdup ("longnames");
703
              options[n++] = g_strdup ("longnames");
678
            }
704
            }
705
          else if (strcmp (device->fsoptions[m], "iocharset=") == 0)
706
            {
707
              const gchar* iocharset = exo_mount_hal_iocharset();
708
              if (iocharset != NULL)
709
                options[n++] = g_strdup_printf ("iocharset=%s", iocharset);
710
            }
679
        }
711
        }
680
    }
712
    }
681
713
(-)a/exo-mount/main.c (+4 lines)
Lines 39-44 Link Here
39
#include <string.h>
39
#include <string.h>
40
#endif
40
#endif
41
41
42
#include <locale.h>
43
42
#include <glib/gstdio.h>
44
#include <glib/gstdio.h>
43
45
44
#include <exo-hal/exo-hal.h>
46
#include <exo-hal/exo-hal.h>
Lines 97-102 main (int argc, char **argv) Link Here
97
  /* initialize the i18n support */
99
  /* initialize the i18n support */
98
  xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
100
  xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
99
101
102
  setlocale(LC_CTYPE, "");
103
100
  /* initialize GTK+ */
104
  /* initialize GTK+ */
101
  if (!gtk_init_with_args (&argc, &argv, "Xfce mount", entries, GETTEXT_PACKAGE, &err))
105
  if (!gtk_init_with_args (&argc, &argv, "Xfce mount", entries, GETTEXT_PACKAGE, &err))
102
    {
106
    {

Return to bug 11167