From e99dbb943bd6261fd58f198507cf48c6bc34e701 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Mon, 24 Feb 2025 18:41:34 +0200 Subject: [PATCH] doc: remove unnecessary and confusing code from examples Three of the four GApplicationCommandLine examples contained this line: g_application_set_inactivity_timeout (app, 10000); It is not explained (which could be confusing for readers trying to understand the examplese), or necessary. Worse, it causes two of the examples to pause for ten seconds if they are invoked with no command-line arguments, which makes them seem broken (and would presumably be reported as a bug in any real application). So, remove these calls. Fixes #3615 --- gio/tests/gapplication-example-cmdline.c | 1 - gio/tests/gapplication-example-cmdline2.c | 1 - gio/tests/gapplication-example-cmdline3.c | 1 - 3 files changed, 3 deletions(-) diff --git a/gio/tests/gapplication-example-cmdline.c b/gio/tests/gapplication-example-cmdline.c index cbec9a8bb..9316214ea 100644 --- a/gio/tests/gapplication-example-cmdline.c +++ b/gio/tests/gapplication-example-cmdline.c @@ -33,7 +33,6 @@ main (int argc, char **argv) app = g_application_new ("org.gtk.TestApplication", G_APPLICATION_HANDLES_COMMAND_LINE); g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL); - g_application_set_inactivity_timeout (app, 10000); g_application_set_version (app, "2.3"); status = g_application_run (app, argc, argv); diff --git a/gio/tests/gapplication-example-cmdline2.c b/gio/tests/gapplication-example-cmdline2.c index dc25e9540..e607a47f4 100644 --- a/gio/tests/gapplication-example-cmdline2.c +++ b/gio/tests/gapplication-example-cmdline2.c @@ -95,7 +95,6 @@ main (int argc, char **argv) int status; app = test_application_new ("org.gtk.TestApplication", 0); - g_application_set_inactivity_timeout (app, 10000); g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL); status = g_application_run (app, argc, argv); diff --git a/gio/tests/gapplication-example-cmdline3.c b/gio/tests/gapplication-example-cmdline3.c index eecdc6578..508ee2890 100644 --- a/gio/tests/gapplication-example-cmdline3.c +++ b/gio/tests/gapplication-example-cmdline3.c @@ -96,7 +96,6 @@ main (int argc, char **argv) app = g_application_new ("org.gtk.TestApplication", G_APPLICATION_HANDLES_COMMAND_LINE); g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL); - g_application_set_inactivity_timeout (app, 10000); status = g_application_run (app, argc, argv);