minor changes

This commit is contained in:
Paweł Bara 2011-02-20 15:05:05 +00:00
parent 72096bf1c8
commit 677a93b359
2 changed files with 5 additions and 5 deletions

View File

@ -554,11 +554,11 @@ QString LibraryView::GetNameForNewPlaylist(const SongList& songs) {
if(various_artists) {
result = tr("Various artists");
} else {
result = artists.values().at(0);
result = artists.values().first();
}
if(!various_artists && albums.size() == 1) {
result += " - " + albums.toList()[0];
result += " - " + albums.toList().first();
}
return result;

View File

@ -68,9 +68,9 @@ MimeData* FileViewList::MimeDataFromSelection() const {
data->setUrls(UrlListFromSelection());
QList<QString> filenames = FilenamesFromSelection();
// if just one file / folder selected - use it's path as the new playlist's name
if(filenames.size() == 1) {
data->name_for_new_playlist_ = filenames[0];
// if just one folder selected - use it's path as the new playlist's name
if(filenames.size() == 1 && QFileInfo(filenames.first()).isDir()) {
data->name_for_new_playlist_ = filenames.first();
// otherwise, use the current root path
} else {
data->name_for_new_playlist_ = static_cast<QFileSystemModel*>(model())->rootPath();