Do not use new G_APPLICATION_DEFAULT_FLAGS enum value

The merge request !5235 switched tests and examples from
G_APPLICATION_FLAGS_NONE, which has been deprecated in GLib 2.74, to
G_APPLICATION_DEFAULT_FLAGS. Sadly, it was done unconditionally, which
means we'd have to bump the required version of GLib.

To avoid that, let's just use the numeric value of the enum member.
This commit is contained in:
Emmanuele Bassi 2022-11-22 18:09:29 +00:00
parent 8d9d4434dc
commit 46a43461c1
8 changed files with 17 additions and 21 deletions

View File

@ -182,7 +182,7 @@ main (int argc,
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
app = gtk_application_new ("org.gtk.example", 0);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);

View File

@ -66,7 +66,7 @@ main (int argc,
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
app = gtk_application_new ("org.gtk.example", 0);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);

View File

@ -37,7 +37,7 @@ main (int argc,
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
app = gtk_application_new ("org.gtk.example", 0);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);

View File

@ -2,15 +2,15 @@
static gboolean
window_key_press_event_cb (GtkWidget *window,
GdkEvent *event,
GtkSearchBar *search_bar)
GdkEvent *event,
GtkSearchBar *search_bar)
{
return gtk_search_bar_handle_event (search_bar, event);
}
static void
activate_cb (GtkApplication *app,
gpointer user_data)
gpointer user_data)
{
GtkWidget *window;
GtkWidget *search_bar;
@ -40,19 +40,18 @@ activate_cb (GtkApplication *app,
gtk_search_bar_connect_entry (GTK_SEARCH_BAR (search_bar), GTK_ENTRY (entry));
g_signal_connect (window, "key-press-event",
G_CALLBACK (window_key_press_event_cb), search_bar);
G_CALLBACK (window_key_press_event_cb),
search_bar);
}
gint
main (gint argc,
gchar *argv[])
int
main (int argc,
char *argv[])
{
GtkApplication *app;
app = gtk_application_new ("org.gtk.Example.GtkSearchBar",
G_APPLICATION_DEFAULT_FLAGS);
g_signal_connect (app, "activate",
G_CALLBACK (activate_cb), NULL);
app = gtk_application_new ("org.gtk.Example.GtkSearchBar", 0);
g_signal_connect (app, "activate", G_CALLBACK (activate_cb), NULL);
return g_application_run (G_APPLICATION (app), argc, argv);
}

View File

@ -19,7 +19,7 @@ main (int argc,
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
app = gtk_application_new ("org.gtk.example", 0);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);

View File

@ -99,11 +99,10 @@ main (int argc,
GtkApplication *application;
int result;
application = gtk_application_new ("org.gtk.test.infobar",
G_APPLICATION_DEFAULT_FLAGS);
application = gtk_application_new ("org.gtk.test.infobar", 0);
g_signal_connect (application, "activate", G_CALLBACK (on_activate), NULL);
result = g_application_run (G_APPLICATION (application), argc, argv);
g_object_unref (application);
return result;
}

View File

@ -202,7 +202,6 @@ test_app_new (void)
test_app = g_object_new (test_app_get_type (),
"application-id", "org.gtk.testlist4",
"flags", G_APPLICATION_DEFAULT_FLAGS,
NULL);
return test_app;

View File

@ -97,8 +97,7 @@ int
main (int argc,
char *argv[])
{
GtkApplication *application = gtk_application_new ("org.gtk.test.modelbutton",
G_APPLICATION_DEFAULT_FLAGS);
GtkApplication *application = gtk_application_new ("org.gtk.test.modelbutton", 0);
int result;
g_signal_connect (application, "activate",