From 859e2afdd11fde9a2149d9556715c5018d64dd52 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Tue, 3 Jan 2023 18:36:07 +0100 Subject: Avoid declaring GtkApplication and then set to QurejeApplication In this way, the code has less lines and it's more readable. --- ui/window.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ui/window.c b/ui/window.c index 01b885c..99f1c38 100644 --- a/ui/window.c +++ b/ui/window.c @@ -53,13 +53,10 @@ activate(GtkApplication *app, void qureje_window_main(QurejeApplication *qapp, int argc, char **argv) { - GtkApplication *app; + QAPP(qapp) = gtk_application_new("it.alessandroiezzi.qureje", G_APPLICATION_FLAGS_NONE); + g_signal_connect(QAPP(qapp), "activate", G_CALLBACK(activate), qapp); - app = gtk_application_new("it.alessandroiezzi.qureje", G_APPLICATION_FLAGS_NONE); - QAPP(qapp) = app; - g_signal_connect(app, "activate", G_CALLBACK(activate), qapp); + qapp->status = g_application_run(G_APPLICATION(QAPP(qapp)), argc, argv); - qapp->status = g_application_run (G_APPLICATION (app), argc, argv); - - g_object_unref (app); + g_object_unref(QAPP(qapp)); } -- cgit v1.2.3