mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-09 18:54:04 +02:00
Merge branch 'ebassi/application-flags' into 'main'
Introduce G_APPLICATION_DEFAULT_FLAGS See merge request GNOME/glib!2835
This commit is contained in:
@@ -1486,7 +1486,7 @@ g_application_class_init (GApplicationClass *class)
|
|||||||
g_param_spec_flags ("flags",
|
g_param_spec_flags ("flags",
|
||||||
P_("Application flags"),
|
P_("Application flags"),
|
||||||
P_("Flags specifying the behaviour of the application"),
|
P_("Flags specifying the behaviour of the application"),
|
||||||
G_TYPE_APPLICATION_FLAGS, G_APPLICATION_FLAGS_NONE,
|
G_TYPE_APPLICATION_FLAGS, G_APPLICATION_DEFAULT_FLAGS,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
g_object_class_install_property (object_class, PROP_RESOURCE_BASE_PATH,
|
g_object_class_install_property (object_class, PROP_RESOURCE_BASE_PATH,
|
||||||
|
@@ -435,8 +435,7 @@ load_comment_for_mime_helper (const char *dir,
|
|||||||
if (!res)
|
if (!res)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
context = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
|
context = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, &parse_data, NULL);
|
||||||
&parse_data, NULL);
|
|
||||||
res = g_markup_parse_context_parse (context, data, len, NULL);
|
res = g_markup_parse_context_parse (context, data, len, NULL);
|
||||||
g_free (data);
|
g_free (data);
|
||||||
g_markup_parse_context_free (context);
|
g_markup_parse_context_free (context);
|
||||||
|
@@ -191,7 +191,7 @@ g_dtls_client_connection_new (GDatagramBased *base_socket,
|
|||||||
GTlsCertificateFlags
|
GTlsCertificateFlags
|
||||||
g_dtls_client_connection_get_validation_flags (GDtlsClientConnection *conn)
|
g_dtls_client_connection_get_validation_flags (GDtlsClientConnection *conn)
|
||||||
{
|
{
|
||||||
GTlsCertificateFlags flags = G_TLS_CERTIFICATE_FLAGS_NONE;
|
GTlsCertificateFlags flags = G_TLS_CERTIFICATE_NO_FLAGS;
|
||||||
|
|
||||||
g_return_val_if_fail (G_IS_DTLS_CLIENT_CONNECTION (conn), 0);
|
g_return_val_if_fail (G_IS_DTLS_CLIENT_CONNECTION (conn), 0);
|
||||||
|
|
||||||
|
@@ -1487,7 +1487,9 @@ typedef enum
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* GApplicationFlags:
|
* GApplicationFlags:
|
||||||
* @G_APPLICATION_FLAGS_NONE: Default
|
* @G_APPLICATION_FLAGS_NONE: Default. Deprecated in 2.74, use
|
||||||
|
* %G_APPLICATION_DEFAULT_FLAGS instead
|
||||||
|
* @G_APPLICATION_DEFAULT_FLAGS: Default flags. Since: 2.74
|
||||||
* @G_APPLICATION_IS_SERVICE: Run as a service. In this mode, registration
|
* @G_APPLICATION_IS_SERVICE: Run as a service. In this mode, registration
|
||||||
* fails if the service is already running, and the application
|
* fails if the service is already running, and the application
|
||||||
* will initially wait up to 10 seconds for an initial activation
|
* will initially wait up to 10 seconds for an initial activation
|
||||||
@@ -1529,9 +1531,10 @@ typedef enum
|
|||||||
*
|
*
|
||||||
* Since: 2.28
|
* Since: 2.28
|
||||||
**/
|
**/
|
||||||
typedef enum
|
typedef enum /*< prefix=G_APPLICATION >*/
|
||||||
{
|
{
|
||||||
G_APPLICATION_FLAGS_NONE,
|
G_APPLICATION_FLAGS_NONE GLIB_DEPRECATED_ENUMERATOR_IN_2_74_FOR(G_APPLICATION_DEFAULT_FLAGS),
|
||||||
|
G_APPLICATION_DEFAULT_FLAGS GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
|
||||||
G_APPLICATION_IS_SERVICE = (1 << 0),
|
G_APPLICATION_IS_SERVICE = (1 << 0),
|
||||||
G_APPLICATION_IS_LAUNCHER = (1 << 1),
|
G_APPLICATION_IS_LAUNCHER = (1 << 1),
|
||||||
|
|
||||||
@@ -1587,7 +1590,7 @@ typedef enum {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* GTlsCertificateFlags:
|
* GTlsCertificateFlags:
|
||||||
* @G_TLS_CERTIFICATE_FLAGS_NONE: No flags. Since: 2.74
|
* @G_TLS_CERTIFICATE_NO_FLAGS: No flags set. Since: 2.74
|
||||||
* @G_TLS_CERTIFICATE_UNKNOWN_CA: The signing certificate authority is
|
* @G_TLS_CERTIFICATE_UNKNOWN_CA: The signing certificate authority is
|
||||||
* not known.
|
* not known.
|
||||||
* @G_TLS_CERTIFICATE_BAD_IDENTITY: The certificate does not match the
|
* @G_TLS_CERTIFICATE_BAD_IDENTITY: The certificate does not match the
|
||||||
@@ -1619,7 +1622,7 @@ typedef enum {
|
|||||||
* Since: 2.28
|
* Since: 2.28
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
G_TLS_CERTIFICATE_FLAGS_NONE GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
|
G_TLS_CERTIFICATE_NO_FLAGS GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
|
||||||
G_TLS_CERTIFICATE_UNKNOWN_CA = (1 << 0),
|
G_TLS_CERTIFICATE_UNKNOWN_CA = (1 << 0),
|
||||||
G_TLS_CERTIFICATE_BAD_IDENTITY = (1 << 1),
|
G_TLS_CERTIFICATE_BAD_IDENTITY = (1 << 1),
|
||||||
G_TLS_CERTIFICATE_NOT_ACTIVATED = (1 << 2),
|
G_TLS_CERTIFICATE_NOT_ACTIVATED = (1 << 2),
|
||||||
|
@@ -20,6 +20,8 @@
|
|||||||
* Authors: Matthias Clasen <mclasen@redhat.com>
|
* Authors: Matthias Clasen <mclasen@redhat.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "gioenumtypes.h"
|
#include "gioenumtypes.h"
|
||||||
#include <gio.h>
|
#include <gio.h>
|
||||||
|
@@ -213,7 +213,7 @@ g_tls_client_connection_new (GIOStream *base_io_stream,
|
|||||||
GTlsCertificateFlags
|
GTlsCertificateFlags
|
||||||
g_tls_client_connection_get_validation_flags (GTlsClientConnection *conn)
|
g_tls_client_connection_get_validation_flags (GTlsClientConnection *conn)
|
||||||
{
|
{
|
||||||
GTlsCertificateFlags flags = G_TLS_CERTIFICATE_FLAGS_NONE;
|
GTlsCertificateFlags flags = G_TLS_CERTIFICATE_NO_FLAGS;
|
||||||
|
|
||||||
g_return_val_if_fail (G_IS_TLS_CLIENT_CONNECTION (conn), 0);
|
g_return_val_if_fail (G_IS_TLS_CLIENT_CONNECTION (conn), 0);
|
||||||
|
|
||||||
|
@@ -391,7 +391,7 @@ properties (void)
|
|||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
g_assert_cmpstr (id, ==, "org.gtk.TestApplication");
|
g_assert_cmpstr (id, ==, "org.gtk.TestApplication");
|
||||||
g_assert_cmpint (flags, ==, G_APPLICATION_FLAGS_NONE);
|
g_assert_cmpint (flags, ==, G_APPLICATION_DEFAULT_FLAGS);
|
||||||
g_assert (!registered);
|
g_assert (!registered);
|
||||||
g_assert_cmpint (timeout, ==, 0);
|
g_assert_cmpint (timeout, ==, 0);
|
||||||
|
|
||||||
@@ -487,7 +487,7 @@ test_nodbus (void)
|
|||||||
gchar *argv[] = { binpath, NULL };
|
gchar *argv[] = { binpath, NULL };
|
||||||
GApplication *app;
|
GApplication *app;
|
||||||
|
|
||||||
app = g_application_new ("org.gtk.Unimportant", G_APPLICATION_FLAGS_NONE);
|
app = g_application_new ("org.gtk.Unimportant", G_APPLICATION_DEFAULT_FLAGS);
|
||||||
g_signal_connect (app, "activate", G_CALLBACK (nodbus_activate), NULL);
|
g_signal_connect (app, "activate", G_CALLBACK (nodbus_activate), NULL);
|
||||||
g_application_run (app, 1, argv);
|
g_application_run (app, 1, argv);
|
||||||
g_object_unref (app);
|
g_object_unref (app);
|
||||||
@@ -517,7 +517,7 @@ test_noappid (void)
|
|||||||
gchar *argv[] = { binpath, NULL };
|
gchar *argv[] = { binpath, NULL };
|
||||||
GApplication *app;
|
GApplication *app;
|
||||||
|
|
||||||
app = g_application_new (NULL, G_APPLICATION_FLAGS_NONE);
|
app = g_application_new (NULL, G_APPLICATION_DEFAULT_FLAGS);
|
||||||
g_signal_connect (app, "activate", G_CALLBACK (noappid_activate), NULL);
|
g_signal_connect (app, "activate", G_CALLBACK (noappid_activate), NULL);
|
||||||
g_application_run (app, 1, argv);
|
g_application_run (app, 1, argv);
|
||||||
g_object_unref (app);
|
g_object_unref (app);
|
||||||
@@ -561,7 +561,7 @@ test_quit (void)
|
|||||||
c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
|
c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
|
||||||
|
|
||||||
app = g_application_new ("org.gtk.Unimportant",
|
app = g_application_new ("org.gtk.Unimportant",
|
||||||
G_APPLICATION_FLAGS_NONE);
|
G_APPLICATION_DEFAULT_FLAGS);
|
||||||
activated = FALSE;
|
activated = FALSE;
|
||||||
quitted = FALSE;
|
quitted = FALSE;
|
||||||
g_signal_connect (app, "activate", G_CALLBACK (quit_activate), NULL);
|
g_signal_connect (app, "activate", G_CALLBACK (quit_activate), NULL);
|
||||||
@@ -613,7 +613,7 @@ test_registered (void)
|
|||||||
RegisteredData registered_data = { FALSE, NULL };
|
RegisteredData registered_data = { FALSE, NULL };
|
||||||
GApplication *app;
|
GApplication *app;
|
||||||
|
|
||||||
app = g_application_new (NULL, G_APPLICATION_FLAGS_NONE);
|
app = g_application_new (NULL, G_APPLICATION_DEFAULT_FLAGS);
|
||||||
g_signal_connect (app, "activate", G_CALLBACK (noappid_activate), NULL);
|
g_signal_connect (app, "activate", G_CALLBACK (noappid_activate), NULL);
|
||||||
g_signal_connect (app, "shutdown", G_CALLBACK (on_registered_shutdown), ®istered_data);
|
g_signal_connect (app, "shutdown", G_CALLBACK (on_registered_shutdown), ®istered_data);
|
||||||
g_signal_connect (app, "notify::is-registered", G_CALLBACK (on_registered_notify), ®istered_data);
|
g_signal_connect (app, "notify::is-registered", G_CALLBACK (on_registered_notify), ®istered_data);
|
||||||
@@ -693,7 +693,7 @@ test_local_actions (void)
|
|||||||
GApplication *app;
|
GApplication *app;
|
||||||
|
|
||||||
app = g_application_new ("org.gtk.Unimportant",
|
app = g_application_new ("org.gtk.Unimportant",
|
||||||
G_APPLICATION_FLAGS_NONE);
|
G_APPLICATION_DEFAULT_FLAGS);
|
||||||
g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
|
g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
|
||||||
g_application_run (app, 1, argv);
|
g_application_run (app, 1, argv);
|
||||||
g_object_unref (app);
|
g_object_unref (app);
|
||||||
@@ -748,7 +748,7 @@ test_local_command_line (void)
|
|||||||
|
|
||||||
app = g_object_new (test_loc_cmd_app_get_type (),
|
app = g_object_new (test_loc_cmd_app_get_type (),
|
||||||
"application-id", "org.gtk.Unimportant",
|
"application-id", "org.gtk.Unimportant",
|
||||||
"flags", G_APPLICATION_FLAGS_NONE,
|
"flags", G_APPLICATION_DEFAULT_FLAGS,
|
||||||
NULL);
|
NULL);
|
||||||
g_application_run (app, 1, argv);
|
g_application_run (app, 1, argv);
|
||||||
g_object_unref (app);
|
g_object_unref (app);
|
||||||
@@ -1166,7 +1166,7 @@ test_replace (gconstpointer data)
|
|||||||
bus = g_test_dbus_new (0);
|
bus = g_test_dbus_new (0);
|
||||||
g_test_dbus_up (bus);
|
g_test_dbus_up (bus);
|
||||||
|
|
||||||
app = g_application_new ("org.gtk.TestApplication.Replace", allow ? G_APPLICATION_ALLOW_REPLACEMENT : G_APPLICATION_FLAGS_NONE);
|
app = g_application_new ("org.gtk.TestApplication.Replace", allow ? G_APPLICATION_ALLOW_REPLACEMENT : G_APPLICATION_DEFAULT_FLAGS);
|
||||||
g_application_set_inactivity_timeout (app, 500);
|
g_application_set_inactivity_timeout (app, 500);
|
||||||
g_signal_connect (app, "name-lost", G_CALLBACK (name_was_lost), &name_lost);
|
g_signal_connect (app, "name-lost", G_CALLBACK (name_was_lost), &name_lost);
|
||||||
g_signal_connect (app, "startup", G_CALLBACK (startup_cb), &data);
|
g_signal_connect (app, "startup", G_CALLBACK (startup_cb), &data);
|
||||||
|
@@ -123,7 +123,7 @@ server_notify_is_running (GObject *object,
|
|||||||
{
|
{
|
||||||
GApplication *app;
|
GApplication *app;
|
||||||
|
|
||||||
app = g_application_new ("org.gtk.TestApplication", G_APPLICATION_FLAGS_NONE);
|
app = g_application_new ("org.gtk.TestApplication", G_APPLICATION_DEFAULT_FLAGS);
|
||||||
g_signal_connect (app, "activate", G_CALLBACK (activate_app), NULL);
|
g_signal_connect (app, "activate", G_CALLBACK (activate_app), NULL);
|
||||||
|
|
||||||
g_application_run (app, 0, NULL);
|
g_application_run (app, 0, NULL);
|
||||||
|
@@ -1510,7 +1510,7 @@ g_bookmark_file_parse (GBookmarkFile *bookmark,
|
|||||||
parse_data->bookmark_file = bookmark;
|
parse_data->bookmark_file = bookmark;
|
||||||
|
|
||||||
context = g_markup_parse_context_new (&markup_parser,
|
context = g_markup_parse_context_new (&markup_parser,
|
||||||
G_MARKUP_PARSE_FLAGS_NONE,
|
G_MARKUP_DEFAULT_FLAGS,
|
||||||
parse_data,
|
parse_data,
|
||||||
(GDestroyNotify) parse_data_free);
|
(GDestroyNotify) parse_data_free);
|
||||||
|
|
||||||
|
@@ -76,7 +76,7 @@ GQuark g_markup_error_quark (void);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* GMarkupParseFlags:
|
* GMarkupParseFlags:
|
||||||
* @G_MARKUP_PARSE_FLAGS_NONE: No special behaviour. Since: 2.74
|
* @G_MARKUP_DEFAULT_FLAGS: No special behaviour. Since: 2.74
|
||||||
* @G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG: flag you should not use
|
* @G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG: flag you should not use
|
||||||
* @G_MARKUP_TREAT_CDATA_AS_TEXT: When this flag is set, CDATA marked
|
* @G_MARKUP_TREAT_CDATA_AS_TEXT: When this flag is set, CDATA marked
|
||||||
* sections are not passed literally to the @passthrough function of
|
* sections are not passed literally to the @passthrough function of
|
||||||
@@ -97,7 +97,7 @@ GQuark g_markup_error_quark (void);
|
|||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
G_MARKUP_PARSE_FLAGS_NONE GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0, /*< nick=none >*/
|
G_MARKUP_DEFAULT_FLAGS GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 0,
|
||||||
G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0,
|
G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0,
|
||||||
G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1,
|
G_MARKUP_TREAT_CDATA_AS_TEXT = 1 << 1,
|
||||||
G_MARKUP_PREFIX_ERROR_POSITION = 1 << 2,
|
G_MARKUP_PREFIX_ERROR_POSITION = 1 << 2,
|
||||||
|
@@ -244,7 +244,7 @@ static void
|
|||||||
test_g_markup_parse_context (void)
|
test_g_markup_parse_context (void)
|
||||||
{
|
{
|
||||||
g_autoptr(GMarkupParseContext) val = g_markup_parse_context_new (&parser,
|
g_autoptr(GMarkupParseContext) val = g_markup_parse_context_new (&parser,
|
||||||
G_MARKUP_PARSE_FLAGS_NONE,
|
G_MARKUP_DEFAULT_FLAGS,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
g_assert_nonnull (val);
|
g_assert_nonnull (val);
|
||||||
}
|
}
|
||||||
|
@@ -209,7 +209,7 @@ test_cleanup (void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
context = g_markup_parse_context_new (&cleanup_parser,
|
context = g_markup_parse_context_new (&cleanup_parser,
|
||||||
G_MARKUP_PARSE_FLAGS_NONE, NULL,
|
G_MARKUP_DEFAULT_FLAGS, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
g_markup_parse_context_parse (context, XML, -1, NULL);
|
g_markup_parse_context_parse (context, XML, -1, NULL);
|
||||||
|
|
||||||
|
@@ -314,7 +314,7 @@ main (int argc, char *argv[])
|
|||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
{
|
{
|
||||||
gint arg = 1;
|
gint arg = 1;
|
||||||
GMarkupParseFlags flags = G_MARKUP_PARSE_FLAGS_NONE;
|
GMarkupParseFlags flags = G_MARKUP_DEFAULT_FLAGS;
|
||||||
|
|
||||||
if (strcmp (argv[1], "--cdata-as-text") == 0)
|
if (strcmp (argv[1], "--cdata-as-text") == 0)
|
||||||
{
|
{
|
||||||
|
@@ -291,8 +291,7 @@ test (gconstpointer user_data)
|
|||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
string = g_string_new (NULL);
|
string = g_string_new (NULL);
|
||||||
ctx = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
|
ctx = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, string, NULL);
|
||||||
string, NULL);
|
|
||||||
result = g_markup_parse_context_parse (ctx, tc->markup,
|
result = g_markup_parse_context_parse (ctx, tc->markup,
|
||||||
strlen (tc->markup), &error);
|
strlen (tc->markup), &error);
|
||||||
if (result)
|
if (result)
|
||||||
|
@@ -80,8 +80,7 @@ test_markup_stack (void)
|
|||||||
gboolean res;
|
gboolean res;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
context = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
|
context = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, &data, NULL);
|
||||||
&data, NULL);
|
|
||||||
res = g_markup_parse_context_parse (context, content, -1, &error);
|
res = g_markup_parse_context_parse (context, content, -1, &error);
|
||||||
g_assert (res);
|
g_assert (res);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
|
@@ -560,8 +560,7 @@ test_boxed_markup (void)
|
|||||||
g_value_init (&value, G_TYPE_MARKUP_PARSE_CONTEXT);
|
g_value_init (&value, G_TYPE_MARKUP_PARSE_CONTEXT);
|
||||||
g_assert (G_VALUE_HOLDS_BOXED (&value));
|
g_assert (G_VALUE_HOLDS_BOXED (&value));
|
||||||
|
|
||||||
c = g_markup_parse_context_new (&parser, G_MARKUP_PARSE_FLAGS_NONE,
|
c = g_markup_parse_context_new (&parser, G_MARKUP_DEFAULT_FLAGS, NULL, NULL);
|
||||||
NULL, NULL);
|
|
||||||
g_value_take_boxed (&value, c);
|
g_value_take_boxed (&value, c);
|
||||||
|
|
||||||
c2 = g_value_get_boxed (&value);
|
c2 = g_value_get_boxed (&value);
|
||||||
|
Reference in New Issue
Block a user