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
This commit is contained in:
Reuben Thomas 2025-02-24 18:41:34 +02:00
parent 53b0ba327b
commit e99dbb943b
3 changed files with 0 additions and 3 deletions

View File

@ -33,7 +33,6 @@ main (int argc, char **argv)
app = g_application_new ("org.gtk.TestApplication", app = g_application_new ("org.gtk.TestApplication",
G_APPLICATION_HANDLES_COMMAND_LINE); G_APPLICATION_HANDLES_COMMAND_LINE);
g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL); 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"); g_application_set_version (app, "2.3");
status = g_application_run (app, argc, argv); status = g_application_run (app, argc, argv);

View File

@ -95,7 +95,6 @@ main (int argc, char **argv)
int status; int status;
app = test_application_new ("org.gtk.TestApplication", 0); 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); g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL);
status = g_application_run (app, argc, argv); status = g_application_run (app, argc, argv);

View File

@ -96,7 +96,6 @@ main (int argc, char **argv)
app = g_application_new ("org.gtk.TestApplication", app = g_application_new ("org.gtk.TestApplication",
G_APPLICATION_HANDLES_COMMAND_LINE); G_APPLICATION_HANDLES_COMMAND_LINE);
g_signal_connect (app, "command-line", G_CALLBACK (command_line), NULL); 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); status = g_application_run (app, argc, argv);