From: tmarki Date: Sun, 8 Aug 2010 20:48:15 +0000 (+0200) Subject: bugfixes, confirm dialogs for remove actions X-Git-Url: https://vcs.maemo.org/git/?p=tomamp;a=commitdiff_plain;h=d56668830f982dde4ccda85bd4de71173b89ec90 bugfixes, confirm dialogs for remove actions --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 14cf5ee..2f8022b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -504,6 +504,8 @@ void MainWindow::setupActions() void MainWindow::removeSelectedItem() { + if (QMessageBox::question(this, "Confirm remove", "Are you sure you want to remove this item?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) + return; int row = musicTable->currentRow(); if (row >= 0) plman.removeItem(row); @@ -511,6 +513,8 @@ void MainWindow::removeSelectedItem() void MainWindow::removeAllButSelectedItem() { + if (QMessageBox::question(this, "Confirm remove", "Are you sure you want to remove all other items?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) + return; int row = musicTable->currentRow(); if (row >= 0) { diff --git a/playlistmanager.cpp b/playlistmanager.cpp index 5ddfcf4..4488583 100644 --- a/playlistmanager.cpp +++ b/playlistmanager.cpp @@ -58,7 +58,8 @@ void PlaylistManager::parseAndAddFolder(const QString &dir, bool recursive) items.append(PlaylistItem (PlaylistItem (fname))); } } - if (!items.isEmpty()) +// if (!items.isEmpty()) + if (items.size () > index) { metaInformationResolver->setCurrentSource(items.at(index).source); lastMetaRead = index; @@ -78,7 +79,8 @@ void PlaylistManager::addStringList(const QStringList& list) items.append(PlaylistItem (string)); } } - if (!items.isEmpty()) +// if (!items.isEmpty()) + if (items.size () > index) { metaInformationResolver->setCurrentSource(items.at(index).source); lastMetaRead = index; @@ -200,7 +202,8 @@ void PlaylistManager::addPlaylist(const QString& filename) appendPlaylist(filename); else if (filename.right(4).toLower() == ".pls") appendPlaylistPLS(filename); - if (!items.isEmpty()) + if (items.size () > index) +// if (!items.isEmpty()) { metaInformationResolver->setCurrentSource(items.at(index).source); lastMetaRead = index;