diff options
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/report.c | 2 | ||||
| -rw-r--r-- | shell/shell.c | 25 | 
2 files changed, 17 insertions, 10 deletions
| diff --git a/shell/report.c b/shell/report.c index 549264de..3fcca668 100644 --- a/shell/report.c +++ b/shell/report.c @@ -126,6 +126,7 @@ gchar *make_icon_css(const gchar *file) {  }  void cache_icon(ReportContext *ctx, const gchar *file) { +    if (!ctx->icon_data) return;      if (!g_hash_table_lookup(ctx->icon_data, file) )          g_hash_table_insert(ctx->icon_data, g_strdup(file), make_icon_css(file));  } @@ -684,6 +685,7 @@ report_create_inner_from_module_list(ReportContext * ctx, GSList * modules)  	for (entries = module->entries; entries; entries = entries->next) {  	    ShellModuleEntry *entry = (ShellModuleEntry *) entries->data; +        if (entry->flags & MODULE_FLAG_HIDE) continue;  	    if (!params.gui_running)  		fprintf(stderr, "\033[2K\033[40;32;1m %s\033[0m\n", diff --git a/shell/shell.c b/shell/shell.c index 5e13bde6..2f3a68fc 100644 --- a/shell/shell.c +++ b/shell/shell.c @@ -648,6 +648,7 @@ void shell_add_modules_to_gui(gpointer _shell_module, gpointer _shell_tree)  	for (p = module->entries; p; p = g_slist_next(p)) {  	    GtkTreeIter child;  	    entry = (ShellModuleEntry *) p->data; +        if (entry->flags & MODULE_FLAG_HIDE) continue;  	    gtk_tree_store_append(store, &child, &parent);  	    gtk_tree_store_set(store, &child, TREE_COL_NAME, entry->name, @@ -2165,17 +2166,21 @@ gboolean key_is_flagged(const gchar *key) {  }  gboolean key_is_highlighted(const gchar *key) { -    if (key_is_flagged(key)) { -        if (strchr(key, '*')) -            return TRUE; +    gchar *flags; +    key_get_components(key, &flags, NULL, NULL, NULL, NULL, TRUE); +    if (flags && strchr(flags, '*')) { +        g_free(flags); +        return TRUE;      }      return FALSE;  }  gboolean key_wants_details(const gchar *key) { -    if (key_is_flagged(key)) { -        if (strchr(key, '!')) -            return TRUE; +    gchar *flags; +    key_get_components(key, &flags, NULL, NULL, NULL, NULL, TRUE); +    if (flags && strchr(flags, '!')) { +        g_free(flags); +        return TRUE;      }      return FALSE;  } @@ -2217,11 +2222,8 @@ void key_get_components(const gchar *key,      gchar **flags, gchar **tag, gchar **name, gchar **label, gchar **dis,      gboolean null_empty) { -    if (!key || !*key) -        return; -      if (null_empty) { -#define K_NULL_EMPTY(f) if (f && *f) { *f = NULL; } +#define K_NULL_EMPTY(f) if (f) { *f = NULL; }          K_NULL_EMPTY(flags);          K_NULL_EMPTY(tag);          K_NULL_EMPTY(name); @@ -2229,6 +2231,9 @@ void key_get_components(const gchar *key,          K_NULL_EMPTY(dis);      } +    if (!key || !*key) +        return; +      const gchar *np = g_utf8_strchr(key+1, -1, '$') + 1;      if (*key == '$' && np) {          /* is flagged */ | 
