From 14c4e52738c9e041ab2ae3192803e7a491900569 Mon Sep 17 00:00:00 2001 From: Lev Babiev Date: Fri, 13 Dec 2024 22:08:33 +0000 Subject: [PATCH] scanner: ignore invalid state for intermediate variables --- modules/network.c | 4 ++++ src/gui/basewidget.c | 19 ------------------- src/scanner.c | 2 +- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/modules/network.c b/modules/network.c index 0ade592..bf00c98 100644 --- a/modules/network.c +++ b/modules/network.c @@ -178,6 +178,7 @@ static void net_update_essid ( gchar *interface ) gint sock; gchar lessid[IW_ESSID_MAX_SIZE+1]; iface_info *iface; + gboolean diff; if(!interface) return; @@ -194,10 +195,13 @@ static void net_update_essid ( gchar *interface ) sock = socket(AF_INET, SOCK_DGRAM, 0); if(sock >= 0 && ioctl(sock, SIOCGIWESSID, &wreq) >= 0) { + diff = g_strcmp0(iface->essid, lessid); g_mutex_lock(&iface->mutex); g_free(iface->essid); iface->essid = g_strdup(lessid); g_mutex_unlock(&iface->mutex); + if(diff) + trigger_emit("network"); } if(sock >= 0) close(sock); diff --git a/src/gui/basewidget.c b/src/gui/basewidget.c index 8906b5c..c7e1eb3 100644 --- a/src/gui/basewidget.c +++ b/src/gui/basewidget.c @@ -494,25 +494,6 @@ void base_widget_set_tooltip ( GtkWidget *self, guint8 *code, gsize len ) G_CALLBACK(base_widget_tooltip_update), self); } -/*void base_widget_set_value ( GtkWidget *self, gchar *value ) -{ - BaseWidgetPrivate *priv; - - g_return_if_fail(IS_BASE_WIDGET(self)); - priv = base_widget_get_instance_private(BASE_WIDGET(self)); - - expr_cache_set(priv->value, value); - priv->value->widget = self; - - if(expr_cache_eval(priv->value) || priv->always_update) - base_widget_update_value(self); - - g_mutex_lock(&widget_mutex); - if(!g_list_find(widgets_scan,self)) - widgets_scan = g_list_append(widgets_scan,self); - g_mutex_unlock(&widget_mutex); -}*/ - void base_widget_set_value ( GtkWidget *self, guint8 *code, gsize len ) { BaseWidgetPrivate *priv; diff --git a/src/scanner.c b/src/scanner.c index 715a537..de8d09c 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -433,7 +433,7 @@ ScanVar *scanner_var_update ( gchar *name, gboolean update, expr_cache_t *expr ) if(!var) return NULL; - if(!update || !var->invalid) + if(!update || (!var->invalid && var->type != G_TOKEN_SET)) { if(expr) expr->vstate = expr->vstate || var->vstate;