diff options
author | Austin Clements <amdragon@mit.edu> | 2010-12-08 19:26:05 -0500 |
---|---|---|
committer | Austin Clements <amdragon@mit.edu> | 2011-03-21 02:45:18 -0400 |
commit | f3c1eebfaf8526129ae6946cbcd44a3c602563d6 (patch) | |
tree | 13457ad173997005f6023d274e9a0ec130bba098 /lib/directory.cc | |
parent | d9b0ae918fd9d535e819b8859eca579002146661 (diff) |
Implement an internal generic string list and use it.
This replaces the guts of the filename list and tag list, making those
interfaces simple iterators over the generic string list. The
directory, message filename, and tags-related code now build generic
string lists and then wraps them in specific iterators. The real wins
come in later patches, when we use these for even more generic
functionality.
As a nice side-effect, this also eliminates the annoying dependency on
GList in the tag list.
Diffstat (limited to 'lib/directory.cc')
-rw-r--r-- | lib/directory.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/directory.cc b/lib/directory.cc index 946be4f4..aeee9caf 100644 --- a/lib/directory.cc +++ b/lib/directory.cc @@ -33,11 +33,11 @@ _create_filenames_for_terms_with_prefix (void *ctx, notmuch_database_t *notmuch, const char *prefix) { - notmuch_filename_list_t *filename_list; + notmuch_string_list_t *filename_list; Xapian::TermIterator i, end; int prefix_len = strlen (prefix); - filename_list = _notmuch_filename_list_create (ctx); + filename_list = _notmuch_string_list_create (ctx); if (unlikely (filename_list == NULL)) return NULL; @@ -47,8 +47,7 @@ _create_filenames_for_terms_with_prefix (void *ctx, { std::string term = *i; - _notmuch_filename_list_add_filename (filename_list, term.c_str () + - prefix_len); + _notmuch_string_list_append (filename_list, term.c_str () + prefix_len); } return _notmuch_filenames_create (ctx, filename_list); |