From: Bastien Nocera <hadess@hadess.net>
To: BlueZ Hackers <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] [PATCH] New version of obexftp_available
Date: Wed, 25 Jul 2007 17:03:08 +0100 [thread overview]
Message-ID: <1185379388.3641.253.camel@cookie.hadess.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 234 bytes --]
This uses the modulesdir variable in newer gnome-vfs to look for
configuration directories.
The code is still pretty ugly, but I guess we'll just use gvfs in a
couple of GNOME release cycles.
--
Bastien Nocera <hadess@hadess.net>
[-- Attachment #2: bluez-gnome-obexftp-avail.patch --]
[-- Type: text/x-patch, Size: 2202 bytes --]
Index: configure.in
===================================================================
RCS file: /cvsroot/bluez/gnome/configure.in,v
retrieving revision 1.47
diff -u -p -r1.47 configure.in
--- configure.in 22 Jul 2007 16:06:02 -0000 1.47
+++ configure.in 25 Jul 2007 15:49:12 -0000
@@ -62,6 +62,11 @@ PKG_CHECK_MODULES(NOTIFY, libnotify >= 0
AC_SUBST(NOTIFY_CFLAGS)
AC_SUBST(NOTIFY_LIBS)
+MODULESDIR=`$PKG_CONFIG --variable=modulesdir gnome-vfs-2.0`
+if test x"$MODULESDIR" != "x" ; then
+ AC_DEFINE(MODULESDIR, [$MODULESDIR], [The location of gnome-vfs configuration files])
+fi
+
dnl PKG_CHECK_MODULES(OPENOBEX, libopenobex-glib >= 1.4, dummy=yes, dummy=no)
dnl AC_SUBST(OPENOBEX_CFLAGS)
dnl AC_SUBST(OPENOBEX_LIBS)
Index: applet/main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/applet/main.c,v
retrieving revision 1.70
diff -u -p -r1.70 main.c
--- applet/main.c 25 Jul 2007 14:03:50 -0000 1.70
+++ applet/main.c 25 Jul 2007 15:49:13 -0000
@@ -1396,6 +1398,43 @@ static void name_owner_changed(DBusGProx
static gboolean obexftp_available(void)
{
+ char *path;
+ gboolean retval = FALSE;
+
+ /* Look for nautilus in the PATH */
+ path = g_find_program_in_path("nautilus");
+ if (path == NULL)
+ return FALSE;
+ g_free(path);
+
+#ifdef MODULESDIR
+ /* Look for obex-module.conf in the system-wide dir */
+ path = g_build_filename(MODULESDIR, "obex-module.conf", NULL);
+ retval = g_file_test(path, G_FILE_TEST_IS_REGULAR);
+ g_free(path);
+ if (retval != FALSE)
+ return TRUE;
+#endif /* MODULESDIR */
+ /* Look in the home dir */
+ if (g_get_home_dir() != NULL) {
+ path = g_build_filename(g_get_home_dir(), ".gnome2", "vfs",
+ "modules", "obex-module.conf", NULL);
+ retval = g_file_test(path, G_FILE_TEST_IS_REGULAR);
+ g_free(path);
+ if (retval != FALSE)
+ return TRUE;
+ }
+
+ /* Look in the envvar defined dir */
+ if (g_getenv("GNOME_VFS_MODULE_CONFIG_PATH") != NULL) {
+ path = g_build_filename(g_getenv("GNOME_VFS_MODULE_CONFIG_PATH"),
+ "obex-module.conf", NULL);
+ retval = g_file_test(path, G_FILE_TEST_IS_REGULAR);
+ g_free(path);
+ if (retval != FALSE)
+ return TRUE;
+ }
+
return FALSE;
}
[-- Attachment #3: Type: text/plain, Size: 315 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next reply other threads:[~2007-07-25 16:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-25 16:03 Bastien Nocera [this message]
2007-07-25 18:01 ` [Bluez-devel] [PATCH] New version of obexftp_available Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1185379388.3641.253.camel@cookie.hadess.net \
--to=hadess@hadess.net \
--cc=bluez-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox