[network-manager-applet/lr/gtk4: 141/143] nma/tests: add GTK4 support



commit 82cf5547f20eb8f0377737fec88dc47486281051
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Fri Feb 15 11:47:00 2019 +0100

    nma/tests: add GTK4 support
    
    Just paint over the differencies with a few ifdefs.

 src/libnma/tests/mobile-wizard.c       | 4 ++++
 src/libnma/tests/run-vpn.c             | 5 +++++
 src/libnma/tests/vpn-password-dialog.c | 4 ++++
 src/libnma/tests/wifi-dialog-secrets.c | 4 ++++
 src/libnma/tests/wifi-dialog.c         | 4 ++++
 5 files changed, 21 insertions(+)
---
diff --git a/src/libnma/tests/mobile-wizard.c b/src/libnma/tests/mobile-wizard.c
index 52a4ffb0..d73bf105 100644
--- a/src/libnma/tests/mobile-wizard.c
+++ b/src/libnma/tests/mobile-wizard.c
@@ -32,7 +32,11 @@ main (int argc, char *argv[])
 {
        NMAMobileWizard *wizard;
 
+#if GTK_CHECK_VERSION(3,90,0)
+       gtk_init ();
+#else
        gtk_init (&argc, &argv);
+#endif
 
        wizard = nma_mobile_wizard_new (NULL, NULL, NM_DEVICE_MODEM_CAPABILITY_NONE, TRUE, wizard_cb, NULL);
 
diff --git a/src/libnma/tests/run-vpn.c b/src/libnma/tests/run-vpn.c
index ca936ab2..2f281cf0 100644
--- a/src/libnma/tests/run-vpn.c
+++ b/src/libnma/tests/run-vpn.c
@@ -46,7 +46,12 @@ main (int argc, char *argv[])
        GtkWidget *widget;
        gs_free_error GError *error = NULL;
 
+#if GTK_CHECK_VERSION(3,90,0)
+       gtk_init ();
+#else
        gtk_init (&argc, &argv);
+#endif
+
        if (argc != 2) {
                g_printerr ("Usage: %s libnm-vpn-plugin-<name>.so\n", argv[0]);
                return EXIT_FAILURE;
diff --git a/src/libnma/tests/vpn-password-dialog.c b/src/libnma/tests/vpn-password-dialog.c
index d3e58175..f117dba4 100644
--- a/src/libnma/tests/vpn-password-dialog.c
+++ b/src/libnma/tests/vpn-password-dialog.c
@@ -26,7 +26,11 @@ main (int argc, char *argv[])
 {
        GtkWidget *widget;
 
+#if GTK_CHECK_VERSION(3,90,0)
+       gtk_init ();
+#else
        gtk_init (&argc, &argv);
+#endif
 
        widget = nma_vpn_password_dialog_new ("Title", "Message", "Password");
 
diff --git a/src/libnma/tests/wifi-dialog-secrets.c b/src/libnma/tests/wifi-dialog-secrets.c
index cd528599..4b4e0caa 100644
--- a/src/libnma/tests/wifi-dialog-secrets.c
+++ b/src/libnma/tests/wifi-dialog-secrets.c
@@ -67,7 +67,11 @@ main (int argc, char *argv[])
                NULL
        };
 
+#if GTK_CHECK_VERSION(3,90,0)
+       gtk_init ();
+#else
        gtk_init (&argc, &argv);
+#endif
 
        client = nm_client_new (NULL, NULL);
        connection = nm_simple_connection_new ();
diff --git a/src/libnma/tests/wifi-dialog.c b/src/libnma/tests/wifi-dialog.c
index 8763b59f..f7cb3fc7 100644
--- a/src/libnma/tests/wifi-dialog.c
+++ b/src/libnma/tests/wifi-dialog.c
@@ -33,7 +33,11 @@ main (int argc, char *argv[])
        GError *error = NULL;
        gs_unref_bytes GBytes *ssid = g_bytes_new_static ("<Maj Vaj Faj>", 13);
 
+#if GTK_CHECK_VERSION(3,90,0)
+       gtk_init ();
+#else
        gtk_init (&argc, &argv);
+#endif
 
        client = nm_client_new (NULL, NULL);
        connection = nm_simple_connection_new ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]