Track: Implement a copy constructor
This keeps library size accurate when adding new tracks to the track_db. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
44aac0dcec
commit
d7ceadafb3
|
@ -27,6 +27,15 @@ Track :: Track(Album *album, Artist *artist, Genre *genre, Library *library,
|
|||
_library->inc_size();
|
||||
}
|
||||
|
||||
Track :: Track(const Track &track)
|
||||
: GenericTag(track),
|
||||
_album(track._album), _artist(track._artist), _genre(track._genre),
|
||||
_library(track._library), _count(track._count), _length(track._length),
|
||||
_track(track._track), _date(track._date), _path(track._path)
|
||||
{
|
||||
_library->inc_size();
|
||||
}
|
||||
|
||||
Track :: ~Track()
|
||||
{
|
||||
if (_library)
|
||||
|
|
|
@ -54,6 +54,13 @@ public:
|
|||
Track(Album *, Artist *, Genre *, Library *, const std::string &,
|
||||
const std::string &, unsigned int, unsigned int);
|
||||
|
||||
/**
|
||||
* Track copy constructor
|
||||
*
|
||||
* @param track The Track tag that should be copied.
|
||||
*/
|
||||
Track(const Track &);
|
||||
|
||||
/** Track destructor */
|
||||
~Track();
|
||||
|
||||
|
|
Loading…
Reference in New Issue