summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenedikt Meurer <benny@xfce.org>2005-06-14 21:24:00 +0000
committerBenedikt Meurer <benny@xfce.org>2005-06-14 21:24:00 +0000
commit47f47567ebc2bf43671ffe88594681392d6b6fa7 (patch)
treee80c01fa8555e64393f1948009017c0ade038aa3
parent7f27b006077e097c5cdedc26a4347a4abcb106a2 (diff)
downloadthunar-47f47567ebc2bf43671ffe88594681392d6b6fa7.tar.gz
2005-06-14 Benedikt Meurer <benny@xfce.org>
* thunar-vfs/thunar-vfs-volume-sysv.{c,h}: Add no-op implementation to make it possible to compile Thunar on non-BSD systems again. * configure.in.in, thunar-vfs/Makefile.am, thunar-vfs/thunar-vfs-volume.c, thunar-vfs/thunar-vfs-volume-bsd.c: Add a rather hacky way to support different system flavours based on AC_CONFIG_LINKS(). Needs to be replaced by a real solution at some time. * TODO: Add note about the wacky AC_CONFIG_LINKS() hacks mentioned above. (Old svn revision: 16334)
-rw-r--r--ChangeLog12
-rw-r--r--TODO5
-rw-r--r--configure.in.in20
-rw-r--r--thunar-vfs/Makefile.am10
-rw-r--r--thunar-vfs/thunar-vfs-volume-bsd.c9
-rw-r--r--thunar-vfs/thunar-vfs-volume-sysv.c93
-rw-r--r--thunar-vfs/thunar-vfs-volume-sysv.h55
-rw-r--r--thunar-vfs/thunar-vfs-volume.c4
8 files changed, 202 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 7712570f..3541279d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2005-06-14 Benedikt Meurer <benny@xfce.org>
+ * thunar-vfs/thunar-vfs-volume-sysv.{c,h}: Add no-op implementation
+ to make it possible to compile Thunar on non-BSD systems again.
+ * configure.in.in, thunar-vfs/Makefile.am,
+ thunar-vfs/thunar-vfs-volume.c, thunar-vfs/thunar-vfs-volume-bsd.c:
+ Add a rather hacky way to support different system flavours based
+ on AC_CONFIG_LINKS(). Needs to be replaced by a real solution at
+ some time.
+ * TODO: Add note about the wacky AC_CONFIG_LINKS() hacks mentioned
+ above.
+
+2005-06-14 Benedikt Meurer <benny@xfce.org>
+
* thunar-vfs/thunar-vfs-uri.c(thunar_vfs_uri_new_for_path): Add some
code to automatically remove trailing slashes from path names, which
would otherwise confuse the whole file manager.
diff --git a/TODO b/TODO
index c1feb57b..4b1fa89f 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,9 @@
Important for Thunar 1.0
========================
+ - Use better way to handle system flavours than simply (mis)using
+ AC_CONFIG_LINKS(), which is pretty messy for this purpose.
+
- Check getmntinfo() or getfsstat() for ThunarVfsVolumeManagerBSD, which
might be faster than several statfs() calls.
@@ -64,5 +67,3 @@ Important for Thunar 1.0
the stat-thread. Backend technologies must be thread-safe. If
there's a lot of time or manpower in the end, additional
backends can be added, as long as they fit into the framework.
-
- - The ThunarFavourites framework needs drag and drop support.
diff --git a/configure.in.in b/configure.in.in
index 8969b487..58ca462e 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -22,6 +22,7 @@ AC_COPYRIGHT([Copyright (c) 2004-2005
Written for Thunar by Benedikt Meurer <benny@xfce.org>.])
AC_INIT([Thunar], [thunar_version()], [benny@xfce.org])
AC_PREREQ([2.50])
+AC_CANONICAL_TARGET()
AC_REVISION([$Id$])
dnl Initialize automake
@@ -48,6 +49,25 @@ dnl Check for required packages
XDT_CHECK_PACKAGE([EXO], [exo-0.3], [0.3.1])
XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.4.3])
+dnl Check for the system flavour
+AC_MSG_CHECKING([for system flavour])
+case "$target_os" in
+*bsd*)
+ FLAVOUR="bsd"
+ ;;
+*)
+ FLAVOUR="sysv"
+ ;;
+esac
+AC_MSG_RESULT([$FLAVOUR])
+
+dnl Create links for the volume manager implementation
+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 Check for debugging support
BM_DEBUG_SUPPORT()
diff --git a/thunar-vfs/Makefile.am b/thunar-vfs/Makefile.am
index bc5cfdd3..8a682224 100644
--- a/thunar-vfs/Makefile.am
+++ b/thunar-vfs/Makefile.am
@@ -19,7 +19,6 @@ libthunar_vfs_headers = \
thunar-vfs-util.h \
thunar-vfs-uri.h \
thunar-vfs-volume.h \
- thunar-vfs-volume-bsd.h \
thunar-vfs.h
libthunar_vfs_la_SOURCES = \
@@ -30,7 +29,8 @@ libthunar_vfs_la_SOURCES = \
thunar-vfs-util.c \
thunar-vfs-uri.c \
thunar-vfs-volume.c \
- thunar-vfs-volume-bsd.c
+ thunar-vfs-volume-impl.c \
+ thunar-vfs-volume-impl.h
libthunar_vfs_la_CFLAGS = \
$(EXO_CFLAGS) \
@@ -41,6 +41,12 @@ libthunar_vfs_la_LDFLAGS = \
$(EXO_LIBS) \
$(GTHREADS_LIBS)
+EXTRA_DIST = \
+ thunar-vfs-volume-bsd.c \
+ thunar-vfs-volume-bsd.h \
+ thunar-vfs-volume-sysv.c \
+ thunar-vfs-volume-sysv.h
+
##
## Rules to auto-generate built sources
##
diff --git a/thunar-vfs/thunar-vfs-volume-bsd.c b/thunar-vfs/thunar-vfs-volume-bsd.c
index 4f9398eb..a4246dcc 100644
--- a/thunar-vfs/thunar-vfs-volume-bsd.c
+++ b/thunar-vfs/thunar-vfs-volume-bsd.c
@@ -432,3 +432,12 @@ thunar_vfs_volume_manager_bsd_get_volumes (ThunarVfsVolumeManager *manager)
}
+
+GType
+_thunar_vfs_volume_manager_impl_get_type (void)
+{
+ return THUNAR_VFS_TYPE_VOLUME_MANAGER_BSD;
+}
+
+
+
diff --git a/thunar-vfs/thunar-vfs-volume-sysv.c b/thunar-vfs/thunar-vfs-volume-sysv.c
new file mode 100644
index 00000000..7ee169b9
--- /dev/null
+++ b/thunar-vfs/thunar-vfs-volume-sysv.c
@@ -0,0 +1,93 @@
+/* $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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <thunar-vfs/thunar-vfs-volume-sysv.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 GList *thunar_vfs_volume_manager_sysv_get_volumes (ThunarVfsVolumeManager *manager);
+
+
+
+struct _ThunarVfsVolumeManagerSysVClass
+{
+ GObjectClass __parent__;
+};
+
+struct _ThunarVfsVolumeManagerSysV
+{
+ GObject __parent__;
+};
+
+
+
+G_DEFINE_TYPE_WITH_CODE (ThunarVfsVolumeManagerSysV,
+ thunar_vfs_volume_manager_sysv,
+ G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (THUNAR_VFS_TYPE_VOLUME_MANAGER,
+ thunar_vfs_volume_manager_sysv_manager_init));
+
+
+static void
+thunar_vfs_volume_manager_sysv_class_init (ThunarVfsVolumeManagerSysVClass *klass)
+{
+}
+
+
+
+static void
+thunar_vfs_volume_manager_sysv_manager_init (ThunarVfsVolumeManagerIface *iface)
+{
+ iface->get_volumes = thunar_vfs_volume_manager_sysv_get_volumes;
+}
+
+
+
+static void
+thunar_vfs_volume_manager_sysv_init (ThunarVfsVolumeManagerSysV *manager_sysv)
+{
+}
+
+
+
+static GList*
+thunar_vfs_volume_manager_sysv_get_volumes (ThunarVfsVolumeManager *manager)
+{
+ g_return_val_if_fail (THUNAR_VFS_IS_VOLUME_MANAGER_SYSV (manager), NULL);
+ 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-sysv.h b/thunar-vfs/thunar-vfs-volume-sysv.h
new file mode 100644
index 00000000..1adf0ec1
--- /dev/null
+++ b/thunar-vfs/thunar-vfs-volume-sysv.h
@@ -0,0 +1,55 @@
+/* $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 1b8cd14d..c884f335 100644
--- a/thunar-vfs/thunar-vfs-volume.c
+++ b/thunar-vfs/thunar-vfs-volume.c
@@ -26,7 +26,6 @@
#include <thunar-vfs/thunar-vfs-enum-types.h>
#include <thunar-vfs/thunar-vfs-volume.h>
-#include <thunar-vfs/thunar-vfs-volume-bsd.h>
@@ -499,11 +498,12 @@ thunar_vfs_volume_manager_base_init (gpointer klass)
ThunarVfsVolumeManager*
thunar_vfs_volume_manager_get_default (void)
{
+ extern GType _thunar_vfs_volume_manager_impl_get_type (void);
static ThunarVfsVolumeManager *manager = NULL;
if (G_UNLIKELY (manager == NULL))
{
- manager = g_object_new (THUNAR_VFS_TYPE_VOLUME_MANAGER_BSD, NULL);
+ manager = g_object_new (_thunar_vfs_volume_manager_impl_get_type (), NULL);
g_object_add_weak_pointer (G_OBJECT (manager), (gpointer) &manager);
}
else