summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Brielmaier <[email protected]>2019-07-30 15:20:18 +0200
committerraveit65 <[email protected]>2019-09-12 17:43:37 +0200
commit60cdfda885014b577f19a8ff49e57f2d6cf83c8f (patch)
tree7fc27f966bb91ed81a7586cc1244bb91b862f974
parent347c991c7a1679b50f3674d19525271e41ba903a (diff)
downloadcaja-extensions-60cdfda885014b577f19a8ff49e57f2d6cf83c8f.tar.bz2
caja-extensions-60cdfda885014b577f19a8ff49e57f2d6cf83c8f.tar.xz
Build either with gupnp version 1.0 or 1.2.
This fixes https://github.com/mate-desktop/caja-extensions/issues/52. * (configure.ac): Check also for gupnp-1.2 and set HAS_GUPNP_VERSION_1_2 to yes if found. * (sendto/plugins/upnp/upnp.c): Use gupnp_context_manager_create when building with gupnp-1.2 as gupnp_context_manager_new was removed. Signed-off-by: Jonathan Brielmaier <[email protected]> Co-authored-by: Gianfranco Costamagna <[email protected]>
-rw-r--r--configure.ac2
-rw-r--r--sendto/plugins/upnp/upnp.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 021ba56..3a71a51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -196,6 +196,8 @@ if test "x$enable_sendto" = "xyes"; then
fi
;;
upnp)
+ PKG_CHECK_MODULES(UPNP, gupnp-1.2 >= $GUPNP_REQUIRED,
+ enable_upnp=yes AC_DEFINE([HAS_GUPNP_VERSION_1_2], 1, ["Version is at least 1.2"]), enable_upnp=no)
PKG_CHECK_MODULES(UPNP, gupnp-1.0 >= $GUPNP_REQUIRED,
enable_upnp=yes, enable_upnp=no)
if test "${enable_upnp}" != "yes" ; then
diff --git a/sendto/plugins/upnp/upnp.c b/sendto/plugins/upnp/upnp.c
index b381587..81a4f0a 100644
--- a/sendto/plugins/upnp/upnp.c
+++ b/sendto/plugins/upnp/upnp.c
@@ -206,7 +206,11 @@ init (NstPlugin *plugin)
return FALSE;
g_free (upload_cmd);
+#ifdef HAS_GUPNP_VERSION_1_2
+ context_manager = gupnp_context_manager_create (0);
+#else
context_manager = gupnp_context_manager_new (NULL, 0);
+#endif
g_assert (context_manager != NULL);
g_signal_connect (context_manager, "context-available",
G_CALLBACK (on_context_available), NULL);