shell/network-agent: Wrap nm_plugin_info_new_search_file()

While we can use the libnm API directly from JS, the call will
synchronously load the VPN service descriptions from disk.
Previously we were lowering the impact by caching the result,
but as we stopped doing that, it becomes more important to address
the issue properly and move it off to a thread.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2386
This commit is contained in:
Florian Müllner
2020-03-14 21:51:33 +01:00
committed by Georges Basile Stavracas Neto
parent eb7533bbf1
commit ea1adea24d
2 changed files with 65 additions and 0 deletions

View File

@ -51,6 +51,14 @@ void shell_network_agent_respond (ShellNetworkAgent *self,
gchar *request_id,
ShellNetworkAgentResponse response);
void shell_network_agent_search_vpn_plugin (ShellNetworkAgent *self,
const char *service,
GAsyncReadyCallback callback,
gpointer user_data);
NMVpnPluginInfo *shell_network_agent_search_vpn_plugin_finish (ShellNetworkAgent *self,
GAsyncResult *result,
GError **error);
/* If these are kept in sync with nm-applet, secrets will be shared */
#define SHELL_KEYRING_UUID_TAG "connection-uuid"
#define SHELL_KEYRING_SN_TAG "setting-name"