Permalink
Browse files

Replace owl_errqueue's owl_list with a GPtrArray

  • Loading branch information...
1 parent 7ed9bc6 commit eb897c60f2b0304285f23687dc1f357afaa6ca53 @davidben davidben committed Mar 11, 2011
Showing with 6 additions and 8 deletions.
  1. +5 −7 errqueue.c
  2. +1 −1 owl.h
View
@@ -2,22 +2,20 @@
void owl_errqueue_init(owl_errqueue *eq)
{
- owl_list_create(&(eq->errlist));
+ eq->errlist = g_ptr_array_new();
}
void owl_errqueue_append_err(owl_errqueue *eq, const char *msg)
{
- owl_list_append_element(&(eq->errlist), g_strdup(msg));
+ g_ptr_array_add(eq->errlist, g_strdup(msg));
}
/* fmtext should already be initialized */
void owl_errqueue_to_fmtext(const owl_errqueue *eq, owl_fmtext *fm)
{
- int i, j;
-
- j=owl_list_get_size(&(eq->errlist));
- for (i=0; i<j; i++) {
- owl_fmtext_append_normal(fm, owl_list_get_element(&(eq->errlist), i));
+ int i;
+ for (i = 0; i < eq->errlist->len; i++) {
+ owl_fmtext_append_normal(fm, eq->errlist->pdata[i]);
owl_fmtext_append_normal(fm, "\n");
}
}
View
2 owl.h
@@ -515,7 +515,7 @@ typedef struct _owl_zbuddylist {
} owl_zbuddylist;
typedef struct _owl_errqueue {
- owl_list errlist;
+ GPtrArray *errlist;
} owl_errqueue;
typedef struct _owl_colorpair_mgr {

0 comments on commit eb897c6

Please sign in to comment.