gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / patches / network-manager-plugin-path.patch
1 From d3026a6d331298003ccc6cd9d2e20dcb7fa9ae1d Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cech?= <sleep_walker@gnu.org>
3 Date: Wed, 3 Jul 2019 13:31:54 +0200
4 Subject: [PATCH] respect NM_VPN_PLUGIN_DIR
5
6 ---
7 src/vpn/nm-vpn-manager.c | 14 ++++++++++++++
8 1 file changed, 14 insertions(+)
9
10 diff --git a/src/vpn/nm-vpn-manager.c b/src/vpn/nm-vpn-manager.c
11 index d063916..d779166 100644
12 --- a/src/vpn/nm-vpn-manager.c
13 +++ b/src/vpn/nm-vpn-manager.c
14 @@ -223,6 +223,7 @@ nm_vpn_manager_init (NMVpnManager *self)
15 GSList *infos, *info;
16 const char *conf_dir_etc = _nm_vpn_plugin_info_get_default_dir_etc ();
17 const char *conf_dir_lib = _nm_vpn_plugin_info_get_default_dir_lib ();
18 + const char *conf_dir_user = _nm_vpn_plugin_info_get_default_dir_user ();
19
20 /* Watch the VPN directory for changes */
21 file = g_file_new_for_path (conf_dir_lib);
22 @@ -241,6 +242,14 @@ nm_vpn_manager_init (NMVpnManager *self)
23 G_CALLBACK (vpn_dir_changed), self);
24 }
25
26 + file = g_file_new_for_path (conf_dir_user);
27 + priv->monitor_etc = g_file_monitor_directory (file, G_FILE_MONITOR_NONE, NULL, NULL);
28 + g_object_unref (file);
29 + if (priv->monitor_etc) {
30 + priv->monitor_id_etc = g_signal_connect (priv->monitor_etc, "changed",
31 + G_CALLBACK (vpn_dir_changed), self);
32 + }
33 +
34 /* first read conf_dir_lib. The name files are not really user configuration, but
35 * plugin configuration. Hence we expect ~newer~ plugins to install their files
36 * in /usr/lib/NetworkManager. We want to prefer those files.
37 @@ -255,6 +264,11 @@ nm_vpn_manager_init (NMVpnManager *self)
38 try_add_plugin (self, info->data);
39 g_slist_free_full (infos, g_object_unref);
40
41 + infos = _nm_vpn_plugin_info_list_load_dir (conf_dir_user, TRUE, 0, NULL, NULL);
42 + for (info = infos; info; info = info->next)
43 + try_add_plugin (self, info->data);
44 + g_slist_free_full (infos, g_object_unref);
45 +
46 priv->active_services = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, NULL);
47 }
48
49 --
50 2.22.0
51