]> git.0d.be Git - empathy.git/commitdiff
Build with latest NST when using GTK3 and port to new API (#623199)
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 8 Jul 2010 09:32:20 +0000 (11:32 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 8 Jul 2010 09:40:31 +0000 (11:40 +0200)
configure.ac
nautilus-sendto-plugin/empathy-nautilus-sendto.c

index 2426c2f5e2a7549589b6ceb6406792e4dcb6152e..7e71bd96ff710657acf5d1eaa505d7997c496a2a 100644 (file)
@@ -50,6 +50,7 @@ ISO_CODES_REQUIRED=0.35
 LIBCHAMPLAIN_GTK_REQUIRED=0.4
 LIBCHAMPLAIN_REQUIRED=0.4
 NAUTILUS_SENDTO_REQUIRED=2.28.1
+NAUTILUS_SENDTO_REQUIRED_GTK3=2.90.0
 NETWORK_MANAGER_REQUIRED=0.7.0
 WEBKIT_REQUIRED=1.1.15
 
@@ -445,10 +446,17 @@ AC_ARG_ENABLE(nautilus-sendto,
                              enable_nautilus_sendto=auto)
 
 if test "x$enable_nautilus_sendto" != "xno"; then
-   PKG_CHECK_MODULES(NST,
-   [
-      nautilus-sendto >= $NAUTILUS_SENDTO_REQUIRED
-   ], have_nst="yes", have_nst="no")
+   if test "x$enable_gtk3" == "xno"; then
+      # Newer NST requires GTK+3 so we can't use it
+      PKG_CHECK_MODULES(NST,[nautilus-sendto >= $NAUTILUS_SENDTO_REQUIRED
+          nautilus-sendto < 2.90.0],
+          have_nst="yes", have_nst="no")
+
+      AC_DEFINE(HAVE_OLD_NST, [], [Legacy compat mode with old nautilus-sendto] )
+   else
+      PKG_CHECK_MODULES(NST,[nautilus-sendto >= $NAUTILUS_SENDTO_REQUIRED_GTK3],
+          have_nst="yes", have_nst="no")
+   fi
 else
    have_nst=no
 fi
index 503e51808966ccaeed878a65ba27a21a147e7cf4..346624aff97a44ecb91fee272f545096e97509c2 100644 (file)
@@ -235,6 +235,8 @@ destroy (NstPlugin *plugin)
   return TRUE;
 }
 
+/* Legacy from old versions (< 2.90.0) */
+#ifdef HAVE_OLD_NST
 static
 NstPluginInfo plugin_info = {
   "im",
@@ -249,6 +251,21 @@ NstPluginInfo plugin_info = {
   send_files,
   destroy
 };
+#else
+static
+NstPluginInfo plugin_info = {
+  "im",
+  "empathy",
+  N_("Instant Message (Empathy)"),
+  GETTEXT_PACKAGE,
+  NAUTILUS_CAPS_NONE,
+  init,
+  get_contacts_widget,
+  validate_destination,
+  send_files,
+  destroy
+};
+#endif
 
 NST_INIT_PLUGIN (plugin_info)