diff --git a/toolkit/tlist.h b/toolkit/tlist.h index 7ed5627d..3ea7a669 100644 --- a/toolkit/tlist.h +++ b/toolkit/tlist.h @@ -109,14 +109,16 @@ namespace TagLib { void sortedInsert(const T &value, bool unique = false); /*! - * Appends \a item to the end of the list. + * Appends \a item to the end of the list and returns a reference to the + * list. */ - void append(const T &item); + List &append(const T &item); /*! - * Appends all of the values in \a l to the end of the list. + * Appends all of the values in \a l to the end of the list and returns a + * reference to the list. */ - void append(const List &l); + List &append(const List &l); /*! * Clears the list. If auto deletion is enabled and this list contains a diff --git a/toolkit/tlist.tcc b/toolkit/tlist.tcc index 1064a1c5..e94b85a7 100644 --- a/toolkit/tlist.tcc +++ b/toolkit/tlist.tcc @@ -149,17 +149,19 @@ void List::sortedInsert(const T &value, bool unique) } template -void List::append(const T &item) +List &List::append(const T &item) { detach(); d->list.push_back(item); + return *this; } template -void List::append(const List &l) +List &List::append(const List &l) { detach(); d->list.insert(d->list.end(), l.begin(), l.end()); + return *this; } template