-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NM plugin fixes #13
base: master
Are you sure you want to change the base?
NM plugin fixes #13
Changes from 4 commits
20bb63d
0bdf161
852e6b0
17e5305
c00221c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,7 +176,7 @@ typedef struct { | |
} J4statusNmSection; | ||
|
||
static GVariant * | ||
_j4status_nm_format_up_eth_callback(const gchar *token, guint64 value, gconstpointer user_data) | ||
_j4status_nm_format_up_eth_callback(G_GNUC_UNUSED const gchar *token, guint64 value, gconstpointer user_data) | ||
{ | ||
const J4statusNmFormatUpEthData *data = user_data; | ||
switch ( value ) | ||
|
@@ -196,7 +196,7 @@ _j4status_nm_format_up_eth_callback(const gchar *token, guint64 value, gconstpoi | |
} | ||
|
||
static GVariant * | ||
_j4status_nm_format_up_wifi_callback(const gchar *token, guint64 value, gconstpointer user_data) | ||
_j4status_nm_format_up_wifi_callback(G_GNUC_UNUSED const gchar *token, guint64 value, gconstpointer user_data) | ||
{ | ||
const J4statusNmFormatUpWiFiData *data = user_data; | ||
switch ( value ) | ||
|
@@ -220,7 +220,7 @@ _j4status_nm_format_up_wifi_callback(const gchar *token, guint64 value, gconstpo | |
} | ||
|
||
static GVariant * | ||
_j4status_nm_format_down_wifi_callback(const gchar *token, guint64 value, gconstpointer user_data) | ||
_j4status_nm_format_down_wifi_callback(G_GNUC_UNUSED const gchar *token, guint64 value, gconstpointer user_data) | ||
{ | ||
const gint64 *aps_number = user_data; | ||
switch ( value ) | ||
|
@@ -237,7 +237,7 @@ _j4status_nm_format_down_wifi_callback(const gchar *token, guint64 value, gconst | |
} | ||
|
||
static GVariant * | ||
_j4status_nm_format_up_other_callback(const gchar *token, guint64 value, gconstpointer user_data) | ||
_j4status_nm_format_up_other_callback(G_GNUC_UNUSED const gchar *token, guint64 value, gconstpointer user_data) | ||
{ | ||
switch ( value ) | ||
{ | ||
|
@@ -253,13 +253,15 @@ _j4status_nm_format_up_other_callback(const gchar *token, guint64 value, gconstp | |
} | ||
|
||
static GVariant * | ||
_j4status_nm_format_down_other_callback(const gchar *token, guint64 value, gconstpointer user_data) | ||
_j4status_nm_format_down_other_callback(G_GNUC_UNUSED const gchar *token, | ||
G_GNUC_UNUSED guint64 value, | ||
G_GNUC_UNUSED gconstpointer user_data) | ||
{ | ||
return NULL; | ||
} | ||
|
||
static void | ||
_j4status_nm_device_get_addresses_ipv4(J4statusPluginContext *context, NMDevice *device, GVariantBuilder *builder) | ||
_j4status_nm_device_get_addresses_ipv4(G_GNUC_UNUSED J4statusPluginContext *context, NMDevice *device, GVariantBuilder *builder) | ||
{ | ||
NMIPConfig *ip4_config; | ||
|
||
|
@@ -277,7 +279,7 @@ _j4status_nm_device_get_addresses_ipv4(J4statusPluginContext *context, NMDevice | |
} | ||
|
||
static void | ||
_j4status_nm_device_get_addresses_ipv6(J4statusPluginContext *context, NMDevice *device, GVariantBuilder *builder) | ||
_j4status_nm_device_get_addresses_ipv6(G_GNUC_UNUSED J4statusPluginContext *context, NMDevice *device, GVariantBuilder *builder) | ||
{ | ||
NMIPConfig *ip6_config; | ||
|
||
|
@@ -403,18 +405,23 @@ _j4status_nm_device_update(J4statusPluginContext *context, J4statusNmSection *se | |
|
||
if ( context->formats.up_wifi_tokens & TOKEN_FLAG_UP_WIFI_SSID ) | ||
{ | ||
const GByteArray *raw_ssid; | ||
raw_ssid = nm_access_point_get_ssid(section->ap); | ||
data.ssid = g_variant_new_take_string(g_strndup((const gchar *)raw_ssid->data, raw_ssid->len)); | ||
GBytes *raw_ssid = nm_access_point_get_ssid(section->ap); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hum, that’s new from the libnm merge, so you need to say that in the commit message. |
||
if (raw_ssid) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This condition must be in the previous commit as it’s the one introducing the Nit: also 3 style issues here: spaces around parens, |
||
char *active_ssid_str = nm_utils_ssid_to_utf8(g_bytes_get_data (raw_ssid, NULL), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: |
||
g_bytes_get_size (raw_ssid)); | ||
data.ssid = g_variant_new_take_string(active_ssid_str); | ||
} | ||
} | ||
} | ||
|
||
data.bitrate = nm_device_wifi_get_bitrate(NM_DEVICE_WIFI(device)) * 1000; | ||
|
||
value = j4status_format_string_replace(context->formats.up_wifi, _j4status_nm_format_up_wifi_callback, &data); | ||
|
||
if ( data.ssid != NULL ) | ||
if ( data.ssid != NULL ) { | ||
g_variant_unref(data.ssid); | ||
data.ssid = NULL; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
if ( data.addresses != NULL ) | ||
g_variant_unref(data.addresses); | ||
} | ||
|
@@ -468,7 +475,8 @@ _j4status_nm_device_update(J4statusPluginContext *context, J4statusNmSection *se | |
} | ||
|
||
static void | ||
_j4status_nm_access_point_property_changed(NMAccessPoint *device, GParamSpec *pspec, gpointer user_data) | ||
_j4status_nm_access_point_property_changed(G_GNUC_UNUSED NMAccessPoint *device, | ||
G_GNUC_UNUSED GParamSpec *pspec, gpointer user_data) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: style |
||
{ | ||
J4statusNmSection *section = user_data; | ||
_j4status_nm_device_update(section->context, section, section->device); | ||
|
@@ -493,14 +501,17 @@ _j4status_nm_device_property_changed(NMDevice *device, GParamSpec *pspec, gpoint | |
} | ||
|
||
static void | ||
_j4status_nm_device_state_changed(NMDevice *device, guint state, guint arg2, guint arg3, gpointer user_data) | ||
_j4status_nm_device_state_changed(NMDevice *device, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: style |
||
G_GNUC_UNUSED guint state, | ||
G_GNUC_UNUSED guint arg2, | ||
G_GNUC_UNUSED guint arg3, gpointer user_data) | ||
{ | ||
J4statusNmSection *section = user_data; | ||
_j4status_nm_device_update(section->context, section, device); | ||
} | ||
|
||
static void | ||
_j4status_nm_device_monitor(gpointer key, gpointer data, gpointer user_data) | ||
_j4status_nm_device_monitor(G_GNUC_UNUSED gpointer key, gpointer data, G_GNUC_UNUSED gpointer user_data) | ||
{ | ||
J4statusNmSection *section = data; | ||
|
||
|
@@ -523,7 +534,7 @@ _j4status_nm_device_monitor(gpointer key, gpointer data, gpointer user_data) | |
} | ||
|
||
static void | ||
_j4status_nm_device_unmonitor(gpointer key, gpointer data, gpointer user_data) | ||
_j4status_nm_device_unmonitor(G_GNUC_UNUSED gpointer key, gpointer data, G_GNUC_UNUSED gpointer user_data) | ||
{ | ||
J4statusNmSection *section = data; | ||
|
||
|
@@ -635,7 +646,7 @@ _j4status_nm_section_detach_device(J4statusNmSection *section) | |
} | ||
|
||
static void | ||
_j4status_nm_client_device_added(NMClient *client, NMDevice *device, gpointer user_data) | ||
_j4status_nm_client_device_added(G_GNUC_UNUSED NMClient *client, NMDevice *device, gpointer user_data) | ||
{ | ||
J4statusPluginContext *context = user_data; | ||
J4statusNmSection *section; | ||
|
@@ -645,7 +656,7 @@ _j4status_nm_client_device_added(NMClient *client, NMDevice *device, gpointer us | |
} | ||
|
||
static void | ||
_j4status_nm_client_device_removed(NMClient *client, NMDevice *device, gpointer user_data) | ||
_j4status_nm_client_device_removed(G_GNUC_UNUSED NMClient *client, NMDevice *device, gpointer user_data) | ||
{ | ||
J4statusPluginContext *context = user_data; | ||
J4statusNmSection *section; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: style, all on the same line