1 /***************************************************************************
2 * copyright : (C) 2007 Ian Monroe <ian@monroe.nu> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License version 2 *
6 * as published by the Free Software Foundation. *
7 ***************************************************************************/
10 #include "TheInstances.h"
11 #include "UndoCommands.h"
13 using namespace Playlist
;
16 AddTracksCmd::AddTracksCmd( QUndoCommand
* parent
, int row
, Meta::TrackList tracks
)
17 : QUndoCommand( i18n("Tracks Added"), parent
)
26 The::playlistModel()->insertTracksCommand( m_row
, m_tracks
);
32 The::playlistModel()->removeRowsCommand( m_row
, m_tracks
.size() );
35 RemoveTracksCmd::RemoveTracksCmd( QUndoCommand
* parent
, int position
, int numOfRows
)
36 : QUndoCommand( i18n("Tracks Removed"), parent
)
37 , m_numOfRows( numOfRows
)
38 , m_position( position
)
42 RemoveTracksCmd::redo()
44 m_tracks
= The::playlistModel()->removeRowsCommand( m_position
, m_numOfRows
);
48 RemoveTracksCmd::undo()
50 The::playlistModel()->insertTracksCommand( m_position
, m_tracks
);