Add 'copy to device', etc, actions to folders page.

This commit is contained in:
craig
2012-02-10 20:32:56 +00:00
parent 69d8d13fea
commit a0f42e8413
15 changed files with 128 additions and 65 deletions

View File

@@ -168,18 +168,7 @@ void LibraryPage::addSelectionToPlaylist(const QString &name)
#ifdef ENABLE_DEVICES_SUPPORT
void LibraryPage::addSelectionToDevice(const QString &udi)
{
const QModelIndexList selected = view->selectedIndexes();
if (0==selected.size()) {
return;
}
QModelIndexList mapped;
foreach (const QModelIndex &idx, selected) {
mapped.append(proxy.mapToSource(idx));
}
QList<Song> songs=MusicLibraryModel::self()->songs(mapped);
QList<Song> songs=selectedSongs();
if (!songs.isEmpty()) {
emit addToDevice(QString(), udi, songs);
@@ -189,18 +178,7 @@ void LibraryPage::addSelectionToDevice(const QString &udi)
void LibraryPage::deleteSongs()
{
const QModelIndexList selected = view->selectedIndexes();
if (0==selected.size()) {
return;
}
QModelIndexList mapped;
foreach (const QModelIndex &idx, selected) {
mapped.append(proxy.mapToSource(idx));
}
QList<Song> songs=MusicLibraryModel::self()->songs(mapped);
QList<Song> songs=selectedSongs();
if (!songs.isEmpty()) {
if (KMessageBox::Yes==KMessageBox::warningYesNo(this, i18n("Are you sure you wish to remove the selected songs?\nThis cannot be undone."))) {