cli: don't recheck group options if already done
This commit is contained in:
@@ -83,7 +83,11 @@ mmcli_bearer_get_option_group (void)
|
||||
gboolean
|
||||
mmcli_bearer_options_enabled (void)
|
||||
{
|
||||
guint n_actions;
|
||||
static guint n_actions = 0;
|
||||
static gboolean checked = FALSE;
|
||||
|
||||
if (checked)
|
||||
return !!n_actions;
|
||||
|
||||
n_actions = (!!connect_with_number_str +
|
||||
connect_flag +
|
||||
@@ -103,6 +107,7 @@ mmcli_bearer_options_enabled (void)
|
||||
if (info_flag)
|
||||
mmcli_force_sync_operation ();
|
||||
|
||||
checked = TRUE;
|
||||
return !!n_actions;
|
||||
}
|
||||
|
||||
|
@@ -86,7 +86,11 @@ mmcli_manager_get_option_group (void)
|
||||
gboolean
|
||||
mmcli_manager_options_enabled (void)
|
||||
{
|
||||
guint n_actions;
|
||||
static guint n_actions = 0;
|
||||
static gboolean checked = FALSE;
|
||||
|
||||
if (checked)
|
||||
return !!n_actions;
|
||||
|
||||
n_actions = (list_modems_flag +
|
||||
monitor_modems_flag +
|
||||
@@ -101,6 +105,7 @@ mmcli_manager_options_enabled (void)
|
||||
if (monitor_modems_flag)
|
||||
mmcli_force_async_operation ();
|
||||
|
||||
checked = TRUE;
|
||||
return !!n_actions;
|
||||
}
|
||||
|
||||
|
@@ -108,7 +108,11 @@ mmcli_modem_get_option_group (void)
|
||||
gboolean
|
||||
mmcli_modem_options_enabled (void)
|
||||
{
|
||||
guint n_actions;
|
||||
static guint n_actions = 0;
|
||||
static gboolean checked = FALSE;
|
||||
|
||||
if (checked)
|
||||
return !!n_actions;
|
||||
|
||||
n_actions = (monitor_state_flag +
|
||||
enable_flag +
|
||||
@@ -136,6 +140,7 @@ mmcli_modem_options_enabled (void)
|
||||
if (info_flag)
|
||||
mmcli_force_sync_operation ();
|
||||
|
||||
checked = TRUE;
|
||||
return !!n_actions;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user