2010-04-23 Ghee Teo <
[email protected]>
Complete fix of doo#15000 for fsexam
* patches/fsexam-01-remove-eel.diff:
* specs/SUNWfsexam.spec:
diff -urB fsexam-0.8.1.orig/configure.in fsexam-0.8.1.hacked/configure.in
--- fsexam-0.8.1.orig/configure.in 2010-04-23 14:41:32.385944606 +0100
+++ fsexam-0.8.1.hacked/configure.in 2010-04-23 14:54:34.931729119 +0100
@@ -65,8 +65,7 @@
[gnome-desktop-2.0 >= 2.0 \
libgnomeui-2.0 >= 2.0 \
libglade-2.0 >= 2.0 \
- gnome-vfs-module-2.0 >= 2.0 \
- eel-2.0 >= 2.2.3])
+ gnome-vfs-module-2.0 >= 2.0])
PKG_CHECK_MODULES(DUMMY,
[glib-2.0 >= 2.8],
diff -urB fsexam-0.8.1.orig/src/fsexam-dnd.c fsexam-0.8.1.hacked/src/fsexam-dnd.c
--- fsexam-0.8.1.orig/src/fsexam-dnd.c 2009-02-10 07:31:50.000000000 +0000
+++ fsexam-0.8.1.hacked/src/fsexam-dnd.c 2010-04-23 14:53:51.385616947 +0100
@@ -34,8 +34,6 @@
#include <libgnome/libgnome.h>
#include <libgnomeui/libgnomeui.h>
#include <libgnomevfs/gnome-vfs.h>
-#include <eel/eel-vfs-extensions.h>
-#include <eel/eel-string.h>
#include <stdio.h>
#include "fsexam-header.h"
@@ -54,6 +52,41 @@
{"x-special/gnome-icon-list", 0, FSEXAM_ICON_DND_GNOME_ICON_LIST}
};
+static gboolean
+_uri_has_prefix (const char *haystack, const char *needle)
+{
+ const char *h, *n;
+ char hc, nc;
+
+ h = haystack == NULL ? "" : haystack;
+ n = needle == NULL ? "" : needle;
+ do {
+ if (*n == '\0') {
+ return TRUE;
+ }
+ if (*h == '\0') {
+ return FALSE;
+ }
+ hc = *h++;
+ nc = *n++;
+ hc = g_ascii_tolower (hc);
+ nc = g_ascii_tolower (nc);
+ } while (hc == nc);
+ return FALSE;
+}
+
+static gboolean
+_uri_is_desktop (gchar *uri)
+{
+ return _uri_has_prefix (uri, "x-nautilus-desktop:");
+}
+
+static gboolean
+_uri_is_trash (gchar *uri)
+{
+ return _uri_has_prefix (uri, "trash:");
+}
+
static void
drag_data_received_callback (GtkWidget *widget,
GdkDragContext *context,
@@ -93,8 +126,8 @@
if (local_path) {
fsexam_change_dir (local_path);
} else {
- if (eel_uri_is_desktop (canonical_uri)
- || eel_uri_is_trash (canonical_uri)) {
+ if (_uri_is_desktop (canonical_uri)
+ || _uri_is_trash (canonical_uri)) {
gchar *uri = NULL;
p = strstr(canonical_uri, ":");
if (p != NULL) {