[gnome-control-center] network: Move common code to common location
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Move common code to common location
- Date: Wed, 27 Nov 2019 22:12:25 +0000 (UTC)
commit bd7491bc5cd6a5b154c53e053f930556253ac8d3
Author: Robert Ancell <robert ancell canonical com>
Date: Tue Nov 12 10:08:14 2019 +1300
network: Move common code to common location
Remove duplicate header file for these functions
panels/network/cc-wifi-hotspot-dialog.c | 2 +-
panels/network/connection-editor/meson.build | 3 +-
panels/network/meson.build | 5 +++-
.../network/{connection-editor => }/ui-helpers.c | 0
.../network/{connection-editor => }/ui-helpers.h | 0
panels/network/wireless-security/eap-method-fast.c | 4 +--
panels/network/wireless-security/eap-method-leap.c | 4 +--
panels/network/wireless-security/eap-method-peap.c | 3 +-
.../network/wireless-security/eap-method-simple.c | 4 +--
panels/network/wireless-security/eap-method-tls.c | 4 +--
panels/network/wireless-security/eap-method-ttls.c | 2 +-
panels/network/wireless-security/eap-method.c | 2 +-
panels/network/wireless-security/helpers.h | 6 ++++
panels/network/wireless-security/meson.build | 2 +-
panels/network/wireless-security/utils.h | 33 ----------------------
.../network/wireless-security/wireless-security.c | 2 +-
panels/network/wireless-security/ws-leap.c | 6 ++--
panels/network/wireless-security/ws-wep-key.c | 6 ++--
panels/network/wireless-security/ws-wpa-psk.c | 6 ++--
19 files changed, 35 insertions(+), 59 deletions(-)
---
diff --git a/panels/network/cc-wifi-hotspot-dialog.c b/panels/network/cc-wifi-hotspot-dialog.c
index 0ef536264..f13e52bf2 100644
--- a/panels/network/cc-wifi-hotspot-dialog.c
+++ b/panels/network/cc-wifi-hotspot-dialog.c
@@ -30,9 +30,9 @@
#include <libmm-glib.h>
#include "list-box-helper.h"
-#include "connection-editor/ui-helpers.h"
#include "cc-wifi-hotspot-dialog.h"
#include "cc-network-resources.h"
+#include "ui-helpers.h"
/**
* @short_description: WWAN network type selection dialog
diff --git a/panels/network/connection-editor/meson.build b/panels/network/connection-editor/meson.build
index 9ba9b3784..856833fff 100644
--- a/panels/network/connection-editor/meson.build
+++ b/panels/network/connection-editor/meson.build
@@ -11,7 +11,6 @@ sources = files(
'ce-page-wifi.c',
'ce-page.c',
'net-connection-editor.c',
- 'ui-helpers.c',
'vpn-helpers.c'
)
@@ -40,7 +39,7 @@ sources += gnome.compile_resources(
libconnection_editor = static_library(
name,
sources: sources,
- include_directories: [top_inc, common_inc, wireless_security_inc],
+ include_directories: [top_inc, common_inc, network_inc, wireless_security_inc],
dependencies: deps,
c_args: cflags,
link_with: libwireless_security
diff --git a/panels/network/meson.build b/panels/network/meson.build
index 6bb3a9428..439b2b847 100644
--- a/panels/network/meson.build
+++ b/panels/network/meson.build
@@ -3,6 +3,8 @@ deps = common_deps + network_manager_deps + [
dependency('gmodule-2.0')
]
+network_inc = include_directories('.')
+
subdir('wireless-security')
subdir('connection-editor')
@@ -46,7 +48,8 @@ sources = files(
'net-proxy.c',
'net-vpn.c',
'network-dialogs.c',
- 'panel-common.c'
+ 'panel-common.c',
+ 'ui-helpers.c'
)
resource_data = files(
diff --git a/panels/network/connection-editor/ui-helpers.c b/panels/network/ui-helpers.c
similarity index 100%
rename from panels/network/connection-editor/ui-helpers.c
rename to panels/network/ui-helpers.c
diff --git a/panels/network/connection-editor/ui-helpers.h b/panels/network/ui-helpers.h
similarity index 100%
rename from panels/network/connection-editor/ui-helpers.h
rename to panels/network/ui-helpers.h
diff --git a/panels/network/wireless-security/eap-method-fast.c
b/panels/network/wireless-security/eap-method-fast.c
index 970e54a9a..a9f7fc457 100644
--- a/panels/network/wireless-security/eap-method-fast.c
+++ b/panels/network/wireless-security/eap-method-fast.c
@@ -25,9 +25,9 @@
#include "eap-method.h"
#include "eap-method-fast.h"
#include "eap-method-simple.h"
-#include "wireless-security.h"
-#include "utils.h"
#include "helpers.h"
+#include "ui-helpers.h"
+#include "wireless-security.h"
#define I_NAME_COLUMN 0
#define I_ID_COLUMN 1
diff --git a/panels/network/wireless-security/eap-method-leap.c
b/panels/network/wireless-security/eap-method-leap.c
index 419dfbb07..0ebb98bf8 100644
--- a/panels/network/wireless-security/eap-method-leap.c
+++ b/panels/network/wireless-security/eap-method-leap.c
@@ -24,10 +24,10 @@
#include "eap-method.h"
#include "eap-method-leap.h"
-#include "wireless-security.h"
#include "helpers.h"
#include "nma-ui-utils.h"
-#include "utils.h"
+#include "ui-helpers.h"
+#include "wireless-security.h"
struct _EAPMethodLEAP {
GtkGrid parent;
diff --git a/panels/network/wireless-security/eap-method-peap.c
b/panels/network/wireless-security/eap-method-peap.c
index e042d0d5b..aa8aed0ee 100644
--- a/panels/network/wireless-security/eap-method-peap.c
+++ b/panels/network/wireless-security/eap-method-peap.c
@@ -25,8 +25,9 @@
#include "eap-method.h"
#include "eap-method-peap.h"
#include "eap-method-simple.h"
+#include "helpers.h"
+#include "ui-helpers.h"
#include "wireless-security.h"
-#include "utils.h"
#define I_NAME_COLUMN 0
#define I_ID_COLUMN 1
diff --git a/panels/network/wireless-security/eap-method-simple.c
b/panels/network/wireless-security/eap-method-simple.c
index 2ab690296..1aee64e7b 100644
--- a/panels/network/wireless-security/eap-method-simple.c
+++ b/panels/network/wireless-security/eap-method-simple.c
@@ -24,10 +24,10 @@
#include "eap-method.h"
#include "eap-method-simple.h"
-#include "wireless-security.h"
#include "helpers.h"
#include "nma-ui-utils.h"
-#include "utils.h"
+#include "ui-helpers.h"
+#include "wireless-security.h"
struct _EAPMethodSimple {
GtkGrid parent;
diff --git a/panels/network/wireless-security/eap-method-tls.c
b/panels/network/wireless-security/eap-method-tls.c
index 15748c04a..c15b0e40f 100644
--- a/panels/network/wireless-security/eap-method-tls.c
+++ b/panels/network/wireless-security/eap-method-tls.c
@@ -24,10 +24,10 @@
#include "eap-method.h"
#include "eap-method-tls.h"
-#include "wireless-security.h"
#include "helpers.h"
#include "nma-ui-utils.h"
-#include "utils.h"
+#include "ui-helpers.h"
+#include "wireless-security.h"
struct _EAPMethodTLS {
GtkGrid parent;
diff --git a/panels/network/wireless-security/eap-method-ttls.c
b/panels/network/wireless-security/eap-method-ttls.c
index 3cacd767f..d3ec57cc8 100644
--- a/panels/network/wireless-security/eap-method-ttls.c
+++ b/panels/network/wireless-security/eap-method-ttls.c
@@ -25,8 +25,8 @@
#include "eap-method.h"
#include "eap-method-simple.h"
#include "eap-method-ttls.h"
+#include "helpers.h"
#include "wireless-security.h"
-#include "utils.h"
#define I_NAME_COLUMN 0
#define I_ID_COLUMN 1
diff --git a/panels/network/wireless-security/eap-method.c b/panels/network/wireless-security/eap-method.c
index 9fc6a63c6..03c24fd1d 100644
--- a/panels/network/wireless-security/eap-method.c
+++ b/panels/network/wireless-security/eap-method.c
@@ -25,8 +25,8 @@
#include <glib/gi18n.h>
#include "eap-method.h"
-#include "utils.h"
#include "helpers.h"
+#include "ui-helpers.h"
G_DEFINE_INTERFACE (EAPMethod, eap_method, G_TYPE_OBJECT)
diff --git a/panels/network/wireless-security/helpers.h b/panels/network/wireless-security/helpers.h
index f5fc3613b..6a402d8dd 100644
--- a/panels/network/wireless-security/helpers.h
+++ b/panels/network/wireless-security/helpers.h
@@ -26,6 +26,12 @@
#include <NetworkManager.h>
#include <gtk/gtk.h>
+#define NMA_ERROR (g_quark_from_static_string ("nma-error-quark"))
+
+typedef enum {
+ NMA_ERROR_GENERIC
+} NMAError;
+
typedef const char * (*HelperSecretFunc)(NMSetting *);
void helper_fill_secret_entry (NMConnection *connection,
diff --git a/panels/network/wireless-security/meson.build b/panels/network/wireless-security/meson.build
index 5e6e0157b..277be5a85 100644
--- a/panels/network/wireless-security/meson.build
+++ b/panels/network/wireless-security/meson.build
@@ -63,6 +63,6 @@ sources += gnome.compile_resources(
libwireless_security = static_library(
name,
sources: sources,
- include_directories: top_inc,
+ include_directories: [top_inc, network_inc],
dependencies: deps
)
diff --git a/panels/network/wireless-security/wireless-security.c
b/panels/network/wireless-security/wireless-security.c
index 4dc2619b9..2759b80b9 100644
--- a/panels/network/wireless-security/wireless-security.c
+++ b/panels/network/wireless-security/wireless-security.c
@@ -22,9 +22,9 @@
#include <glib/gi18n.h>
+#include "helpers.h"
#include "wireless-security.h"
#include "wireless-security-resources.h"
-#include "utils.h"
typedef struct {
char *username, *password;
diff --git a/panels/network/wireless-security/ws-leap.c b/panels/network/wireless-security/ws-leap.c
index db2278fc7..48a22b57c 100644
--- a/panels/network/wireless-security/ws-leap.c
+++ b/panels/network/wireless-security/ws-leap.c
@@ -22,11 +22,11 @@
#include <glib/gi18n.h>
-#include "ws-leap.h"
-#include "wireless-security.h"
#include "helpers.h"
#include "nma-ui-utils.h"
-#include "utils.h"
+#include "ui-helpers.h"
+#include "wireless-security.h"
+#include "ws-leap.h"
struct _WirelessSecurityLEAP {
WirelessSecurity parent;
diff --git a/panels/network/wireless-security/ws-wep-key.c b/panels/network/wireless-security/ws-wep-key.c
index bae8fa9d7..bf09163f2 100644
--- a/panels/network/wireless-security/ws-wep-key.c
+++ b/panels/network/wireless-security/ws-wep-key.c
@@ -22,11 +22,11 @@
#include <glib/gi18n.h>
-#include "ws-wep-key.h"
-#include "wireless-security.h"
-#include "utils.h"
#include "helpers.h"
#include "nma-ui-utils.h"
+#include "ui-helpers.h"
+#include "ws-wep-key.h"
+#include "wireless-security.h"
struct _WirelessSecurityWEPKey {
WirelessSecurity parent;
diff --git a/panels/network/wireless-security/ws-wpa-psk.c b/panels/network/wireless-security/ws-wpa-psk.c
index 09bbd7b2d..e6d4c25f9 100644
--- a/panels/network/wireless-security/ws-wpa-psk.c
+++ b/panels/network/wireless-security/ws-wpa-psk.c
@@ -23,11 +23,11 @@
#include <ctype.h>
#include <glib/gi18n.h>
-#include "ws-wpa-psk.h"
-#include "wireless-security.h"
#include "helpers.h"
#include "nma-ui-utils.h"
-#include "utils.h"
+#include "ui-helpers.h"
+#include "ws-wpa-psk.h"
+#include "wireless-security.h"
#define WPA_PMK_LEN 32
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]