diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-01-24 04:42:56 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-01-24 04:42:56 +0000 |
commit | 2bbd4c58853b63410e3a8443942c4e139ca01270 (patch) | |
tree | dea8bfe4c8ff6ab85aa720ef4690caa26a892d17 | |
parent | 77c82551f9d41bc5ec59cd75ea52ce3e34945b52 (diff) |
replaced fnmatch() with g_pattern_match_*().
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@32 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | src/grouplistdialog.c | 13 |
3 files changed, 18 insertions, 4 deletions
@@ -1,5 +1,9 @@ 2005-01-24 + * src/grouplistdialog.c: replaced fnmatch() with g_pattern_match_*(). + +2005-01-24 + * src/prefs_display_header.c src/action.c src/grouplistdialog.c diff --git a/ChangeLog.ja b/ChangeLog.ja index 388a235d..562c348c 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,10 @@ 2005-01-24 + * src/grouplistdialog.c: fnmatch() を g_pattern_match_*() + で置き換えた。 + +2005-01-24 + * src/prefs_display_header.c src/action.c src/grouplistdialog.c diff --git a/src/grouplistdialog.c b/src/grouplistdialog.c index 7088ede6..ee66c5b6 100644 --- a/src/grouplistdialog.c +++ b/src/grouplistdialog.c @@ -40,7 +40,6 @@ #include <gtk/gtkhbbox.h> #include <gtk/gtkstock.h> #include <string.h> -#include <fnmatch.h> #include "intl.h" #include "grouplistdialog.h" @@ -317,7 +316,7 @@ static GtkCTreeNode *grouplist_create_parent(const gchar *name, node = gtk_ctree_insert_node(GTK_CTREE(ctree), parent, node, cols, 0, NULL, NULL, NULL, NULL, FALSE, FALSE); - if (parent && fnmatch(pattern, parent_name, 0) != 0) + if (parent && g_pattern_match_simple(pattern, parent_name) == FALSE) gtk_ctree_expand(GTK_CTREE(ctree), parent); gtk_ctree_node_set_selectable(GTK_CTREE(ctree), node, FALSE); @@ -369,7 +368,8 @@ static GtkCTreeNode *grouplist_create_branch(NewsGroupInfo *ginfo, node = gtk_ctree_insert_node(GTK_CTREE(ctree), parent, node, cols, 0, NULL, NULL, NULL, NULL, TRUE, FALSE); - if (parent && fnmatch(pattern, parent_name, 0) != 0) + if (parent && + g_pattern_match_simple(pattern, parent_name) == FALSE) gtk_ctree_expand(GTK_CTREE(ctree), parent); } gtk_ctree_node_set_selectable(GTK_CTREE(ctree), node, TRUE); @@ -385,6 +385,7 @@ static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh) { GSList *cur; GtkCTreeNode *node; + GPatternSpec *pspec; if (locked) return; locked = TRUE; @@ -422,10 +423,12 @@ static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh) g_signal_handlers_block_by_func(G_OBJECT(ctree), G_CALLBACK(ctree_selected), NULL); + pspec = g_pattern_spec_new(pattern); + for (cur = group_list; cur != NULL ; cur = cur->next) { NewsGroupInfo *ginfo = (NewsGroupInfo *)cur->data; - if (fnmatch(pattern, ginfo->name, 0) == 0) { + if (g_pattern_match_string(pspec, ginfo->name)) { node = grouplist_create_branch(ginfo, pattern); if (g_slist_find_custom(subscribed, ginfo->name, (GCompareFunc)g_strcasecmp) @@ -434,6 +437,8 @@ static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh) } } + g_pattern_spec_free(pspec); + g_signal_handlers_unblock_by_func(G_OBJECT(ctree), G_CALLBACK(ctree_selected), NULL); |