Add patch from http://bugzilla.xfce.org/show_bug.cgi?id=6093 to port it
to thunarx-2. Fix WANTLIB/LIB_DEPENDS, bump REVISION.
This commit is contained in:
parent
9e553372a5
commit
dbabaf57bb
@ -1,10 +1,10 @@
|
||||
# $OpenBSD: Makefile,v 1.6 2010/11/22 08:37:06 espie Exp $
|
||||
# $OpenBSD: Makefile,v 1.7 2011/01/18 20:52:20 landry Exp $
|
||||
|
||||
COMMENT = Thunar archive plugin
|
||||
|
||||
XFCE_VERSION = 0.2.4
|
||||
THUNAR_PLUGIN = thunar-archive-plugin
|
||||
REVISION = 2
|
||||
REVISION = 3
|
||||
|
||||
# GPLv2
|
||||
PERMIT_PACKAGE_CDROM = Yes
|
||||
@ -18,4 +18,14 @@ BUILD_DEPENDS +=${RUN_DEPENDS}
|
||||
RUN_DEPENDS = x11/xfce4/thunar \
|
||||
xarchiver-*|file-roller-*|kdeutils-*:x11/xarchiver
|
||||
|
||||
LIB_DEPENDS += x11/xfce4/exo
|
||||
|
||||
WANTLIB += GL ICE SM X11 Xau Xcomposite Xcursor Xdamage Xdmcp
|
||||
WANTLIB += Xext Xfixes Xi Xinerama Xrandr Xrender Xxf86vm atk-1.0
|
||||
WANTLIB += cairo drm exo-1 expat fontconfig freetype gdk-x11-2.0
|
||||
WANTLIB += gdk_pixbuf-2.0 gio-2.0 glib-2.0 gmodule-2.0 gobject-2.0
|
||||
WANTLIB += gthread-2.0 gtk-x11-2.0 m pango-1.0 pangocairo-1.0
|
||||
WANTLIB += pangoft2-1.0 pcre pixman-1 png pthread-stubs xcb xcb-render
|
||||
WANTLIB += xcb-shm xfce4util z
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
63
x11/xfce4/thunar-archive/patches/patch-configure
Normal file
63
x11/xfce4/thunar-archive/patches/patch-configure
Normal file
@ -0,0 +1,63 @@
|
||||
$OpenBSD: patch-configure,v 1.1 2011/01/18 20:52:20 landry Exp $
|
||||
--- configure.orig Sat Jan 15 23:21:26 2011
|
||||
+++ configure Sat Jan 15 23:21:44 2011
|
||||
@@ -22113,22 +22113,22 @@ echo "${ECHO_T}$xdt_cv_PKG_CONFIG_VERSION" >&6
|
||||
fi
|
||||
|
||||
|
||||
- echo "$as_me:$LINENO: checking for thunarx-1 >= 0.4.0" >&5
|
||||
-echo $ECHO_N "checking for thunarx-1 >= 0.4.0... $ECHO_C" >&6
|
||||
- if $PKG_CONFIG "--atleast-version=0.4.0" "thunarx-1" >/dev/null 2>&1; then
|
||||
- THUNARX_VERSION=`$PKG_CONFIG --modversion "thunarx-1"`
|
||||
+ echo "$as_me:$LINENO: checking for thunarx-2 >= 0.4.0" >&5
|
||||
+echo $ECHO_N "checking for thunarx-2 >= 0.4.0... $ECHO_C" >&6
|
||||
+ if $PKG_CONFIG "--atleast-version=0.4.0" "thunarx-2" >/dev/null 2>&1; then
|
||||
+ THUNARX_VERSION=`$PKG_CONFIG --modversion "thunarx-2"`
|
||||
echo "$as_me:$LINENO: result: $THUNARX_VERSION" >&5
|
||||
echo "${ECHO_T}$THUNARX_VERSION" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking THUNARX_CFLAGS" >&5
|
||||
echo $ECHO_N "checking THUNARX_CFLAGS... $ECHO_C" >&6
|
||||
- THUNARX_CFLAGS=`$PKG_CONFIG --cflags "thunarx-1"`
|
||||
+ THUNARX_CFLAGS=`$PKG_CONFIG --cflags "thunarx-2"`
|
||||
echo "$as_me:$LINENO: result: $THUNARX_CFLAGS" >&5
|
||||
echo "${ECHO_T}$THUNARX_CFLAGS" >&6
|
||||
|
||||
echo "$as_me:$LINENO: checking THUNARX_LIBS" >&5
|
||||
echo $ECHO_N "checking THUNARX_LIBS... $ECHO_C" >&6
|
||||
- THUNARX_LIBS=`$PKG_CONFIG --libs "thunarx-1"`
|
||||
+ THUNARX_LIBS=`$PKG_CONFIG --libs "thunarx-2"`
|
||||
echo "$as_me:$LINENO: result: $THUNARX_LIBS" >&5
|
||||
echo "${ECHO_T}$THUNARX_LIBS" >&6
|
||||
|
||||
@@ -22140,15 +22140,15 @@ echo "${ECHO_T}$THUNARX_LIBS" >&6
|
||||
|
||||
|
||||
|
||||
- elif $PKG_CONFIG --exists "thunarx-1" >/dev/null 2>&1; then
|
||||
- xdt_cv_version=`$PKG_CONFIG --modversion "thunarx-1"`
|
||||
+ elif $PKG_CONFIG --exists "thunarx-2" >/dev/null 2>&1; then
|
||||
+ xdt_cv_version=`$PKG_CONFIG --modversion "thunarx-2"`
|
||||
echo "$as_me:$LINENO: result: found, but $xdt_cv_version" >&5
|
||||
echo "${ECHO_T}found, but $xdt_cv_version" >&6
|
||||
|
||||
|
||||
- echo "*** The required package thunarx-1 was found on your system,"
|
||||
+ echo "*** The required package thunarx-2 was found on your system,"
|
||||
echo "*** but the installed version ($xdt_cv_version) is too old."
|
||||
- echo "*** Please upgrade thunarx-1 to atleast version 0.4.0, or adjust"
|
||||
+ echo "*** Please upgrade thunarx-2 to atleast version 0.4.0, or adjust"
|
||||
echo "*** the PKG_CONFIG_PATH environment variable if you installed"
|
||||
echo "*** the new version of the package in a nonstandard prefix so"
|
||||
echo "*** pkg-config is able to find it."
|
||||
@@ -22159,8 +22159,8 @@ echo "${ECHO_T}found, but $xdt_cv_version" >&6
|
||||
echo "${ECHO_T}not found" >&6
|
||||
|
||||
|
||||
- echo "*** The required package thunarx-1 was not found on your system."
|
||||
- echo "*** Please install thunarx-1 (atleast version 0.4.0) or adjust"
|
||||
+ echo "*** The required package thunarx-2 was not found on your system."
|
||||
+ echo "*** Please install thunarx-2 (atleast version 0.4.0) or adjust"
|
||||
echo "*** the PKG_CONFIG_PATH environment variable if you"
|
||||
echo "*** installed the package in a nonstandard prefix so that"
|
||||
echo "*** pkg-config is able to find it."
|
@ -0,0 +1,27 @@
|
||||
$OpenBSD: patch-thunar-archive-plugin_Makefile_in,v 1.1 2011/01/18 20:52:20 landry Exp $
|
||||
--- thunar-archive-plugin/Makefile.in.orig Sat Jan 20 11:44:58 2007
|
||||
+++ thunar-archive-plugin/Makefile.in Sun Jan 16 01:52:19 2011
|
||||
@@ -224,7 +224,7 @@ INCLUDES = \
|
||||
-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
|
||||
$(PLATFORM_CPPFLAGS)
|
||||
|
||||
-extensionsdir = $(libdir)/thunarx-1
|
||||
+extensionsdir = $(libdir)/thunarx-2
|
||||
extensions_LTLIBRARIES = \
|
||||
thunar-archive-plugin.la
|
||||
|
||||
@@ -238,12 +238,13 @@ thunar_archive_plugin_la_SOURCES = \
|
||||
thunar_archive_plugin_la_CFLAGS = \
|
||||
$(PLATFORM_CFLAGS) \
|
||||
$(THUNARX_CFLAGS) \
|
||||
- $(THUNAR_VFS_CFLAGS)
|
||||
+ `pkg-config --cflags exo-1`
|
||||
|
||||
thunar_archive_plugin_la_LDFLAGS = \
|
||||
-avoid-version \
|
||||
-export-dynamic \
|
||||
-module \
|
||||
+ `pkg-config --libs exo-1` \
|
||||
$(PLATFORM_LDFLAGS)
|
||||
|
||||
all: all-am
|
@ -0,0 +1,342 @@
|
||||
$OpenBSD: patch-thunar-archive-plugin_tap-backend_c,v 1.1 2011/01/18 20:52:20 landry Exp $
|
||||
http://bugzilla.xfce.org/show_bug.cgi?id=6093
|
||||
--- thunar-archive-plugin/tap-backend.c.orig Sat Jan 20 11:41:50 2007
|
||||
+++ thunar-archive-plugin/tap-backend.c Sun Jan 16 01:34:36 2011
|
||||
@@ -29,36 +29,36 @@
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
-#include <thunar-vfs/thunar-vfs.h>
|
||||
-
|
||||
+#include <exo/exo.h>
|
||||
#include <thunar-archive-plugin/tap-backend.h>
|
||||
|
||||
|
||||
|
||||
-static ThunarVfsMimeApplication *tap_backend_mime_ask (GList *mime_applications,
|
||||
- GtkWidget *parent);
|
||||
-static GList *tap_backend_mime_applications (ThunarVfsMimeDatabase *mime_database,
|
||||
- GList *mime_infos);
|
||||
-static ThunarVfsMimeApplication *tap_backend_mime_application (GList *mime_infos,
|
||||
- GtkWidget *window,
|
||||
- GError **error);
|
||||
-static gchar *tap_backend_mime_wrapper (ThunarVfsMimeApplication *mime_application) G_GNUC_MALLOC;
|
||||
-static GPid tap_backend_run (const gchar *action,
|
||||
- const gchar *folder,
|
||||
- GList *files,
|
||||
- GList *mime_infos,
|
||||
- GtkWidget *window,
|
||||
- GError **error);
|
||||
+static GAppInfo *tap_backend_mime_ask (GList *mime_applications,
|
||||
+ GtkWidget *parent);
|
||||
+static gint tap_backend_mime_application_compare (GAppInfo *a,
|
||||
+ GAppInfo *b);
|
||||
+static GList *tap_backend_mime_applications (GList *content_types);
|
||||
+static GAppInfo *tap_backend_mime_application (GList *content_types,
|
||||
+ GtkWidget *window,
|
||||
+ GError **error);
|
||||
+static gchar *tap_backend_mime_wrapper (GAppInfo *mime_application) G_GNUC_MALLOC;
|
||||
+static GPid tap_backend_run (const gchar *action,
|
||||
+ const gchar *folder,
|
||||
+ GList *files,
|
||||
+ GList *content_types,
|
||||
+ GtkWidget *window,
|
||||
+ GError **error);
|
||||
|
||||
|
||||
|
||||
-static ThunarVfsMimeApplication*
|
||||
+static GAppInfo*
|
||||
tap_backend_mime_ask (GList *mime_applications,
|
||||
GtkWidget *parent)
|
||||
{
|
||||
- ThunarVfsMimeApplication *mime_application = NULL;
|
||||
+ GAppInfo *mime_application = NULL;
|
||||
GtkIconTheme *icon_theme;
|
||||
- const gchar *icon_name;
|
||||
+ GIcon *icon;
|
||||
GtkTooltips *tooltips;
|
||||
GtkWidget *button;
|
||||
GtkWidget *dialog;
|
||||
@@ -127,7 +127,7 @@ tap_backend_mime_ask (GList *mime_applications,
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* set the command as tooltip, as some archive manager's names are not very useful */
|
||||
- command = g_strdup (thunar_vfs_mime_handler_get_command (THUNAR_VFS_MIME_HANDLER (mp->data)));
|
||||
+ command = g_strdup (g_app_info_get_executable (mp->data));
|
||||
space = strchr (command, ' ');
|
||||
if (G_LIKELY (space != NULL))
|
||||
*space = '\0';
|
||||
@@ -140,17 +140,17 @@ tap_backend_mime_ask (GList *mime_applications,
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
/* check if we have an icon for the application */
|
||||
- icon_name = thunar_vfs_mime_handler_lookup_icon_name (THUNAR_VFS_MIME_HANDLER (mp->data), icon_theme);
|
||||
- if (G_LIKELY (icon_name != NULL))
|
||||
+ icon = g_app_info_get_icon (mp->data);
|
||||
+ if (G_LIKELY (icon != NULL))
|
||||
{
|
||||
/* add an image */
|
||||
- image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
|
||||
+ image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
|
||||
gtk_widget_show (image);
|
||||
}
|
||||
|
||||
/* add the label for the application */
|
||||
- label = gtk_label_new (thunar_vfs_mime_application_get_name (mp->data));
|
||||
+ label = gtk_label_new (g_app_info_get_name (mp->data));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.5f);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
|
||||
gtk_widget_show (label);
|
||||
@@ -178,9 +178,17 @@ tap_backend_mime_ask (GList *mime_applications,
|
||||
|
||||
|
||||
|
||||
+static gint
|
||||
+tap_backend_mime_application_compare (GAppInfo *a,
|
||||
+ GAppInfo *b)
|
||||
+{
|
||||
+ return g_app_info_equal (a, b)?0:1;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
static GList*
|
||||
-tap_backend_mime_applications (ThunarVfsMimeDatabase *mime_database,
|
||||
- GList *mime_infos)
|
||||
+tap_backend_mime_applications (GList *content_types)
|
||||
{
|
||||
GList *mime_applications = NULL;
|
||||
GList *list;
|
||||
@@ -190,14 +198,14 @@ tap_backend_mime_applications (ThunarVfsMimeDatabase *
|
||||
gchar *s;
|
||||
|
||||
/* determine the set of applications that can handle all mime types */
|
||||
- for (lp = mime_infos; lp != NULL; lp = lp->next)
|
||||
+ for (lp = content_types; lp != NULL; lp = lp->next)
|
||||
{
|
||||
/* no need to check anything if this is the same mime type as the previous one */
|
||||
if (lp->prev != NULL && lp->prev->data == lp->data)
|
||||
continue;
|
||||
|
||||
/* determine the list of applications that can handle this mime type */
|
||||
- list = thunar_vfs_mime_database_get_applications (mime_database, lp->data);
|
||||
+ list = g_app_info_get_all_for_type (lp->data);
|
||||
if (G_UNLIKELY (mime_applications == NULL))
|
||||
{
|
||||
/* first file, so just use the applications list */
|
||||
@@ -212,7 +220,7 @@ tap_backend_mime_applications (ThunarVfsMimeDatabase *
|
||||
next = ap->next;
|
||||
|
||||
/* check if the application is present in list */
|
||||
- if (g_list_find (list, ap->data) == NULL)
|
||||
+ if (g_list_find_custom (list, ap->data, (GCompareFunc) tap_backend_mime_application_compare) == NULL)
|
||||
{
|
||||
/* drop our reference on the application */
|
||||
g_object_unref (G_OBJECT (ap->data));
|
||||
@@ -256,24 +264,19 @@ tap_backend_mime_applications (ThunarVfsMimeDatabase *
|
||||
|
||||
|
||||
|
||||
-static ThunarVfsMimeApplication*
|
||||
-tap_backend_mime_application (GList *mime_infos,
|
||||
+static GAppInfo*
|
||||
+tap_backend_mime_application (GList *content_types,
|
||||
GtkWidget *window,
|
||||
GError **error)
|
||||
{
|
||||
- ThunarVfsMimeApplication *mime_application = NULL;
|
||||
- ThunarVfsMimeDatabase *mime_database;
|
||||
- const gchar * const *mime_types;
|
||||
- ThunarVfsMimeInfo *mime_info;
|
||||
+ GAppInfo *mime_application = NULL;
|
||||
+ GAppInfo *app_info;
|
||||
GError *err = NULL;
|
||||
GList *mime_applications;
|
||||
- guint n;
|
||||
+ GList *lp;
|
||||
|
||||
- /* grab a reference on the mime database */
|
||||
- mime_database = thunar_vfs_mime_database_get_default ();
|
||||
-
|
||||
/* determine the mime applications that can handle the mime types */
|
||||
- mime_applications = tap_backend_mime_applications (mime_database, mime_infos);
|
||||
+ mime_applications = tap_backend_mime_applications (content_types);
|
||||
if (G_UNLIKELY (mime_applications == NULL))
|
||||
{
|
||||
/* tell the user that we cannot handle the specified mime types */
|
||||
@@ -290,28 +293,29 @@ tap_backend_mime_application (GList *mime_infos,
|
||||
/* more than one supported archive manager, check if the first
|
||||
* available is the default for all its supported mime types.
|
||||
*/
|
||||
- mime_types = thunar_vfs_mime_application_get_mime_types (mime_applications->data);
|
||||
- for (n = 0; mime_types[n] != NULL; ++n)
|
||||
+ for (lp = content_types; lp != NULL; lp = lp->next)
|
||||
{
|
||||
/* determine the default application for this mime type */
|
||||
- mime_info = thunar_vfs_mime_database_get_info (mime_database, mime_types[n]);
|
||||
- mime_application = thunar_vfs_mime_database_get_default_application (mime_database, mime_info);
|
||||
- thunar_vfs_mime_info_unref (mime_info);
|
||||
+ app_info = g_app_info_get_default_for_type (lp->data, FALSE);
|
||||
|
||||
+ /* no default applications for this mime type */
|
||||
+ if (app_info == NULL)
|
||||
+ break;
|
||||
+
|
||||
/* check if our expected default application is also the default here */
|
||||
- if (mime_applications->data != mime_application)
|
||||
+ if (!g_app_info_equal (app_info, mime_applications->data))
|
||||
{
|
||||
/* no, have to ask the user */
|
||||
- g_object_unref (G_OBJECT (mime_application));
|
||||
+ g_object_unref (app_info);
|
||||
break;
|
||||
}
|
||||
|
||||
/* yep, next one please... */
|
||||
- g_object_unref (G_OBJECT (mime_application));
|
||||
+ g_object_unref (app_info);
|
||||
}
|
||||
|
||||
/* check if we have found a suitable one */
|
||||
- if (G_LIKELY (mime_types[n] == NULL))
|
||||
+ if (G_LIKELY (lp == NULL))
|
||||
{
|
||||
/* use the first available archive manager */
|
||||
mime_application = g_object_ref (G_OBJECT (mime_applications->data));
|
||||
@@ -325,20 +329,17 @@ tap_backend_mime_application (GList *mime_infos,
|
||||
/* make the selected application the default for all its
|
||||
* supported mime types, so we don't need to ask once again.
|
||||
*/
|
||||
- mime_types = thunar_vfs_mime_application_get_mime_types (mime_application);
|
||||
- for (n = 0; mime_types[n] != NULL; ++n)
|
||||
+ for (lp = content_types; lp != NULL; lp = lp->next)
|
||||
{
|
||||
/* set the default application */
|
||||
- mime_info = thunar_vfs_mime_database_get_info (mime_database, mime_types[n]);
|
||||
- if (!thunar_vfs_mime_database_set_default_application (mime_database, mime_info, mime_application, &err))
|
||||
+ if (!g_app_info_set_as_default_for_type (mime_application, lp->data, &err))
|
||||
{
|
||||
/* not critical, still we should tell the user that we failed */
|
||||
g_warning ("Failed to make \"%s\" the default application for %s: %s",
|
||||
- thunar_vfs_mime_application_get_name (mime_application),
|
||||
- thunar_vfs_mime_info_get_name (mime_info), err->message);
|
||||
+ g_app_info_get_name (mime_application),
|
||||
+ (char*) lp->data, err->message);
|
||||
g_clear_error (&err);
|
||||
}
|
||||
- thunar_vfs_mime_info_unref (mime_info);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -348,16 +349,13 @@ tap_backend_mime_application (GList *mime_infos,
|
||||
g_list_free (mime_applications);
|
||||
}
|
||||
|
||||
- /* release our reference on the mime database */
|
||||
- g_object_unref (G_OBJECT (mime_database));
|
||||
-
|
||||
return mime_application;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static gchar*
|
||||
-tap_backend_mime_wrapper (ThunarVfsMimeApplication *mime_application)
|
||||
+tap_backend_mime_wrapper (GAppInfo *mime_application)
|
||||
{
|
||||
const gchar *desktop_id;
|
||||
gchar *basename;
|
||||
@@ -365,7 +363,7 @@ tap_backend_mime_wrapper (ThunarVfsMimeApplication *mi
|
||||
gchar *dot;
|
||||
|
||||
/* determine the basename of the .desktop file */
|
||||
- desktop_id = thunar_vfs_mime_application_get_desktop_id (mime_application);
|
||||
+ desktop_id = g_app_info_get_id (mime_application);
|
||||
basename = g_path_get_basename (desktop_id);
|
||||
dot = strrchr (basename, '.');
|
||||
if (G_LIKELY (dot != NULL))
|
||||
@@ -394,12 +392,12 @@ static GPid
|
||||
tap_backend_run (const gchar *action,
|
||||
const gchar *folder,
|
||||
GList *files,
|
||||
- GList *mime_infos,
|
||||
+ GList *content_types,
|
||||
GtkWidget *window,
|
||||
GError **error)
|
||||
{
|
||||
- ThunarVfsMimeApplication *mime_application;
|
||||
- ThunarVfsInfo *info;
|
||||
+ GAppInfo *mime_application;
|
||||
+ gchar *mime_type;
|
||||
GdkScreen *screen;
|
||||
gchar *wrapper;
|
||||
gchar **argv;
|
||||
@@ -409,19 +407,19 @@ tap_backend_run (const gchar *action,
|
||||
gint n;
|
||||
|
||||
/* determine the mime infos on-demand */
|
||||
- if (G_LIKELY (mime_infos == NULL))
|
||||
+ if (G_LIKELY (content_types == NULL))
|
||||
{
|
||||
/* determine the mime infos from the files */
|
||||
for (lp = files; lp != NULL; lp = lp->next)
|
||||
{
|
||||
- info = thunarx_file_info_get_vfs_info (THUNARX_FILE_INFO (lp->data));
|
||||
- mime_infos = g_list_append (mime_infos, thunar_vfs_mime_info_ref (info->mime_info));
|
||||
- thunar_vfs_info_unref (info);
|
||||
+ mime_type = thunarx_file_info_get_mime_type (THUNARX_FILE_INFO (lp->data));
|
||||
+ content_types = g_list_append (content_types, g_content_type_from_mime_type (mime_type));
|
||||
+ g_free (mime_type);
|
||||
}
|
||||
}
|
||||
|
||||
/* determine the mime application to use */
|
||||
- mime_application = tap_backend_mime_application (mime_infos, window, error);
|
||||
+ mime_application = tap_backend_mime_application (content_types, window, error);
|
||||
if (G_LIKELY (mime_application != NULL))
|
||||
{
|
||||
/* determine the wrapper script for the application */
|
||||
@@ -463,7 +461,8 @@ tap_backend_run (const gchar *action,
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
- thunar_vfs_mime_info_list_free (mime_infos);
|
||||
+ g_list_foreach (content_types, (GFunc) g_free, NULL);
|
||||
+ g_list_free (content_types);
|
||||
|
||||
return pid;
|
||||
}
|
||||
@@ -493,24 +492,21 @@ tap_backend_create_archive (const gchar *folder,
|
||||
GtkWidget *window,
|
||||
GError **error)
|
||||
{
|
||||
- ThunarVfsMimeDatabase *mime_database;
|
||||
- GList *mime_infos = NULL;
|
||||
+ GList *content_types = NULL;
|
||||
|
||||
g_return_val_if_fail (files != NULL, -1);
|
||||
g_return_val_if_fail (GTK_IS_WINDOW (window), -1);
|
||||
g_return_val_if_fail (g_path_is_absolute (folder), -1);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, -1);
|
||||
|
||||
- /* determine the mime infos for zip and tar files (all supported archives must be able to handle them) */
|
||||
- mime_database = thunar_vfs_mime_database_get_default ();
|
||||
- mime_infos = g_list_append (mime_infos, thunar_vfs_mime_database_get_info (mime_database, "application/x-compressed-tar"));
|
||||
- mime_infos = g_list_append (mime_infos, thunar_vfs_mime_database_get_info (mime_database, "application/x-tar"));
|
||||
- mime_infos = g_list_append (mime_infos, thunar_vfs_mime_database_get_info (mime_database, "application/x-zip"));
|
||||
- mime_infos = g_list_append (mime_infos, thunar_vfs_mime_database_get_info (mime_database, "application/zip"));
|
||||
- g_object_unref (G_OBJECT (mime_database));
|
||||
+ /* determine the content types for zip and tar files (all supported archives must be able to handle them) */
|
||||
+ content_types = g_list_append (content_types, g_content_type_from_mime_type ("application/x-compressed-tar"));
|
||||
+ content_types = g_list_append (content_types, g_content_type_from_mime_type ("application/x-tar"));
|
||||
+ content_types = g_list_append (content_types, g_content_type_from_mime_type ("application/x-zip"));
|
||||
+ content_types = g_list_append (content_types, g_content_type_from_mime_type ("application/zip"));
|
||||
|
||||
/* run the action, the mime infos will be freed by the _run() method */
|
||||
- return tap_backend_run ("create", folder, files, mime_infos, window, error);
|
||||
+ return tap_backend_run ("create", folder, files, content_types, window, error);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,131 @@
|
||||
$OpenBSD: patch-thunar-archive-plugin_tap-provider_c,v 1.1 2011/01/18 20:52:20 landry Exp $
|
||||
http://bugzilla.xfce.org/show_bug.cgi?id=6093
|
||||
--- thunar-archive-plugin/tap-provider.c.orig Sat Jan 20 11:41:50 2007
|
||||
+++ thunar-archive-plugin/tap-provider.c Sun Jan 16 01:34:36 2011
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
-#include <thunar-vfs/thunar-vfs.h>
|
||||
+#include <libxfce4util/libxfce4util.h>
|
||||
|
||||
#include <thunar-archive-plugin/tap-backend.h>
|
||||
#include <thunar-archive-plugin/tap-provider.h>
|
||||
@@ -419,8 +419,7 @@ tap_provider_get_file_actions (ThunarxMenuProvider *me
|
||||
GtkWidget *window,
|
||||
GList *files)
|
||||
{
|
||||
- ThunarVfsPathScheme scheme;
|
||||
- ThunarVfsInfo *info;
|
||||
+ gchar *scheme;
|
||||
TapProvider *tap_provider = TAP_PROVIDER (menu_provider);
|
||||
GtkAction *action;
|
||||
GClosure *closure;
|
||||
@@ -434,13 +433,15 @@ tap_provider_get_file_actions (ThunarxMenuProvider *me
|
||||
for (lp = files; lp != NULL; lp = lp->next, ++n_files)
|
||||
{
|
||||
/* check if the file is a local file */
|
||||
- info = thunarx_file_info_get_vfs_info (lp->data);
|
||||
- scheme = thunar_vfs_path_get_scheme (info->path);
|
||||
- thunar_vfs_info_unref (info);
|
||||
+ scheme = thunarx_file_info_get_uri_scheme (lp->data);
|
||||
|
||||
/* unable to handle non-local files */
|
||||
- if (G_UNLIKELY (scheme != THUNAR_VFS_PATH_SCHEME_FILE))
|
||||
- return NULL;
|
||||
+ if (G_UNLIKELY (strcmp (scheme, "file")))
|
||||
+ {
|
||||
+ g_free (scheme);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ g_free (scheme);
|
||||
|
||||
/* check if this file is a supported archive */
|
||||
if (all_archives && !tap_is_archive (lp->data))
|
||||
@@ -547,8 +548,7 @@ tap_provider_get_dnd_actions (ThunarxMenuProvider *men
|
||||
ThunarxFileInfo *folder,
|
||||
GList *files)
|
||||
{
|
||||
- ThunarVfsPathScheme scheme;
|
||||
- ThunarVfsInfo *info;
|
||||
+ gchar *scheme;
|
||||
TapProvider *tap_provider = TAP_PROVIDER (menu_provider);
|
||||
GtkAction *action;
|
||||
GClosure *closure;
|
||||
@@ -556,25 +556,29 @@ tap_provider_get_dnd_actions (ThunarxMenuProvider *men
|
||||
gint n_files = 0;
|
||||
|
||||
/* check if the folder is a local folder */
|
||||
- info = thunarx_file_info_get_vfs_info (folder);
|
||||
- scheme = thunar_vfs_path_get_scheme (info->path);
|
||||
- thunar_vfs_info_unref (info);
|
||||
+ scheme = thunarx_file_info_get_uri_scheme (folder);
|
||||
|
||||
/* unable to extract to non-local folders */
|
||||
- if (G_UNLIKELY (scheme != THUNAR_VFS_PATH_SCHEME_FILE))
|
||||
- return NULL;
|
||||
+ if (G_UNLIKELY (strcmp (scheme, "file")))
|
||||
+ {
|
||||
+ g_free (scheme);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ g_free (scheme);
|
||||
|
||||
/* check all supplied files */
|
||||
for (lp = files; lp != NULL; lp = lp->next, ++n_files)
|
||||
{
|
||||
/* check if the file is a local file */
|
||||
- info = thunarx_file_info_get_vfs_info (lp->data);
|
||||
- scheme = thunar_vfs_path_get_scheme (info->path);
|
||||
- thunar_vfs_info_unref (info);
|
||||
+ scheme = thunarx_file_info_get_uri_scheme (lp->data);
|
||||
|
||||
/* unable to handle non-local files */
|
||||
- if (G_UNLIKELY (scheme != THUNAR_VFS_PATH_SCHEME_FILE))
|
||||
- return NULL;
|
||||
+ if (G_UNLIKELY (strcmp (scheme, "file")))
|
||||
+ {
|
||||
+ g_free (scheme);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ g_free (scheme);
|
||||
|
||||
/* check if this file is a supported archive */
|
||||
if (G_LIKELY (!tap_is_archive (lp->data)))
|
||||
@@ -676,26 +680,26 @@ tap_provider_child_watch (GPid pid,
|
||||
gint status,
|
||||
gpointer user_data)
|
||||
{
|
||||
- ThunarVfsMonitor *monitor;
|
||||
- ThunarVfsPath *path;
|
||||
- TapProvider *tap_provider = TAP_PROVIDER (user_data);
|
||||
+ //TODO: ThunarVfsMonitor *monitor;
|
||||
+ //TODO: ThunarVfsPath *path;
|
||||
+ //TODO: TapProvider *tap_provider = TAP_PROVIDER (user_data);
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
|
||||
/* verify that we still have a valid child_watch_path */
|
||||
- if (G_LIKELY (tap_provider->child_watch_path != NULL))
|
||||
+ //TODO: if (G_LIKELY (tap_provider->child_watch_path != NULL))
|
||||
{
|
||||
/* determine the corresponding ThunarVfsPath */
|
||||
- path = thunar_vfs_path_new (tap_provider->child_watch_path, NULL);
|
||||
- if (G_LIKELY (path != NULL))
|
||||
+ //TODO: path = thunar_vfs_path_new (tap_provider->child_watch_path, NULL);
|
||||
+ //TODO: if (G_LIKELY (path != NULL))
|
||||
{
|
||||
/* schedule a changed notification on the path */
|
||||
- monitor = thunar_vfs_monitor_get_default ();
|
||||
- thunar_vfs_monitor_feed (monitor, THUNAR_VFS_MONITOR_EVENT_CHANGED, path);
|
||||
- g_object_unref (G_OBJECT (monitor));
|
||||
+ //TODO: monitor = thunar_vfs_monitor_get_default ();
|
||||
+ //TODO: thunar_vfs_monitor_feed (monitor, THUNAR_VFS_MONITOR_EVENT_CHANGED, path);
|
||||
+ //TODO: g_object_unref (G_OBJECT (monitor));
|
||||
|
||||
/* release the ThunarVfsPath */
|
||||
- thunar_vfs_path_unref (path);
|
||||
+ //TODO: thunar_vfs_path_unref (path);
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2009/07/22 20:43:43 landry Exp $
|
||||
lib/thunarx-1/thunar-archive-plugin.so
|
||||
@comment $OpenBSD: PFRAG.shared,v 1.2 2011/01/18 20:52:20 landry Exp $
|
||||
lib/thunarx-2/thunar-archive-plugin.so
|
||||
|
@ -1,7 +1,7 @@
|
||||
@comment $OpenBSD: PLIST,v 1.2 2009/12/21 16:07:44 landry Exp $
|
||||
@comment $OpenBSD: PLIST,v 1.3 2011/01/18 20:52:20 landry Exp $
|
||||
%%SHARED%%
|
||||
lib/thunarx-1/thunar-archive-plugin.a
|
||||
lib/thunarx-1/thunar-archive-plugin.la
|
||||
lib/thunarx-2/thunar-archive-plugin.a
|
||||
lib/thunarx-2/thunar-archive-plugin.la
|
||||
libexec/thunar-archive-plugin/ark.tap
|
||||
libexec/thunar-archive-plugin/file-roller.tap
|
||||
share/icons/hicolor/16x16/apps/tap-create.png
|
||||
|
Loading…
Reference in New Issue
Block a user