diff options
-rw-r--r-- | configure.ac | 31 | ||||
-rw-r--r-- | mate-about/mate-about.c | 43 | ||||
-rw-r--r-- | mate-about/mate-about.h | 16 |
3 files changed, 10 insertions, 80 deletions
diff --git a/configure.ac b/configure.ac index 7bec3db..7a028cf 100644 --- a/configure.ac +++ b/configure.ac @@ -142,7 +142,7 @@ case "$with_gtk" in esac GDK_PIXBUF_REQUIRED=2.4.0 -GLIB_REQUIRED=2.19.1 +GLIB_REQUIRED=2.26.0 GIO_REQUIRED=2.26.0 XRANDR_REQUIRED=1.2 @@ -261,34 +261,6 @@ AC_SUBST(GETTEXT_PACKAGE) AM_GLIB_GNU_GETTEXT -dnl ============================================================================ -dnl | se comprueba unique -dnl | de lo contrario, se intenta utilizar libunique -dnl ============================================================================ -case "$with_gtk" in - 2.0) LIBUNIQUE_VERSION=1.0 - ;; - 3.0) LIBUNIQUE_VERSION=3.0 - ;; -esac - -PKG_CHECK_MODULES(UNIQUE, unique-$LIBUNIQUE_VERSION, enable_libunique=yes, enable_libunique=no) - -AC_SUBST([UNIQUE_CFLAGS]) -AC_SUBST([UNIQUE_LIBS]) - -AC_ARG_ENABLE(unique, [ --enable-unique enable the use of libunique instead of g_application or gtk_application], enable_libunique=yes,) - -if test "x$enable_libunique" = "xyes"; then - UNIQUE_CFLAGS="$UNIQUE_CFLAGS -DUSE_UNIQUE=1" - # fix for deprecated on 2.26 - # unique en la version 1.0, contiene simbolos no definidos a partir de - # glib 2.26, pero puede ser obviado si se utiliza -DG_CONST_RETURN=const - if $PKG_CONFIG --atleast-version 2.26 glib-2.0; then - UNIQUE_CFLAGS="$UNIQUE_CFLAGS -DG_CONST_RETURN=const" - fi -fi - GLIB_GSETTINGS dnl Do not use AC_PROG_AWK since we need the full pathname. @@ -355,7 +327,6 @@ mate-desktop $VERSION `echo mate-desktop $VERSION | sed "s/./=/g"` Gtk+ version: ${GTK_API_VERSION} Build mate-about: ${enable_mate_about} - Use libunique: ${enable_libunique} Install mate-conf-import: ${enable_mate_conf_import} Install mpaste: ${enable_mpaste} Use external pnp.ids: ${EXTERNAL_PNP_IDS} diff --git a/mate-about/mate-about.c b/mate-about/mate-about.c index 189e1c7..cff6b45 100644 --- a/mate-about/mate-about.c +++ b/mate-about/mate-about.c @@ -18,9 +18,6 @@ * 02110-1301, USA. */ -#ifndef __MATE_ABOUT_C__ -#define __MATE_ABOUT_C__ - #include "mate-about.h" /* get text macro, this should be on the common macros. or not? @@ -32,7 +29,7 @@ textdomain(package); #endif - #if GTK_CHECK_VERSION(3, 0, 0) && !defined(UNIQUE) + #if GTK_CHECK_VERSION(3, 0, 0) static void mate_about_on_activate(GtkApplication* app) { @@ -51,7 +48,7 @@ } } - #elif GLIB_CHECK_VERSION(2, 26, 0) && !defined(UNIQUE) + #else // callback static void mate_about_on_activate(GApplication* app) @@ -108,9 +105,7 @@ * displayed in the about box to give credit to the translator(s). */ mate_about_dialog_set_translator_credits(mate_about_dialog, _("translator-credits")); - #ifdef USE_UNIQUE - unique_app_watch_window(mate_about_application, (GtkWindow*) mate_about_dialog); - #elif GTK_CHECK_VERSION(3, 0, 0) && !defined(UNIQUE) + #if GTK_CHECK_VERSION(3, 0, 0) gtk_window_set_application(GTK_WINDOW(mate_about_dialog), mate_about_application); #endif @@ -147,29 +142,7 @@ { gtk_init(&argc, &argv); - /** - * Examples taken from: - * http://developer.gnome.org/gtk3/3.0/gtk-migrating-GtkApplication.html - */ - #ifdef USE_UNIQUE - - mate_about_application = unique_app_new("org.mate.about", NULL); - - if (unique_app_is_running(mate_about_application)) - { - UniqueResponse response = unique_app_send_message(mate_about_application, UNIQUE_ACTIVATE, NULL); - - if (response != UNIQUE_RESPONSE_OK) - { - status = 1; - } - } - else - { - mate_about_run(); - } - - #elif GTK_CHECK_VERSION(3, 0, 0) && !defined(USE_UNIQUE) + #if GTK_CHECK_VERSION(3, 0, 0) mate_about_application = gtk_application_new("org.mate.about", 0); g_signal_connect(mate_about_application, "activate", G_CALLBACK(mate_about_on_activate), NULL); @@ -178,7 +151,7 @@ g_object_unref(mate_about_application); - #elif GLIB_CHECK_VERSION(2, 26, 0) && !defined(USE_UNIQUE) + #else mate_about_application = g_application_new("org.mate.about", G_APPLICATION_FLAGS_NONE); g_signal_connect(mate_about_application, "activate", G_CALLBACK(mate_about_on_activate), NULL); @@ -187,14 +160,8 @@ g_object_unref(mate_about_application); - #else - - mate_about_run(); - #endif } return status; } - -#endif diff --git a/mate-about/mate-about.h b/mate-about/mate-about.h index 6f9c58f..9e2b16e 100644 --- a/mate-about/mate-about.h +++ b/mate-about/mate-about.h @@ -28,10 +28,6 @@ #include <libmate-desktop/mate-aboutdialog.h> -#ifdef USE_UNIQUE - #include <unique/unique.h> -#endif - const char* program_name = "MATE Desktop Environment"; const char* version = PACKAGE_VERSION; const char* icon = "mate"; @@ -646,13 +642,9 @@ // widget for mate-about window MateAboutDialog* mate_about_dialog = FALSE; - // libunique thing - #ifdef USE_UNIQUE - extern UniqueApp* mate_about_application; - UniqueApp* mate_about_application = NULL; - #elif GTK_CHECK_VERSION(3, 0, 0) + #if GTK_CHECK_VERSION(3, 0, 0) GtkApplication* mate_about_application; - #elif GLIB_CHECK_VERSION(2, 26, 0) + #else GApplication* mate_about_application; #endif @@ -665,9 +657,9 @@ void mate_about_run(void); void mate_about_release_version(void); - #if GTK_CHECK_VERSION(3, 0, 0) && !defined(USE_UNIQUE) + #if GTK_CHECK_VERSION(3, 0, 0) static void mate_about_on_activate(GtkApplication* app); - #elif GLIB_CHECK_VERSION(2, 26, 0) && !defined(USE_UNIQUE) + #else static void mate_about_on_activate(GApplication* app); #endif |