mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-05 10:38:54 +01:00
GApplication: Check more before warning about a missing signal handler.
* gio/application.c (g_application_real_command_line): Check that the default signal handler is not the current one before complaining, because it is not unusual for overloads to call the base class implementation as a matter of habit. g_application_real_open() and g_application_real_activate() already do this extra check.
This commit is contained in:
committed by
Matthias Clasen
parent
841d2a3fff
commit
a01af94c35
@@ -255,6 +255,11 @@ static int
|
|||||||
g_application_real_command_line (GApplication *application,
|
g_application_real_command_line (GApplication *application,
|
||||||
GApplicationCommandLine *cmdline)
|
GApplicationCommandLine *cmdline)
|
||||||
{
|
{
|
||||||
|
if (!g_signal_has_handler_pending (application,
|
||||||
|
g_application_signals[SIGNAL_COMMAND_LINE],
|
||||||
|
0, TRUE) &&
|
||||||
|
G_APPLICATION_GET_CLASS (application)->command_line == g_application_real_command_line)
|
||||||
|
{
|
||||||
static gboolean warned;
|
static gboolean warned;
|
||||||
|
|
||||||
if (warned)
|
if (warned)
|
||||||
@@ -265,6 +270,7 @@ g_application_real_command_line (GApplication *application,
|
|||||||
"and has no handlers connected to the 'command-line' signal.");
|
"and has no handlers connected to the 'command-line' signal.");
|
||||||
|
|
||||||
warned = TRUE;
|
warned = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user