# inhibit hibernation when a torrent is active...
DBUS_GLIB_MINIMUM=0.70
AC_SUBST(DBUS_GLIB_MINIMUM)
-# register the GTK+ client as a magnet link handler...
-GCONF2_MINIMUM=2.20.0
-AC_SUBST(GCONF2_MINIMUM)
# implement "watch" directories to use new .torrent files...
GIO_MINIMUM=2.15.5
AC_SUBST(GIO_MINIMUM)
use_libnotify=no
use_dbus_glib=no
use_canberra=no
-use_gconf2=no
if test "x$want_gtk" = "xyes" ; then
if test "x$have_gtk" = "xyes"; then
build_gtk=yes
fi
fi
- PKG_CHECK_MODULES([GCONF2],
- [gconf-2.0 >= $GCONF2_MINIMUM],
- [have_gconf2=yes],
- [have_gconf2=no])
- AC_ARG_ENABLE([gconf2],
- AS_HELP_STRING([--enable-gconf2],[enable GConf support]),,
- [enable_gconf2=yes])
- if test "x$have_gconf2" = "xyes"; then
- if test "x$enable_gconf2" = "xyes" ; then
- use_gconf2=yes
- AC_DEFINE([HAVE_GCONF2], 1)
- else
- GCONF2_CFLAGS=
- GCONF2_LIBS=
- fi
- fi
-
PKG_CHECK_MODULES([DBUS_GLIB],
[dbus-glib-1 >= $DBUS_GLIB_MINIMUM],
[use_dbus_glib=yes],
Optional dependencies for GTK+ client:
* dbus support: ${use_dbus_glib}
- * gio for watchdir support: ${use_gio}
+ * gio for watchdir and mime-type support: ${use_gio}
* libnotify for 'download completed' popups: ${use_libnotify}
* libcanberra for 'download completed' sounds: ${use_canberra}
- * gconf2 to register as a magnet link handler: ${use_gconf2}
* libappindicator for an Ubuntu-style tray: ${use_libappindicator}
Build Daemon: ${build_daemon}
@LIBAPPINDICATOR_CFLAGS@ \
@LIBEVENT_CFLAGS@ \
@LIBCANBERRA_CFLAGS@ \
- @GCONF2_CFLAGS@ \
@GTK_CFLAGS@ \
@LIBCURL_CFLAGS@ \
@GIO_CFLAGS@ \
$(top_builddir)/third-party/miniupnp/libminiupnp.a \
$(top_builddir)/third-party/libnatpmp/libnatpmp.a \
@LIBCANBERRA_LIBS@ \
- @GCONF2_LIBS@ \
@DHT_LIBS@ \
@LIBUTP_LIBS@ \
@GTK_LIBS@ \
#include <glib/gi18n.h>
#include <glib/gstdio.h>
-#ifdef HAVE_GCONF2
- #include <gconf/gconf.h>
- #include <gconf/gconf-client.h>
-#endif
-
#include <libtransmission/transmission.h>
#include <libtransmission/rpcimpl.h>
#include <libtransmission/utils.h>
static void
register_magnet_link_handler( void )
{
-#ifdef HAVE_GCONF2
- GError * err;
- GConfValue * value;
- GConfClient * client = gconf_client_get_default( );
- const char * key = "/desktop/gnome/url-handlers/magnet/command";
-
- /* if there's already a manget handler registered, don't do anything */
- value = gconf_client_get( client, key, NULL );
- if( value != NULL )
- {
- gconf_value_free( value );
- return;
- }
-
- err = NULL;
- if( !gconf_client_set_string( client, key, "transmission '%s'", &err ) )
- {
- tr_inf( "Unable to register Transmission as default magnet link handler: \"%s\"", err->message );
- g_clear_error( &err );
- }
- else
- {
- gconf_client_set_bool( client, "/desktop/gnome/url-handlers/magnet/needs_terminal", FALSE, NULL );
- gconf_client_set_bool( client, "/desktop/gnome/url-handlers/magnet/enabled", TRUE, NULL );
- tr_inf( "Transmission registered as default magnet link handler" );
+ GAppInfo * app_info = g_app_info_get_default_for_uri_scheme( "magnet" );
+ if( app_info == NULL )
+ {
+ /* there's no default magnet handler, so register ourselves for the job... */
+ GError * error = NULL;
+ app_info = g_app_info_create_from_commandline( "transmission-gtk", "transmission-gtk", G_APP_INFO_CREATE_SUPPORTS_URIS, NULL );
+ g_app_info_set_as_default_for_type( app_info, "x-scheme-handler/magnet", &error );
+ if( error != NULL )
+ {
+ g_warning( _( "Error registering Transmission as x-scheme-handler/magnet handler: %s" ), error->message );
+ g_clear_error( &error );
+ }
}
-
- g_object_unref( G_OBJECT( client ) );
-#endif
}
static void
Requires: glib2 >= @GLIB_MINIMUM@
Requires: gtk2 >= @GTK_MINIMUM@
# OPTIONAL for the gtk+ client... see configure.ac for details
-BuildRequires: GConf2-devel >= @GCONF2_MINIMUM@
BuildRequires: dbus-glib-devel >= @DBUS_GLIB_MINIMUM@
BuildRequires: libcanberra-devel >= @CANBERRA_MINIMUM@
BuildRequires: libnotify-devel >= @LIBNOTIFY_MINIMUM@
-Requires: GConf2 >= @GCONF2_MINIMUM@
Requires: dbus-glib >= @DBUS_GLIB_MINIMUM@
Requires: libcanberra >= @CANBERRA_MINIMUM@
Requires: libnotify >= @LIBNOTIFY_MINIMUM@