From 17b6487602f0b61572db537da9e72879c6f2a9ef Mon Sep 17 00:00:00 2001 From: Benedikt Meurer <benny@xfce.org> Date: Tue, 14 Feb 2006 00:01:23 +0000 Subject: [PATCH] 2006-02-13 Benedikt Meurer <benny@xfce.org> * acinclude.m4, configure.in.in, thunar-vfs/Makefile.am, thunar-vfs/thunar-vfs-volume-hal.c, thunar-vfs/thunar-vfs-volume.c, thunar-vfs/thunar-vfs-volume-freebsd.{c,h}, thunar-vfs/thunar-vfs-volume-none.{c,h}: Do not use AC_CONFIG_LINKS() anymore and let the user select it's preferred volume manager using the --with-volume-manager configure switch. * po/POTFILES.in: Update file list. * po/Thunar.pot, po/*.po: Update translations. (Old svn revision: 19862) --- ChangeLog | 11 + acinclude.m4 | 66 ++++ configure.in.in | 43 +-- po/POTFILES.in | 5 +- po/Thunar.pot | 12 +- po/ca.po | 12 +- po/de.po | 12 +- po/el.po | 12 +- po/es.po | 12 +- po/fr.po | 12 +- po/hu.po | 12 +- po/it.po | 12 +- po/ja.po | 12 +- po/nl.po | 12 +- po/pl.po | 12 +- po/pt_BR.po | 12 +- po/ru.po | 12 +- thunar-vfs/Makefile.am | 42 +- thunar-vfs/thunar-vfs-volume-bsd.h | 55 --- ...lume-bsd.c => thunar-vfs-volume-freebsd.c} | 359 +++++++++--------- thunar-vfs/thunar-vfs-volume-freebsd.h | 55 +++ thunar-vfs/thunar-vfs-volume-hal.c | 9 - ...volume-sysv.c => thunar-vfs-volume-none.c} | 45 +-- thunar-vfs/thunar-vfs-volume-none.h | 55 +++ thunar-vfs/thunar-vfs-volume-sysv.h | 55 --- thunar-vfs/thunar-vfs-volume.c | 21 +- 26 files changed, 518 insertions(+), 459 deletions(-) create mode 100644 acinclude.m4 delete mode 100644 thunar-vfs/thunar-vfs-volume-bsd.h rename thunar-vfs/{thunar-vfs-volume-bsd.c => thunar-vfs-volume-freebsd.c} (50%) create mode 100644 thunar-vfs/thunar-vfs-volume-freebsd.h rename thunar-vfs/{thunar-vfs-volume-sysv.c => thunar-vfs-volume-none.c} (55%) create mode 100644 thunar-vfs/thunar-vfs-volume-none.h delete mode 100644 thunar-vfs/thunar-vfs-volume-sysv.h diff --git a/ChangeLog b/ChangeLog index d774a5555..b9253d309 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-02-13 Benedikt Meurer <benny@xfce.org> + + * acinclude.m4, configure.in.in, thunar-vfs/Makefile.am, + thunar-vfs/thunar-vfs-volume-hal.c, thunar-vfs/thunar-vfs-volume.c, + thunar-vfs/thunar-vfs-volume-freebsd.{c,h}, + thunar-vfs/thunar-vfs-volume-none.{c,h}: Do not use AC_CONFIG_LINKS() + anymore and let the user select it's preferred volume manager using + the --with-volume-manager configure switch. + * po/POTFILES.in: Update file list. + * po/Thunar.pot, po/*.po: Update translations. + 2006-02-13 Benedikt Meurer <benny@xfce.org> * thunar-vfs/thunar-vfs-volume-hal.c: Properly update volume state diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 000000000..b3c158666 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,66 @@ +dnl $Id$ +dnl +dnl Copyright (c) 2004-2006 +dnl The Thunar development team. All rights reserved. +dnl +dnl Written for Thunar by Benedikt Meurer <benny@xfce.org>. +dnl + + + +dnl # BM_THUNAR_VFS_VOLUME_IMPL() +dnl # +dnl # Determines the volume manager implementation to +dnl # use for thunar-vfs. +dnl # +AC_DEFUN([BM_THUNAR_VFS_VOLUME_IMPL], +[ + dnl The --with-volume-manager option + AC_ARG_WITH([volume-manager], +AC_HELP_STRING([--with-volume-manager=@<:@auto/freebsd/hal/none@:>@], [The volume manager implementation @<:@default=auto@:>@]), + [], [with_volume_manager=auto]) + + dnl # Check if we should try to auto-detect + if test x"$with_volume_manager" = x"auto"; then + dnl # Check target platform + case "$target_os" in + freebsd*) + dnl # FreeBSD is fully supported + with_volume_manager=freebsd + ;; + *) + dnl # Otherwise, check if we have HAL + XDT_CHECK_PACKAGE([HAL], [hal-storage], [0.5.0], [with_volume_manager=hal], [with_volume_manager=none]) + ;; + esac + fi + + dnl # We need HAL >= 0.5.x and D-BUS >= 0.23 for the HAL volume manager + if test x"$with_volume_manager" = x"hal"; then + XDT_CHECK_PACKAGE([HAL], [hal-storage], [0.5.0]) + XDT_CHECK_PACKAGE([HAL_DBUS], [dbus-glib-1], [0.23]) + fi + + dnl # Set config.h variables depending on what we're going to use + AC_MSG_CHECKING([for the volume manager implemenation]) + case "$with_volume_manager" in + freebsd) + AC_DEFINE([THUNAR_VFS_VOLUME_IMPL_FREEBSD], [1], [Define to 1 if the FreeBSD volume manager implementation should be used]) + ;; + + hal) + AC_DEFINE([THUNAR_VFS_VOLUME_IMPL_HAL], [1], [Define to 1 if the HAL volume manager implementation should be used]) + ;; + + *) + AC_DEFINE([THUNAR_VFS_VOLUME_IMPL_NONE], [1], [Define to 1 if no volume manager implementation should be used]) + with_volume_manager=none + ;; + esac + AC_MSG_RESULT([$with_volume_manager]) + + dnl # Set automake conditionals appropriately + AM_CONDITIONAL([THUNAR_VFS_VOLUME_IMPL_FREEBSD], [test x"$with_volume_manager" = x"freebsd"]) + AM_CONDITIONAL([THUNAR_VFS_VOLUME_IMPL_HAL], [test x"$with_volume_manager" = x"hal"]) + AM_CONDITIONAL([THUNAR_VFS_VOLUME_IMPL_NONE], [test x"$with_volume_manager" = x"none"]) +]) diff --git a/configure.in.in b/configure.in.in index c2d464ca3..aac4fed2b 100644 --- a/configure.in.in +++ b/configure.in.in @@ -234,45 +234,10 @@ fi AC_SUBST([LIBFAM_CFLAGS]) AC_SUBST([LIBFAM_LIBS]) -dnl ************************************ -dnl *** Check for the system flavour *** -dnl ************************************ -case "$target_os" in -*bsd*) - FLAVOUR="bsd" - ;; -*linux*) - # on Linux, we try to use HAL first, and fallback to generic - XDT_CHECK_PACKAGE([HAL], [hal-storage], [0.5.0], - [ - # we also need D-BUS GLib bindings, but 0.23 will do - XDT_CHECK_PACKAGE([HAL_DBUS], [dbus-glib-1], [0.23], - [ - FLAVOUR="hal" - ], - [ - FLAVOUR="sysv" - ]) - ], - [ - FLAVOUR="sysv" - ]) - ;; -*) - FLAVOUR="sysv" - ;; -esac -AC_MSG_CHECKING([for system flavour]) -AC_MSG_RESULT([$FLAVOUR]) - -dnl ********************************************************** -dnl *** Create links for the volume manager implementation *** -dnl ********************************************************** -AC_CONFIG_LINKS( -[ - thunar-vfs/thunar-vfs-volume-impl.c:thunar-vfs/thunar-vfs-volume-$FLAVOUR.c - thunar-vfs/thunar-vfs-volume-impl.h:thunar-vfs/thunar-vfs-volume-$FLAVOUR.h -]) +dnl *********************************************** +dnl *** Check for volume manager implementation *** +dnl *********************************************** +BM_THUNAR_VFS_VOLUME_IMPL() dnl *********************************** dnl *** Check for debugging support *** diff --git a/po/POTFILES.in b/po/POTFILES.in index bd67c9dce..31a4403db 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -28,9 +28,10 @@ thunar-vfs/thunar-vfs-transfer-job.c thunar-vfs/thunar-vfs-unlink-job.c thunar-vfs/thunar-vfs-user.c thunar-vfs/thunar-vfs-util.c -thunar-vfs/thunar-vfs-volume-bsd.c +thunar-vfs/thunar-vfs-volume-freebsd.c thunar-vfs/thunar-vfs-volume-hal.c -thunar-vfs/thunar-vfs-volume-sysv.c +thunar-vfs/thunar-vfs-volume-none.c +thunar-vfs/thunar-vfs-volume.c thunar-vfs/thunar-vfs-xfer.c thunar-vfs/thunar-vfs.c diff --git a/po/Thunar.pot b/po/Thunar.pot index 509cc9612..89c3ffc44 100644 --- a/po/Thunar.pot +++ b/po/Thunar.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -234,20 +234,20 @@ msgid "Unknown user `%s'" msgstr "" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 msgid "Unknown error" msgstr "" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, c-format msgid "Unable to determine the mount point for %s" msgstr "" #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, c-format msgid "Failed to open /proc/mounts: %s" msgstr "" diff --git a/po/ca.po b/po/ca.po index 34cf0aca1..3b3a1d8d1 100644 --- a/po/ca.po +++ b/po/ca.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2006-01-29 15:14+0900\n" "Last-Translator: Pau Rul·lan Ferragut <paurullan@bulma.net>\n" "Language-Team: Catalan\n" @@ -253,21 +253,21 @@ msgid "Unknown user `%s'" msgstr "Usuari `%s' desconegut" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 #, fuzzy msgid "Unknown error" msgstr "Desconegut fitxer propietari" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "No s'ha pogut determinar l'informació de `%s'" #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "Ha fallat" diff --git a/po/de.po b/po/de.po index a02c7ed33..29652485e 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2006-02-05 23:10+0100\n" "Last-Translator: Benedikt Meurer <benny@xfce.org>\n" "Language-Team: German <de@li.org>\n" @@ -241,20 +241,20 @@ msgid "Unknown user `%s'" msgstr "Unbekannter Benutzer »%s«" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 msgid "Unknown error" msgstr "Unbekannter Fehler" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "Andere Anwendung..." #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "Konnte »%s« nicht umbenennen" diff --git a/po/el.po b/po/el.po index 86dec3df8..bf0e318c7 100644 --- a/po/el.po +++ b/po/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2006-02-12 03:05+0200\n" "Last-Translator: Stavros Giannouris <stavrosg2002@freemail.gr>\n" "Language-Team: Greek <nls@tux.hellug.gr>\n" @@ -251,20 +251,20 @@ msgid "Unknown user `%s'" msgstr "Άγνωστος χÏήστης `%s'" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 msgid "Unknown error" msgstr "Άγνωστο σφάλμα" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "Ο Ï€ÏοσδιοÏισμός των πληÏοφοÏιών αÏχείου για το `%s' απÎτυχε" #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "Η διαγÏαφή του \"%s\" απÎτυχε: %s" diff --git a/po/es.po b/po/es.po index 44f685dec..ebb2b2b25 100644 --- a/po/es.po +++ b/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2005-10-14 23:57+0900\n" "Last-Translator: Pablo Hernández-M. Saiz <homeless3d@gmail.com>\n" "Language-Team: Spanish <es@li.org>\n" @@ -252,20 +252,20 @@ msgid "Unknown user `%s'" msgstr "" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 msgid "Unknown error" msgstr "" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "Imposible renombrar %s." #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "Imposible renombrar %s." diff --git a/po/fr.po b/po/fr.po index fea067aa8..e6a13f83c 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2006-01-01 15:02+0100\n" "Last-Translator: Stephane Roy <sroy@j2n.net>\n" "Language-Team: French <traduc@traduc.org>\n" @@ -252,21 +252,21 @@ msgid "Unknown user `%s'" msgstr "Élément <%s> inconnu" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 #, fuzzy msgid "Unknown error" msgstr "Élément <%s> inconnu" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "Échec à la détermination d'informations sur le fichier `%s'" #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "Échec au changement de nom de `%s'" diff --git a/po/hu.po b/po/hu.po index 522efbda9..7230c9d7f 100644 --- a/po/hu.po +++ b/po/hu.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2005-10-06 22:02+0900\n" "Last-Translator: SZERVÃC Attila <sas@321.hu>\n" "Language-Team: Hungarian <translation-team-hu@lists.sourceforge.net>\n" @@ -250,20 +250,20 @@ msgid "Unknown user `%s'" msgstr "" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 msgid "Unknown error" msgstr "" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "Nem sikerült meghatározni a szülÅ‘ URI-t ehhez: %s" #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "Nem törölhetÅ‘: %s" diff --git a/po/it.po b/po/it.po index fa1313808..0b656003c 100644 --- a/po/it.po +++ b/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2006-01-21 10:58+0100\n" "Last-Translator: Roberto Pariset <r.pariset@gmail.com>\n" "Language-Team: GUFI <traduzioni@gufi.org>\n" @@ -255,21 +255,21 @@ msgid "Unknown user `%s'" msgstr "Utente `%s' sconosciuto" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 #, fuzzy msgid "Unknown error" msgstr "Utente `%s' sconosciuto" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "Impossibile reperire informazioni per il file `%s'" #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "Impossibile rinominare `%s'" diff --git a/po/ja.po b/po/ja.po index 12d14edef..fc6191111 100644 --- a/po/ja.po +++ b/po/ja.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2006-02-11 20:29+0900\n" "Last-Translator: Daichi Kawahata <daichi@xfce.org>\n" "Language-Team: Japanese <xfce-users-jp@ml.fdiary.net>\n" @@ -258,20 +258,20 @@ msgid "Unknown user `%s'" msgstr "ユーザー「%sã€ã¯ä¸æ˜Žã§ã™ã€‚" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 msgid "Unknown error" msgstr "åŽŸå› ä¸æ˜Žã®ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "「%sã€ã®ãƒ•ã‚¡ã‚¤ãƒ«æƒ…å ±ã‚’ç¢ºå®šã™ã‚‹ã®ã«å¤±æ•—ã—ã¾ã—ãŸã€‚" #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "「%sã€ã‚’é–‹ãã®ã«å¤±æ•—ã—ã¾ã—ãŸ: %s" diff --git a/po/nl.po b/po/nl.po index 4f97a106f..da202f86d 100644 --- a/po/nl.po +++ b/po/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2006-01-31 14:07+0100\n" "Last-Translator: Vincent Tunru <imnotb@gmail.com>\n" "Language-Team: Dutch <vertaling@vrijschrift.org>\n" @@ -259,21 +259,21 @@ msgid "Unknown user `%s'" msgstr "Onbekende gebruiker '%s'" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 #, fuzzy msgid "Unknown error" msgstr "Onbekende eigenaar" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "Fout bij het ophalen van bestandsinfo van `%s'" #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "Fout bij het wijzigen van de naam van `%s'" diff --git a/po/pl.po b/po/pl.po index e0c738a85..8a14c5422 100644 --- a/po/pl.po +++ b/po/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2006-01-13 14:21+0100\n" "Last-Translator: Tomasz MichaÅ‚ Åukaszewski <T.Lukaszewski@aster.pl>\n" "Language-Team: Polish <pl@li.org>\n" @@ -251,21 +251,21 @@ msgid "Unknown user `%s'" msgstr "" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 #, fuzzy msgid "Unknown error" msgstr "data nieznana" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "Nie udaÅ‚o siÄ™ odczytać atrybutów pliku '%s'" #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "Nie udaÅ‚o siÄ™ zmienić nazwy %s." diff --git a/po/pt_BR.po b/po/pt_BR.po index 7df695657..363680fd3 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2006-02-10 22:34-0200\n" "Last-Translator: Rodrigo Coacci <rcoacci@gmail.com>\n" "Language-Team: os-cillation <info@os-cillation.com>\n" @@ -250,20 +250,20 @@ msgid "Unknown user `%s'" msgstr "Usuário desconhecido `%s'" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 msgid "Unknown error" msgstr "Erro desconhecido" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "Falha em determinar informação de arquivo para `%s'" #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "Falha ao abrir \"%s\": %s" diff --git a/po/ru.po b/po/ru.po index 026a9b7b9..600814282 100644 --- a/po/ru.po +++ b/po/ru.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Thunar 0.2.1svn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-13 18:53+0100\n" +"POT-Creation-Date: 2006-02-14 00:36+0100\n" "PO-Revision-Date: 2006-01-29 17:47+0500\n" "Last-Translator: Andrey Fedoseev <andrey.fedoseev@gmail.com>\n" "Language-Team: Russian <ru@li.org>\n" @@ -253,21 +253,21 @@ msgid "Unknown user `%s'" msgstr "ÐеизвеÑтный пользователь '%s'" #. no useful information, *narf* -#: ../thunar-vfs/thunar-vfs-volume-bsd.c:303 +#: ../thunar-vfs/thunar-vfs-volume-freebsd.c:303 #: ../thunar-vfs/thunar-vfs-volume-hal.c:218 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:276 -#: ../thunar-vfs/thunar-vfs-volume-hal.c:391 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:286 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:401 #, fuzzy msgid "Unknown error" msgstr "ÐеизвеÑтный пользователь '%s'" -#: ../thunar-vfs/thunar-vfs-volume-hal.c:332 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:342 #, fuzzy, c-format msgid "Unable to determine the mount point for %s" msgstr "Ðе удалоÑÑŒ определить информацию о файле '%s'" #. if we cannot read /proc/mounts, we cannot where the volume was mounted -#: ../thunar-vfs/thunar-vfs-volume-hal.c:340 +#: ../thunar-vfs/thunar-vfs-volume-hal.c:350 #, fuzzy, c-format msgid "Failed to open /proc/mounts: %s" msgstr "Ðе удалоÑÑŒ переименовать `%s'" diff --git a/thunar-vfs/Makefile.am b/thunar-vfs/Makefile.am index 8064f33f0..3f87b95d6 100644 --- a/thunar-vfs/Makefile.am +++ b/thunar-vfs/Makefile.am @@ -51,6 +51,7 @@ libthunar_vfs_include_HEADERS = \ thunar-vfs.h libthunar_vfs_1_la_SOURCES = \ + $(libthunar_vfs_volume_impl_sources) \ $(libthunar_vfs_built_sources) \ $(libthunar_vfs_headers) \ thunar-vfs-chmod-job.c \ @@ -102,8 +103,6 @@ libthunar_vfs_1_la_SOURCES = \ thunar-vfs-user.c \ thunar-vfs-util.c \ thunar-vfs-volume.c \ - thunar-vfs-volume-impl.c \ - thunar-vfs-volume-impl.h \ thunar-vfs-xfer.c \ thunar-vfs-xfer.h \ thunar-vfs.c @@ -112,8 +111,6 @@ libthunar_vfs_1_la_CFLAGS = \ $(EXO_CFLAGS) \ $(GCONF_CFLAGS) \ $(GTHREAD_CFLAGS) \ - $(HAL_CFLAGS) \ - $(HAL_DBUS_CFLAGS) \ $(LIBFAM_CFLAGS) \ $(LIBJPEG_CFLAGS) \ $(LIBPNG_CFLAGS) \ @@ -130,8 +127,6 @@ libthunar_vfs_1_la_LIBADD = \ $(EXO_LIBS) \ $(GCONF_LIBS) \ $(GTHREAD_LIBS) \ - $(HAL_LIBS) \ - $(HAL_DBUS_LIBS) \ $(LIBFAM_LIBS) \ $(LIBJPEG_LIBS) \ $(LIBPNG_LIBS) \ @@ -164,12 +159,39 @@ EXTRA_DIST = \ thunar-vfs-alias.h \ thunar-vfs-aliasdef.c \ thunar-vfs-marshal.list \ - thunar-vfs-volume-bsd.c \ - thunar-vfs-volume-bsd.h \ + thunar-vfs-volume-freebsd.c \ + thunar-vfs-volume-freebsd.h \ thunar-vfs-volume-hal.c \ thunar-vfs-volume-hal.h \ - thunar-vfs-volume-sysv.c \ - thunar-vfs-volume-sysv.h + thunar-vfs-volume-none.c \ + thunar-vfs-volume-none.h + +if THUNAR_VFS_VOLUME_IMPL_FREEBSD +libthunar_vfs_volume_impl_sources = \ + thunar-vfs-volume-freebsd.c \ + thunar-vfs-volume-freebsd.h +endif + +if THUNAR_VFS_VOLUME_IMPL_HAL +libthunar_vfs_volume_impl_sources = \ + thunar-vfs-volume-hal.c \ + thunar-vfs-volume-hal.h + +libthunar_vfs_1_la_CFLAGS += \ + $(HAL_CFLAGS) \ + $(HAL_DBUS_CFLAGS) + +libthunar_vfs_1_la_LIBADD += \ + $(HAL_LIBS) \ + $(HAL_DBUS_LIBS) +endif + +if THUNAR_VFS_VOLUME_IMPL_NONE +libthunar_vfs_volume_impl_sources = \ + thunar-vfs-volume-none.c \ + thunar-vfs-volume-none.h +endif + ## ## Rules to auto-generate built sources diff --git a/thunar-vfs/thunar-vfs-volume-bsd.h b/thunar-vfs/thunar-vfs-volume-bsd.h deleted file mode 100644 index fe3b757e8..000000000 --- a/thunar-vfs/thunar-vfs-volume-bsd.h +++ /dev/null @@ -1,55 +0,0 @@ -/* $Id$ */ -/*- - * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __THUNAR_VFS_VOLUME_BSD_H__ -#define __THUNAR_VFS_VOLUME_BSD_H__ - -#include <thunar-vfs/thunar-vfs-volume.h> - -G_BEGIN_DECLS; - -typedef struct _ThunarVfsVolumeBSDClass ThunarVfsVolumeBSDClass; -typedef struct _ThunarVfsVolumeBSD ThunarVfsVolumeBSD; - -#define THUNAR_VFS_TYPE_VOLUME_BSD (thunar_vfs_volume_bsd_get_type ()) -#define THUNAR_VFS_VOLUME_BSD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_VFS_TYPE_VOLUME_BSD, ThunarVfsVolumeBSD)) -#define THUNAR_VFS_VOLUME_BSD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_VFS_TYPE_VOLUME_BSD, ThunarVfsVolumeBSDClass)) -#define THUNAR_VFS_IS_VOLUME_BSD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_VFS_TYPE_VOLUME_BSD)) -#define THUNAR_VFS_IS_VOLUME_BSD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_VFS_TYPE_VOLUME_BSD)) -#define THUNAR_VFS_VOLUME_BSD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_VFS_TYPE_VOLUME_BSD, ThunarVfsVolumeBSDClass)) - -GType thunar_vfs_volume_bsd_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL; - - -typedef struct _ThunarVfsVolumeManagerBSDClass ThunarVfsVolumeManagerBSDClass; -typedef struct _ThunarVfsVolumeManagerBSD ThunarVfsVolumeManagerBSD; - -#define THUNAR_VFS_TYPE_VOLUME_MANAGER_BSD (thunar_vfs_volume_manager_bsd_get_type ()) -#define THUNAR_VFS_VOLUME_MANAGER_BSD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_BSD, ThunarVfsVolumeManagerBSD)) -#define THUNAR_VFS_VOLUME_MANAGER_BSD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_VFS_TYPE_VOLUME_MANAGER_BSD, ThunarVfsVolumeManagerBSDClass)) -#define THUNAR_VFS_IS_VOLUME_MANAGER_BSD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_BSD)) -#define THUNAR_VFS_IS_VOLUME_MANAGER_BSD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_VFS_TYPE_VOLUME_MANAGER_BSD)) -#define THUNAR_VFS_VOLUME_MANAGER_BSD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_BSD, ThunarVfsVolumeManagerBSDClass)) - -GType thunar_vfs_volume_manager_bsd_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL; - -G_END_DECLS; - -#endif /* !__THUNAR_VFS_VOLUME_BSD_H__ */ diff --git a/thunar-vfs/thunar-vfs-volume-bsd.c b/thunar-vfs/thunar-vfs-volume-freebsd.c similarity index 50% rename from thunar-vfs/thunar-vfs-volume-bsd.c rename to thunar-vfs/thunar-vfs-volume-freebsd.c index 7f8dc034f..1b01c97d4 100644 --- a/thunar-vfs/thunar-vfs-volume-bsd.c +++ b/thunar-vfs/thunar-vfs-volume-freebsd.c @@ -47,40 +47,40 @@ #include <exo/exo.h> -#include <thunar-vfs/thunar-vfs-volume-bsd.h> +#include <thunar-vfs/thunar-vfs-volume-freebsd.h> #include <thunar-vfs/thunar-vfs-alias.h> -static void thunar_vfs_volume_bsd_class_init (ThunarVfsVolumeBSDClass *klass); -static void thunar_vfs_volume_bsd_volume_init (ThunarVfsVolumeIface *iface); -static void thunar_vfs_volume_bsd_init (ThunarVfsVolumeBSD *volume_bsd); -static void thunar_vfs_volume_bsd_finalize (GObject *object); -static ThunarVfsVolumeKind thunar_vfs_volume_bsd_get_kind (ThunarVfsVolume *volume); -static const gchar *thunar_vfs_volume_bsd_get_name (ThunarVfsVolume *volume); -static ThunarVfsVolumeStatus thunar_vfs_volume_bsd_get_status (ThunarVfsVolume *volume); -static ThunarVfsPath *thunar_vfs_volume_bsd_get_mount_point (ThunarVfsVolume *volume); -static gboolean thunar_vfs_volume_bsd_eject (ThunarVfsVolume *volume, - GtkWidget *window, - GError **error); -static gboolean thunar_vfs_volume_bsd_mount (ThunarVfsVolume *volume, - GtkWidget *window, - GError **error); -static gboolean thunar_vfs_volume_bsd_unmount (ThunarVfsVolume *volume, - GtkWidget *window, - GError **error); -static gboolean thunar_vfs_volume_bsd_update (gpointer user_data); -static ThunarVfsVolumeBSD *thunar_vfs_volume_bsd_new (const gchar *device_path, - const gchar *mount_path); +static void thunar_vfs_volume_freebsd_class_init (ThunarVfsVolumeFreeBSDClass *klass); +static void thunar_vfs_volume_freebsd_volume_init (ThunarVfsVolumeIface *iface); +static void thunar_vfs_volume_freebsd_init (ThunarVfsVolumeFreeBSD *volume_freebsd); +static void thunar_vfs_volume_freebsd_finalize (GObject *object); +static ThunarVfsVolumeKind thunar_vfs_volume_freebsd_get_kind (ThunarVfsVolume *volume); +static const gchar *thunar_vfs_volume_freebsd_get_name (ThunarVfsVolume *volume); +static ThunarVfsVolumeStatus thunar_vfs_volume_freebsd_get_status (ThunarVfsVolume *volume); +static ThunarVfsPath *thunar_vfs_volume_freebsd_get_mount_point (ThunarVfsVolume *volume); +static gboolean thunar_vfs_volume_freebsd_eject (ThunarVfsVolume *volume, + GtkWidget *window, + GError **error); +static gboolean thunar_vfs_volume_freebsd_mount (ThunarVfsVolume *volume, + GtkWidget *window, + GError **error); +static gboolean thunar_vfs_volume_freebsd_unmount (ThunarVfsVolume *volume, + GtkWidget *window, + GError **error); +static gboolean thunar_vfs_volume_freebsd_update (gpointer user_data); +static ThunarVfsVolumeFreeBSD *thunar_vfs_volume_freebsd_new (const gchar *device_path, + const gchar *mount_path); -struct _ThunarVfsVolumeBSDClass +struct _ThunarVfsVolumeFreeBSDClass { GObjectClass __parent__; }; -struct _ThunarVfsVolumeBSD +struct _ThunarVfsVolumeFreeBSD { GObject __parent__; @@ -101,115 +101,115 @@ struct _ThunarVfsVolumeBSD -G_DEFINE_TYPE_WITH_CODE (ThunarVfsVolumeBSD, - thunar_vfs_volume_bsd, +G_DEFINE_TYPE_WITH_CODE (ThunarVfsVolumeFreeBSD, + thunar_vfs_volume_freebsd, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (THUNAR_VFS_TYPE_VOLUME, - thunar_vfs_volume_bsd_volume_init)); + thunar_vfs_volume_freebsd_volume_init)); static void -thunar_vfs_volume_bsd_class_init (ThunarVfsVolumeBSDClass *klass) +thunar_vfs_volume_freebsd_class_init (ThunarVfsVolumeFreeBSDClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = thunar_vfs_volume_bsd_finalize; + gobject_class->finalize = thunar_vfs_volume_freebsd_finalize; } static void -thunar_vfs_volume_bsd_volume_init (ThunarVfsVolumeIface *iface) +thunar_vfs_volume_freebsd_volume_init (ThunarVfsVolumeIface *iface) { - iface->get_kind = thunar_vfs_volume_bsd_get_kind; - iface->get_name = thunar_vfs_volume_bsd_get_name; - iface->get_status = thunar_vfs_volume_bsd_get_status; - iface->get_mount_point = thunar_vfs_volume_bsd_get_mount_point; - iface->eject = thunar_vfs_volume_bsd_eject; - iface->mount = thunar_vfs_volume_bsd_mount; - iface->unmount = thunar_vfs_volume_bsd_unmount; + iface->get_kind = thunar_vfs_volume_freebsd_get_kind; + iface->get_name = thunar_vfs_volume_freebsd_get_name; + iface->get_status = thunar_vfs_volume_freebsd_get_status; + iface->get_mount_point = thunar_vfs_volume_freebsd_get_mount_point; + iface->eject = thunar_vfs_volume_freebsd_eject; + iface->mount = thunar_vfs_volume_freebsd_mount; + iface->unmount = thunar_vfs_volume_freebsd_unmount; } static void -thunar_vfs_volume_bsd_init (ThunarVfsVolumeBSD *volume_bsd) +thunar_vfs_volume_freebsd_init (ThunarVfsVolumeFreeBSD *volume_freebsd) { } static void -thunar_vfs_volume_bsd_finalize (GObject *object) +thunar_vfs_volume_freebsd_finalize (GObject *object) { - ThunarVfsVolumeBSD *volume_bsd = THUNAR_VFS_VOLUME_BSD (object); + ThunarVfsVolumeFreeBSD *volume_freebsd = THUNAR_VFS_VOLUME_FREEBSD (object); - g_return_if_fail (THUNAR_VFS_IS_VOLUME_BSD (volume_bsd)); + g_return_if_fail (THUNAR_VFS_IS_VOLUME_FREEBSD (volume_freebsd)); - if (G_LIKELY (volume_bsd->update_timer_id >= 0)) - g_source_remove (volume_bsd->update_timer_id); + if (G_LIKELY (volume_freebsd->update_timer_id >= 0)) + g_source_remove (volume_freebsd->update_timer_id); - if (G_LIKELY (volume_bsd->mount_point != NULL)) - thunar_vfs_path_unref (volume_bsd->mount_point); + if (G_LIKELY (volume_freebsd->mount_point != NULL)) + thunar_vfs_path_unref (volume_freebsd->mount_point); - g_free (volume_bsd->device_path); - g_free (volume_bsd->label); + g_free (volume_freebsd->device_path); + g_free (volume_freebsd->label); - G_OBJECT_CLASS (thunar_vfs_volume_bsd_parent_class)->finalize (object); + G_OBJECT_CLASS (thunar_vfs_volume_freebsd_parent_class)->finalize (object); } static ThunarVfsVolumeKind -thunar_vfs_volume_bsd_get_kind (ThunarVfsVolume *volume) +thunar_vfs_volume_freebsd_get_kind (ThunarVfsVolume *volume) { - return THUNAR_VFS_VOLUME_BSD (volume)->kind; + return THUNAR_VFS_VOLUME_FREEBSD (volume)->kind; } static const gchar* -thunar_vfs_volume_bsd_get_name (ThunarVfsVolume *volume) +thunar_vfs_volume_freebsd_get_name (ThunarVfsVolume *volume) { - ThunarVfsVolumeBSD *volume_bsd = THUNAR_VFS_VOLUME_BSD (volume); + ThunarVfsVolumeFreeBSD *volume_freebsd = THUNAR_VFS_VOLUME_FREEBSD (volume); - return (volume_bsd->label != NULL) ? volume_bsd->label : volume_bsd->device_name; + return (volume_freebsd->label != NULL) ? volume_freebsd->label : volume_freebsd->device_name; } static ThunarVfsVolumeStatus -thunar_vfs_volume_bsd_get_status (ThunarVfsVolume *volume) +thunar_vfs_volume_freebsd_get_status (ThunarVfsVolume *volume) { - return THUNAR_VFS_VOLUME_BSD (volume)->status; + return THUNAR_VFS_VOLUME_FREEBSD (volume)->status; } static ThunarVfsPath* -thunar_vfs_volume_bsd_get_mount_point (ThunarVfsVolume *volume) +thunar_vfs_volume_freebsd_get_mount_point (ThunarVfsVolume *volume) { - return THUNAR_VFS_VOLUME_BSD (volume)->mount_point; + return THUNAR_VFS_VOLUME_FREEBSD (volume)->mount_point; } static gboolean -thunar_vfs_volume_bsd_eject (ThunarVfsVolume *volume, - GtkWidget *window, - GError **error) +thunar_vfs_volume_freebsd_eject (ThunarVfsVolume *volume, + GtkWidget *window, + GError **error) { - ThunarVfsVolumeBSD *volume_bsd = THUNAR_VFS_VOLUME_BSD (volume); - gboolean result; - gchar *standard_error; - gchar *command_line; - gchar *quoted; - gint exit_status; + ThunarVfsVolumeFreeBSD *volume_freebsd = THUNAR_VFS_VOLUME_FREEBSD (volume); + gboolean result; + gchar *standard_error; + gchar *command_line; + gchar *quoted; + gint exit_status; /* generate the command line for the eject command */ - quoted = g_shell_quote (volume_bsd->device_path); + quoted = g_shell_quote (volume_freebsd->device_path); command_line = g_strconcat ("eject ", quoted, NULL); g_free (quoted); @@ -248,7 +248,7 @@ thunar_vfs_volume_bsd_eject (ThunarVfsVolume *volume, /* update volume state if successfull */ if (G_LIKELY (result)) - thunar_vfs_volume_bsd_update (volume_bsd); + thunar_vfs_volume_freebsd_update (volume_freebsd); return result; } @@ -256,24 +256,24 @@ thunar_vfs_volume_bsd_eject (ThunarVfsVolume *volume, static gboolean -thunar_vfs_volume_bsd_mount (ThunarVfsVolume *volume, - GtkWidget *window, - GError **error) +thunar_vfs_volume_freebsd_mount (ThunarVfsVolume *volume, + GtkWidget *window, + GError **error) { - ThunarVfsVolumeBSD *volume_bsd = THUNAR_VFS_VOLUME_BSD (volume); - gboolean result; - GString *message; - gchar mount_point[THUNAR_VFS_PATH_MAXSTRLEN]; - gchar **standard_error_parts; - gchar *standard_error; - gchar *command_line; - gchar *quoted; - gint exit_status; - gint n_parts; - gint i; + ThunarVfsVolumeFreeBSD *volume_freebsd = THUNAR_VFS_VOLUME_FREEBSD (volume); + gboolean result; + GString *message; + gchar mount_point[THUNAR_VFS_PATH_MAXSTRLEN]; + gchar **standard_error_parts; + gchar *standard_error; + gchar *command_line; + gchar *quoted; + gint exit_status; + gint n_parts; + gint i; /* determine the absolute path to the mount point */ - if (thunar_vfs_path_to_string (volume_bsd->mount_point, mount_point, sizeof (mount_point), error) < 0) + if (thunar_vfs_path_to_string (volume_freebsd->mount_point, mount_point, sizeof (mount_point), error) < 0) return FALSE; /* generate the command line for the mount command */ @@ -345,7 +345,7 @@ thunar_vfs_volume_bsd_mount (ThunarVfsVolume *volume, /* update volume state if successfull */ if (G_LIKELY (result)) - thunar_vfs_volume_bsd_update (volume_bsd); + thunar_vfs_volume_freebsd_update (volume_freebsd); return result; } @@ -353,20 +353,20 @@ thunar_vfs_volume_bsd_mount (ThunarVfsVolume *volume, static gboolean -thunar_vfs_volume_bsd_unmount (ThunarVfsVolume *volume, - GtkWidget *window, - GError **error) +thunar_vfs_volume_freebsd_unmount (ThunarVfsVolume *volume, + GtkWidget *window, + GError **error) { - ThunarVfsVolumeBSD *volume_bsd = THUNAR_VFS_VOLUME_BSD (volume); - gboolean result; - gchar mount_point[THUNAR_VFS_PATH_MAXSTRLEN]; - gchar *standard_error; - gchar *command_line; - gchar *quoted; - gint exit_status; + ThunarVfsVolumeFreeBSD *volume_freebsd = THUNAR_VFS_VOLUME_FREEBSD (volume); + gboolean result; + gchar mount_point[THUNAR_VFS_PATH_MAXSTRLEN]; + gchar *standard_error; + gchar *command_line; + gchar *quoted; + gint exit_status; /* determine the absolute path to the mount point */ - if (thunar_vfs_path_to_string (volume_bsd->mount_point, mount_point, sizeof (mount_point), error) < 0) + if (thunar_vfs_path_to_string (volume_freebsd->mount_point, mount_point, sizeof (mount_point), error) < 0) return FALSE; /* generate the command line for the umount command */ @@ -410,7 +410,7 @@ thunar_vfs_volume_bsd_unmount (ThunarVfsVolume *volume, /* update volume state if successfull */ if (G_LIKELY (result)) - thunar_vfs_volume_bsd_update (volume_bsd); + thunar_vfs_volume_freebsd_update (volume_freebsd); return result; } @@ -418,23 +418,23 @@ thunar_vfs_volume_bsd_unmount (ThunarVfsVolume *volume, static gboolean -thunar_vfs_volume_bsd_update (gpointer user_data) +thunar_vfs_volume_freebsd_update (gpointer user_data) { - ThunarVfsVolumeStatus status = 0; - struct ioc_toc_header ith; - ThunarVfsVolumeBSD *volume_bsd = THUNAR_VFS_VOLUME_BSD (user_data); - struct stat sb; - gchar *label; - gchar buffer[2048]; - int fd; - - if (volume_bsd->kind == THUNAR_VFS_VOLUME_KIND_CDROM) + ThunarVfsVolumeFreeBSD *volume_freebsd = THUNAR_VFS_VOLUME_FREEBSD (user_data); + ThunarVfsVolumeStatus status = 0; + struct ioc_toc_header ith; + struct stat sb; + gchar *label; + gchar buffer[2048]; + int fd; + + if (volume_freebsd->kind == THUNAR_VFS_VOLUME_KIND_CDROM) { /* try to read the table of contents from the CD-ROM, * which will only succeed if a disc is present for * the drive. */ - fd = open (volume_bsd->device_path, O_RDONLY); + fd = open (volume_freebsd->device_path, O_RDONLY); if (fd >= 0) { if (ioctl (fd, CDIOREADTOCHEADER, &ith) >= 0) @@ -442,7 +442,7 @@ thunar_vfs_volume_bsd_update (gpointer user_data) status |= THUNAR_VFS_VOLUME_STATUS_PRESENT; /* read the label of the disc */ - if (volume_bsd->label == NULL && (volume_bsd->status & THUNAR_VFS_VOLUME_STATUS_PRESENT) == 0) + if (volume_freebsd->label == NULL && (volume_freebsd->status & THUNAR_VFS_VOLUME_STATUS_PRESENT) == 0) { /* skip to sector 16 and read it */ if (lseek (fd, 16 * 2048, SEEK_SET) >= 0 && read (fd, buffer, sizeof (buffer)) >= 0) @@ -452,7 +452,7 @@ thunar_vfs_volume_bsd_update (gpointer user_data) label[32] = '\0'; g_strchomp (label); if (G_LIKELY (*label != '\0')) - volume_bsd->label = g_strdup (label); + volume_freebsd->label = g_strdup (label); } } } @@ -462,38 +462,38 @@ thunar_vfs_volume_bsd_update (gpointer user_data) } /* determine the absolute path to the mount point */ - if (thunar_vfs_path_to_string (volume_bsd->mount_point, buffer, sizeof (buffer), NULL) > 0) + if (thunar_vfs_path_to_string (volume_freebsd->mount_point, buffer, sizeof (buffer), NULL) > 0) { /* query the file system information for the mount point */ - if (statfs (buffer, &volume_bsd->info) >= 0) + if (statfs (buffer, &volume_freebsd->info) >= 0) { /* if the device is mounted, it means that a medium is present */ - if (exo_str_is_equal (volume_bsd->info.f_mntfromname, volume_bsd->device_path)) + if (exo_str_is_equal (volume_freebsd->info.f_mntfromname, volume_freebsd->device_path)) status |= THUNAR_VFS_VOLUME_STATUS_MOUNTED | THUNAR_VFS_VOLUME_STATUS_PRESENT; } /* free the volume label if no disc is present */ if ((status & THUNAR_VFS_VOLUME_STATUS_PRESENT) == 0) { - g_free (volume_bsd->label); - volume_bsd->label = NULL; + g_free (volume_freebsd->label); + volume_freebsd->label = NULL; } /* determine the device id if mounted */ if ((status & THUNAR_VFS_VOLUME_STATUS_MOUNTED) != 0) { if (stat (buffer, &sb) < 0) - volume_bsd->device_id = (ThunarVfsFileDevice) -1; + volume_freebsd->device_id = (ThunarVfsFileDevice) -1; else - volume_bsd->device_id = sb.st_dev; + volume_freebsd->device_id = sb.st_dev; } } /* update the status if necessary */ - if (status != volume_bsd->status) + if (status != volume_freebsd->status) { - volume_bsd->status = status; - thunar_vfs_volume_changed (THUNAR_VFS_VOLUME (volume_bsd)); + volume_freebsd->status = status; + thunar_vfs_volume_changed (THUNAR_VFS_VOLUME (volume_freebsd)); } return TRUE; @@ -501,66 +501,66 @@ thunar_vfs_volume_bsd_update (gpointer user_data) -static ThunarVfsVolumeBSD* -thunar_vfs_volume_bsd_new (const gchar *device_path, - const gchar *mount_path) +static ThunarVfsVolumeFreeBSD* +thunar_vfs_volume_freebsd_new (const gchar *device_path, + const gchar *mount_path) { - ThunarVfsVolumeBSD *volume_bsd; - const gchar *p; + ThunarVfsVolumeFreeBSD *volume_freebsd; + const gchar *p; g_return_val_if_fail (device_path != NULL, NULL); g_return_val_if_fail (mount_path != NULL, NULL); /* allocate the volume object */ - volume_bsd = g_object_new (THUNAR_VFS_TYPE_VOLUME_BSD, NULL); - volume_bsd->device_path = g_strdup (device_path); - volume_bsd->mount_point = thunar_vfs_path_new (mount_path, NULL); + volume_freebsd = g_object_new (THUNAR_VFS_TYPE_VOLUME_FREEBSD, NULL); + volume_freebsd->device_path = g_strdup (device_path); + volume_freebsd->mount_point = thunar_vfs_path_new (mount_path, NULL); /* determine the device name */ - for (p = volume_bsd->device_name = volume_bsd->device_path; *p != '\0'; ++p) + for (p = volume_freebsd->device_name = volume_freebsd->device_path; *p != '\0'; ++p) if (p[0] == '/' && (p[1] != '/' && p[1] != '\0')) - volume_bsd->device_name = p + 1; + volume_freebsd->device_name = p + 1; /* determine the kind of the volume */ - p = volume_bsd->device_name; + p = volume_freebsd->device_name; if (p[0] == 'c' && p[1] == 'd' && g_ascii_isdigit (p[2])) - volume_bsd->kind = THUNAR_VFS_VOLUME_KIND_CDROM; + volume_freebsd->kind = THUNAR_VFS_VOLUME_KIND_CDROM; else if (p[0] == 'f' && p[1] == 'd' && g_ascii_isdigit (p[2])) - volume_bsd->kind = THUNAR_VFS_VOLUME_KIND_FLOPPY; + volume_freebsd->kind = THUNAR_VFS_VOLUME_KIND_FLOPPY; else if ((p[0] == 'a' && p[1] == 'd' && g_ascii_isdigit (p[2])) || (p[0] == 'd' && p[1] == 'a' && g_ascii_isdigit (p[2]))) - volume_bsd->kind = THUNAR_VFS_VOLUME_KIND_HARDDISK; + volume_freebsd->kind = THUNAR_VFS_VOLUME_KIND_HARDDISK; else - volume_bsd->kind = THUNAR_VFS_VOLUME_KIND_UNKNOWN; + volume_freebsd->kind = THUNAR_VFS_VOLUME_KIND_UNKNOWN; /* determine up-to-date status */ - thunar_vfs_volume_bsd_update (volume_bsd); + thunar_vfs_volume_freebsd_update (volume_freebsd); /* start the update timer */ - volume_bsd->update_timer_id = g_timeout_add (1000, thunar_vfs_volume_bsd_update, volume_bsd); + volume_freebsd->update_timer_id = g_timeout_add (1000, thunar_vfs_volume_freebsd_update, volume_freebsd); - return volume_bsd; + return volume_freebsd; } -static void thunar_vfs_volume_manager_bsd_class_init (ThunarVfsVolumeManagerBSDClass *klass); -static void thunar_vfs_volume_manager_bsd_manager_init (ThunarVfsVolumeManagerIface *iface); -static void thunar_vfs_volume_manager_bsd_init (ThunarVfsVolumeManagerBSD *manager_bsd); -static void thunar_vfs_volume_manager_bsd_finalize (GObject *object); -static ThunarVfsVolume *thunar_vfs_volume_manager_bsd_get_volume_by_info (ThunarVfsVolumeManager *manager, - const ThunarVfsInfo *info); -static GList *thunar_vfs_volume_manager_bsd_get_volumes (ThunarVfsVolumeManager *manager); +static void thunar_vfs_volume_manager_freebsd_class_init (ThunarVfsVolumeManagerFreeBSDClass *klass); +static void thunar_vfs_volume_manager_freebsd_manager_init (ThunarVfsVolumeManagerIface *iface); +static void thunar_vfs_volume_manager_freebsd_init (ThunarVfsVolumeManagerFreeBSD *manager_freebsd); +static void thunar_vfs_volume_manager_freebsd_finalize (GObject *object); +static ThunarVfsVolume *thunar_vfs_volume_manager_freebsd_get_volume_by_info (ThunarVfsVolumeManager *manager, + const ThunarVfsInfo *info); +static GList *thunar_vfs_volume_manager_freebsd_get_volumes (ThunarVfsVolumeManager *manager); -struct _ThunarVfsVolumeManagerBSDClass +struct _ThunarVfsVolumeManagerFreeBSDClass { GObjectClass __parent__; }; -struct _ThunarVfsVolumeManagerBSD +struct _ThunarVfsVolumeManagerFreeBSD { GObject __parent__; GList *volumes; @@ -568,39 +568,39 @@ struct _ThunarVfsVolumeManagerBSD -G_DEFINE_TYPE_WITH_CODE (ThunarVfsVolumeManagerBSD, - thunar_vfs_volume_manager_bsd, +G_DEFINE_TYPE_WITH_CODE (ThunarVfsVolumeManagerFreeBSD, + thunar_vfs_volume_manager_freebsd, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (THUNAR_VFS_TYPE_VOLUME_MANAGER, - thunar_vfs_volume_manager_bsd_manager_init)); + thunar_vfs_volume_manager_freebsd_manager_init)); static void -thunar_vfs_volume_manager_bsd_class_init (ThunarVfsVolumeManagerBSDClass *klass) +thunar_vfs_volume_manager_freebsd_class_init (ThunarVfsVolumeManagerFreeBSDClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = thunar_vfs_volume_manager_bsd_finalize; + gobject_class->finalize = thunar_vfs_volume_manager_freebsd_finalize; } static void -thunar_vfs_volume_manager_bsd_manager_init (ThunarVfsVolumeManagerIface *iface) +thunar_vfs_volume_manager_freebsd_manager_init (ThunarVfsVolumeManagerIface *iface) { - iface->get_volume_by_info = thunar_vfs_volume_manager_bsd_get_volume_by_info; - iface->get_volumes = thunar_vfs_volume_manager_bsd_get_volumes; + iface->get_volume_by_info = thunar_vfs_volume_manager_freebsd_get_volume_by_info; + iface->get_volumes = thunar_vfs_volume_manager_freebsd_get_volumes; } static void -thunar_vfs_volume_manager_bsd_init (ThunarVfsVolumeManagerBSD *manager_bsd) +thunar_vfs_volume_manager_freebsd_init (ThunarVfsVolumeManagerFreeBSD *manager_freebsd) { - ThunarVfsVolumeBSD *volume_bsd; - struct fstab *fs; + ThunarVfsVolumeFreeBSD *volume_freebsd; + struct fstab *fs; /* load the fstab database */ setfsent (); @@ -619,9 +619,9 @@ thunar_vfs_volume_manager_bsd_init (ThunarVfsVolumeManagerBSD *manager_bsd) && !exo_str_is_equal (fs->fs_type, FSTAB_RO)) continue; - volume_bsd = thunar_vfs_volume_bsd_new (fs->fs_spec, fs->fs_file); - if (G_LIKELY (volume_bsd != NULL)) - manager_bsd->volumes = g_list_append (manager_bsd->volumes, volume_bsd); + volume_freebsd = thunar_vfs_volume_freebsd_new (fs->fs_spec, fs->fs_file); + if (G_LIKELY (volume_freebsd != NULL)) + manager_freebsd->volumes = g_list_append (manager_freebsd->volumes, volume_freebsd); } /* unload the fstab database */ @@ -631,35 +631,35 @@ thunar_vfs_volume_manager_bsd_init (ThunarVfsVolumeManagerBSD *manager_bsd) static void -thunar_vfs_volume_manager_bsd_finalize (GObject *object) +thunar_vfs_volume_manager_freebsd_finalize (GObject *object) { - ThunarVfsVolumeManagerBSD *manager_bsd = THUNAR_VFS_VOLUME_MANAGER_BSD (object); - GList *lp; + ThunarVfsVolumeManagerFreeBSD *manager_freebsd = THUNAR_VFS_VOLUME_MANAGER_FREEBSD (object); + GList *lp; - g_return_if_fail (THUNAR_VFS_IS_VOLUME_MANAGER (manager_bsd)); + g_return_if_fail (THUNAR_VFS_IS_VOLUME_MANAGER (manager_freebsd)); - for (lp = manager_bsd->volumes; lp != NULL; lp = lp->next) + for (lp = manager_freebsd->volumes; lp != NULL; lp = lp->next) g_object_unref (G_OBJECT (lp->data)); - g_list_free (manager_bsd->volumes); + g_list_free (manager_freebsd->volumes); - G_OBJECT_CLASS (thunar_vfs_volume_manager_bsd_parent_class)->finalize (object); + G_OBJECT_CLASS (thunar_vfs_volume_manager_freebsd_parent_class)->finalize (object); } static ThunarVfsVolume* -thunar_vfs_volume_manager_bsd_get_volume_by_info (ThunarVfsVolumeManager *manager, +thunar_vfs_volume_manager_freebsd_get_volume_by_info (ThunarVfsVolumeManager *manager, const ThunarVfsInfo *info) { - ThunarVfsVolumeManagerBSD *manager_bsd = THUNAR_VFS_VOLUME_MANAGER_BSD (manager); - ThunarVfsVolumeBSD *volume_bsd = NULL; - GList *lp; + ThunarVfsVolumeManagerFreeBSD *manager_freebsd = THUNAR_VFS_VOLUME_MANAGER_FREEBSD (manager); + ThunarVfsVolumeFreeBSD *volume_freebsd = NULL; + GList *lp; - for (lp = manager_bsd->volumes; lp != NULL; lp = lp->next) + for (lp = manager_freebsd->volumes; lp != NULL; lp = lp->next) { - volume_bsd = THUNAR_VFS_VOLUME_BSD (lp->data); - if ((volume_bsd->status & THUNAR_VFS_VOLUME_STATUS_MOUNTED) != 0 && volume_bsd->device_id == info->device) - return THUNAR_VFS_VOLUME (volume_bsd); + volume_freebsd = THUNAR_VFS_VOLUME_FREEBSD (lp->data); + if ((volume_freebsd->status & THUNAR_VFS_VOLUME_STATUS_MOUNTED) != 0 && volume_freebsd->device_id == info->device) + return THUNAR_VFS_VOLUME (volume_freebsd); } return NULL; @@ -668,18 +668,11 @@ thunar_vfs_volume_manager_bsd_get_volume_by_info (ThunarVfsVolumeManager *manage static GList* -thunar_vfs_volume_manager_bsd_get_volumes (ThunarVfsVolumeManager *manager) +thunar_vfs_volume_manager_freebsd_get_volumes (ThunarVfsVolumeManager *manager) { - return THUNAR_VFS_VOLUME_MANAGER_BSD (manager)->volumes; + return THUNAR_VFS_VOLUME_MANAGER_FREEBSD (manager)->volumes; } -GType -_thunar_vfs_volume_manager_impl_get_type (void) -{ - return THUNAR_VFS_TYPE_VOLUME_MANAGER_BSD; -} - - diff --git a/thunar-vfs/thunar-vfs-volume-freebsd.h b/thunar-vfs/thunar-vfs-volume-freebsd.h new file mode 100644 index 000000000..fa80e1dc1 --- /dev/null +++ b/thunar-vfs/thunar-vfs-volume-freebsd.h @@ -0,0 +1,55 @@ +/* $Id$ */ +/*- + * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __THUNAR_VFS_VOLUME_FREEBSD_H__ +#define __THUNAR_VFS_VOLUME_FREEBSD_H__ + +#include <thunar-vfs/thunar-vfs-volume.h> + +G_BEGIN_DECLS; + +typedef struct _ThunarVfsVolumeFreeBSDClass ThunarVfsVolumeFreeBSDClass; +typedef struct _ThunarVfsVolumeFreeBSD ThunarVfsVolumeFreeBSD; + +#define THUNAR_VFS_TYPE_VOLUME_FREEBSD (thunar_vfs_volume_freebsd_get_type ()) +#define THUNAR_VFS_VOLUME_FREEBSD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_VFS_TYPE_VOLUME_FREEBSD, ThunarVfsVolumeFreeBSD)) +#define THUNAR_VFS_VOLUME_FREEBSD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_VFS_TYPE_VOLUME_FREEBSD, ThunarVfsVolumeFreeBSDClass)) +#define THUNAR_VFS_IS_VOLUME_FREEBSD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_VFS_TYPE_VOLUME_FREEBSD)) +#define THUNAR_VFS_IS_VOLUME_FREEBSD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_VFS_TYPE_VOLUME_FREEBSD)) +#define THUNAR_VFS_VOLUME_FREEBSD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_VFS_TYPE_VOLUME_FREEBSD, ThunarVfsVolumeFreeBSDClass)) + +GType thunar_vfs_volume_freebsd_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL; + + +typedef struct _ThunarVfsVolumeManagerFreeBSDClass ThunarVfsVolumeManagerFreeBSDClass; +typedef struct _ThunarVfsVolumeManagerFreeBSD ThunarVfsVolumeManagerFreeBSD; + +#define THUNAR_VFS_TYPE_VOLUME_MANAGER_FREEBSD (thunar_vfs_volume_manager_freebsd_get_type ()) +#define THUNAR_VFS_VOLUME_MANAGER_FREEBSD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_FREEBSD, ThunarVfsVolumeManagerFreeBSD)) +#define THUNAR_VFS_VOLUME_MANAGER_FREEBSD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_VFS_TYPE_VOLUME_MANAGER_FREEBSD, ThunarVfsVolumeManagerFreeBSDClass)) +#define THUNAR_VFS_IS_VOLUME_MANAGER_FREEBSD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_FREEBSD)) +#define THUNAR_VFS_IS_VOLUME_MANAGER_FREEBSD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_VFS_TYPE_VOLUME_MANAGER_FREEBSD)) +#define THUNAR_VFS_VOLUME_MANAGER_FREEBSD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_FREEBSD, ThunarVfsVolumeManagerFreeBSDClass)) + +GType thunar_vfs_volume_manager_freebsd_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL; + +G_END_DECLS; + +#endif /* !__THUNAR_VFS_VOLUME_FREEBSD_H__ */ diff --git a/thunar-vfs/thunar-vfs-volume-hal.c b/thunar-vfs/thunar-vfs-volume-hal.c index a94f4e4f6..a18597a72 100644 --- a/thunar-vfs/thunar-vfs-volume-hal.c +++ b/thunar-vfs/thunar-vfs-volume-hal.c @@ -1058,13 +1058,4 @@ thunar_vfs_volume_manager_hal_device_property_modified (LibHalContext *context, -GType -_thunar_vfs_volume_manager_impl_get_type (void) -{ - return THUNAR_VFS_TYPE_VOLUME_MANAGER_HAL; -} - - - - diff --git a/thunar-vfs/thunar-vfs-volume-sysv.c b/thunar-vfs/thunar-vfs-volume-none.c similarity index 55% rename from thunar-vfs/thunar-vfs-volume-sysv.c rename to thunar-vfs/thunar-vfs-volume-none.c index 6151c0aff..be9d0cc78 100644 --- a/thunar-vfs/thunar-vfs-volume-sysv.c +++ b/thunar-vfs/thunar-vfs-volume-none.c @@ -1,6 +1,6 @@ /* $Id$ */ /*- - * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org> + * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -22,64 +22,64 @@ #include <config.h> #endif -#include <thunar-vfs/thunar-vfs-volume-sysv.h> +#include <thunar-vfs/thunar-vfs-volume-none.h> #include <thunar-vfs/thunar-vfs-alias.h> -static void thunar_vfs_volume_manager_sysv_class_init (ThunarVfsVolumeManagerSysVClass *klass); -static void thunar_vfs_volume_manager_sysv_manager_init (ThunarVfsVolumeManagerIface *iface); -static void thunar_vfs_volume_manager_sysv_init (ThunarVfsVolumeManagerSysV *manager_sysv); -static ThunarVfsVolume *thunar_vfs_volume_manager_sysv_get_volume_by_info (ThunarVfsVolumeManager *manager, +static void thunar_vfs_volume_manager_none_class_init (ThunarVfsVolumeManagerNoneClass *klass); +static void thunar_vfs_volume_manager_none_manager_init (ThunarVfsVolumeManagerIface *iface); +static void thunar_vfs_volume_manager_none_init (ThunarVfsVolumeManagerNone *manager_none); +static ThunarVfsVolume *thunar_vfs_volume_manager_none_get_volume_by_info (ThunarVfsVolumeManager *manager, const ThunarVfsInfo *info); -static GList *thunar_vfs_volume_manager_sysv_get_volumes (ThunarVfsVolumeManager *manager); +static GList *thunar_vfs_volume_manager_none_get_volumes (ThunarVfsVolumeManager *manager); -struct _ThunarVfsVolumeManagerSysVClass +struct _ThunarVfsVolumeManagerNoneClass { GObjectClass __parent__; }; -struct _ThunarVfsVolumeManagerSysV +struct _ThunarVfsVolumeManagerNone { GObject __parent__; }; -G_DEFINE_TYPE_WITH_CODE (ThunarVfsVolumeManagerSysV, - thunar_vfs_volume_manager_sysv, +G_DEFINE_TYPE_WITH_CODE (ThunarVfsVolumeManagerNone, + thunar_vfs_volume_manager_none, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (THUNAR_VFS_TYPE_VOLUME_MANAGER, - thunar_vfs_volume_manager_sysv_manager_init)); + thunar_vfs_volume_manager_none_manager_init)); static void -thunar_vfs_volume_manager_sysv_class_init (ThunarVfsVolumeManagerSysVClass *klass) +thunar_vfs_volume_manager_none_class_init (ThunarVfsVolumeManagerNoneClass *klass) { } static void -thunar_vfs_volume_manager_sysv_manager_init (ThunarVfsVolumeManagerIface *iface) +thunar_vfs_volume_manager_none_manager_init (ThunarVfsVolumeManagerIface *iface) { - iface->get_volume_by_info = thunar_vfs_volume_manager_sysv_get_volume_by_info; - iface->get_volumes = thunar_vfs_volume_manager_sysv_get_volumes; + iface->get_volume_by_info = thunar_vfs_volume_manager_none_get_volume_by_info; + iface->get_volumes = thunar_vfs_volume_manager_none_get_volumes; } static void -thunar_vfs_volume_manager_sysv_init (ThunarVfsVolumeManagerSysV *manager_sysv) +thunar_vfs_volume_manager_none_init (ThunarVfsVolumeManagerNone *manager_none) { } static ThunarVfsVolume* -thunar_vfs_volume_manager_sysv_get_volume_by_info (ThunarVfsVolumeManager *manager, +thunar_vfs_volume_manager_none_get_volume_by_info (ThunarVfsVolumeManager *manager, const ThunarVfsInfo *info) { return NULL; @@ -88,18 +88,11 @@ thunar_vfs_volume_manager_sysv_get_volume_by_info (ThunarVfsVolumeManager *manag static GList* -thunar_vfs_volume_manager_sysv_get_volumes (ThunarVfsVolumeManager *manager) +thunar_vfs_volume_manager_none_get_volumes (ThunarVfsVolumeManager *manager) { return NULL; } -GType -_thunar_vfs_volume_manager_impl_get_type (void) -{ - return THUNAR_VFS_TYPE_VOLUME_MANAGER_SYSV; -} - - diff --git a/thunar-vfs/thunar-vfs-volume-none.h b/thunar-vfs/thunar-vfs-volume-none.h new file mode 100644 index 000000000..4bf011da0 --- /dev/null +++ b/thunar-vfs/thunar-vfs-volume-none.h @@ -0,0 +1,55 @@ +/* $Id$ */ +/*- + * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __THUNAR_VFS_VOLUME_NONE_H__ +#define __THUNAR_VFS_VOLUME_NONE_H__ + +#include <thunar-vfs/thunar-vfs-volume.h> + +G_BEGIN_DECLS; + +typedef struct _ThunarVfsVolumeNoneClass ThunarVfsVolumeNoneClass; +typedef struct _ThunarVfsVolumeNone ThunarVfsVolumeNone; + +#define THUNAR_VFS_TYPE_VOLUME_NONE (thunar_vfs_volume_none_get_type ()) +#define THUNAR_VFS_VOLUME_NONE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_VFS_TYPE_VOLUME_NONE, ThunarVfsVolumeNONE)) +#define THUNAR_VFS_VOLUME_NONE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_VFS_TYPE_VOLUME_NONE, ThunarVfsVolumeNONEClass)) +#define THUNAR_VFS_IS_VOLUME_NONE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_VFS_TYPE_VOLUME_NONE)) +#define THUNAR_VFS_IS_VOLUME_NONE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_VFS_TYPE_VOLUME_NONE)) +#define THUNAR_VFS_VOLUME_NONE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_VFS_TYPE_VOLUME_NONE, ThunarVfsVolumeNONEClass)) + +GType thunar_vfs_volume_none_get_type (void) G_GNUC_CONST; + + +typedef struct _ThunarVfsVolumeManagerNoneClass ThunarVfsVolumeManagerNoneClass; +typedef struct _ThunarVfsVolumeManagerNone ThunarVfsVolumeManagerNone; + +#define THUNAR_VFS_TYPE_VOLUME_MANAGER_NONE (thunar_vfs_volume_manager_none_get_type ()) +#define THUNAR_VFS_VOLUME_MANAGER_NONE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_NONE, ThunarVfsVolumeManagerNONE)) +#define THUNAR_VFS_VOLUME_MANAGER_NONE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_VFS_TYPE_VOLUME_MANAGER_NONE, ThunarVfsVolumeManagerNONEClass)) +#define THUNAR_VFS_IS_VOLUME_MANAGER_NONE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_NONE)) +#define THUNAR_VFS_IS_VOLUME_MANAGER_NONE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_VFS_TYPE_VOLUME_MANAGER_NONE)) +#define THUNAR_VFS_VOLUME_MANAGER_NONE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_NONE, ThunarVfsVolumeManagerNONEClass)) + +GType thunar_vfs_volume_manager_none_get_type (void) G_GNUC_CONST; + +G_END_DECLS; + +#endif /* !__THUNAR_VFS_VOLUME_NONE_H__ */ diff --git a/thunar-vfs/thunar-vfs-volume-sysv.h b/thunar-vfs/thunar-vfs-volume-sysv.h deleted file mode 100644 index 1adf0ec19..000000000 --- a/thunar-vfs/thunar-vfs-volume-sysv.h +++ /dev/null @@ -1,55 +0,0 @@ -/* $Id$ */ -/*- - * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __THUNAR_VFS_VOLUME_SYSV_H__ -#define __THUNAR_VFS_VOLUME_SYSV_H__ - -#include <thunar-vfs/thunar-vfs-volume.h> - -G_BEGIN_DECLS; - -typedef struct _ThunarVfsVolumeSysVClass ThunarVfsVolumeSysVClass; -typedef struct _ThunarVfsVolumeSysV ThunarVfsVolumeSysV; - -#define THUNAR_VFS_TYPE_VOLUME_SYSV (thunar_vfs_volume_sysv_get_type ()) -#define THUNAR_VFS_VOLUME_SYSV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_VFS_TYPE_VOLUME_SYSV, ThunarVfsVolumeSYSV)) -#define THUNAR_VFS_VOLUME_SYSV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_VFS_TYPE_VOLUME_SYSV, ThunarVfsVolumeSYSVClass)) -#define THUNAR_VFS_IS_VOLUME_SYSV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_VFS_TYPE_VOLUME_SYSV)) -#define THUNAR_VFS_IS_VOLUME_SYSV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_VFS_TYPE_VOLUME_SYSV)) -#define THUNAR_VFS_VOLUME_SYSV_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_VFS_TYPE_VOLUME_SYSV, ThunarVfsVolumeSYSVClass)) - -GType thunar_vfs_volume_sysv_get_type (void) G_GNUC_CONST; - - -typedef struct _ThunarVfsVolumeManagerSysVClass ThunarVfsVolumeManagerSysVClass; -typedef struct _ThunarVfsVolumeManagerSysV ThunarVfsVolumeManagerSysV; - -#define THUNAR_VFS_TYPE_VOLUME_MANAGER_SYSV (thunar_vfs_volume_manager_sysv_get_type ()) -#define THUNAR_VFS_VOLUME_MANAGER_SYSV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_SYSV, ThunarVfsVolumeManagerSYSV)) -#define THUNAR_VFS_VOLUME_MANAGER_SYSV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_VFS_TYPE_VOLUME_MANAGER_SYSV, ThunarVfsVolumeManagerSYSVClass)) -#define THUNAR_VFS_IS_VOLUME_MANAGER_SYSV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_SYSV)) -#define THUNAR_VFS_IS_VOLUME_MANAGER_SYSV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_VFS_TYPE_VOLUME_MANAGER_SYSV)) -#define THUNAR_VFS_VOLUME_MANAGER_SYSV_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_VFS_TYPE_VOLUME_MANAGER_SYSV, ThunarVfsVolumeManagerSYSVClass)) - -GType thunar_vfs_volume_manager_sysv_get_type (void) G_GNUC_CONST; - -G_END_DECLS; - -#endif /* !__THUNAR_VFS_VOLUME_SYSV_H__ */ diff --git a/thunar-vfs/thunar-vfs-volume.c b/thunar-vfs/thunar-vfs-volume.c index 5e40efd5a..9a4bfb5ca 100644 --- a/thunar-vfs/thunar-vfs-volume.c +++ b/thunar-vfs/thunar-vfs-volume.c @@ -25,11 +25,28 @@ #include <exo/exo.h> #include <thunar-vfs/thunar-vfs-enum-types.h> +#include <thunar-vfs/thunar-vfs-volume-freebsd.h> +#include <thunar-vfs/thunar-vfs-volume-hal.h> +#include <thunar-vfs/thunar-vfs-volume-none.h> #include <thunar-vfs/thunar-vfs-volume.h> #include <thunar-vfs/thunar-vfs-alias.h> +/* determine the default thunar vfs volume manager type */ +#if defined(THUNAR_VFS_VOLUME_IMPL_FREEBSD) +#define THUNAR_VFS_TYPE_VOLUME_MANAGER_IMPL THUNAR_VFS_TYPE_VOLUME_MANAGER_FREEBSD +#elif defined(THUNAR_VFS_VOLUME_IMPL_HAL) +#define THUNAR_VFS_TYPE_VOLUME_MANAGER_IMPL THUNAR_VFS_TYPE_VOLUME_MANAGER_HAL +#elif defined(THUNAR_VFS_VOLUME_IMPL_NONE) +#define THUNAR_VFS_TYPE_VOLUME_MANAGER_IMPL THUNAR_VFS_TYPE_VOLUME_MANAGER_NONE +#else +#error "Add your volume manager implemenation here!" +#endif + + + +/* Signal identifiers */ enum { THUNAR_VFS_VOLUME_CHANGED, @@ -38,7 +55,7 @@ enum -static void thunar_vfs_volume_base_init (gpointer klass); +static void thunar_vfs_volume_base_init (gpointer klass); @@ -734,7 +751,7 @@ thunar_vfs_volume_manager_get_default (void) if (G_UNLIKELY (manager == NULL)) { - manager = g_object_new (_thunar_vfs_volume_manager_impl_get_type (), NULL); + manager = g_object_new (THUNAR_VFS_TYPE_VOLUME_MANAGER_IMPL, NULL); g_object_add_weak_pointer (G_OBJECT (manager), (gpointer) &manager); } else -- GitLab