public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] [PATCH] New version of obexftp_available
@ 2007-07-25 16:03 Bastien Nocera
  2007-07-25 18:01 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Bastien Nocera @ 2007-07-25 16:03 UTC (permalink / raw)
  To: BlueZ Hackers

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Bluez-devel] [PATCH] New version of obexftp_available
  2007-07-25 16:03 [Bluez-devel] [PATCH] New version of obexftp_available Bastien Nocera
@ 2007-07-25 18:01 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2007-07-25 18:01 UTC (permalink / raw)
  To: BlueZ development

Hi Bastien,

> 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.

too ugly for me. I decided to let Nautilus handle the error case ;)

Regards

Marcel



-------------------------------------------------------------------------
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/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-25 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-25 16:03 [Bluez-devel] [PATCH] New version of obexftp_available Bastien Nocera
2007-07-25 18:01 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox