diff --git a/ui/drivers/qt/playlist.cpp b/ui/drivers/qt/playlist.cpp index b143c2235a..141b3e6fc9 100644 --- a/ui/drivers/qt/playlist.cpp +++ b/ui/drivers/qt/playlist.cpp @@ -306,11 +306,14 @@ void MainWindow::addFilesToPlaylist(QStringList files) fileInfo = fileName; - if (files.count() == 1 && list.count() == 1 && i == 0) + /* Make sure we're looking at a user-specified field and not just "" + * in case it was a folder with one file in it */ + if (files.count() == 1 && list.count() == 1 && i == 0 && playlistDialog->nameFieldEnabled()) { fileBaseNameArray = selectedName.toUtf8(); pathArray = QDir::toNativeSeparators(selectedPath).toUtf8(); } + /* Otherwise just use the file name itself (minus extension) for the playlist entry title */ else { fileBaseNameArray = fileInfo.completeBaseName().toUtf8(); diff --git a/ui/drivers/qt/playlistentrydialog.cpp b/ui/drivers/qt/playlistentrydialog.cpp index 559df6a22b..b36e35157a 100644 --- a/ui/drivers/qt/playlistentrydialog.cpp +++ b/ui/drivers/qt/playlistentrydialog.cpp @@ -182,6 +182,11 @@ void PlaylistEntryDialog::loadPlaylistOptions() } } +bool PlaylistEntryDialog::nameFieldEnabled() +{ + return m_nameLineEdit->isEnabled(); +} + void PlaylistEntryDialog::setEntryValues(const QHash &contentHash) { QString db; diff --git a/ui/drivers/qt/playlistentrydialog.h b/ui/drivers/qt/playlistentrydialog.h index 351744ea82..0dffa1268f 100644 --- a/ui/drivers/qt/playlistentrydialog.h +++ b/ui/drivers/qt/playlistentrydialog.h @@ -20,6 +20,7 @@ public: const QString getSelectedPath(); const QStringList getSelectedExtensions(); bool filterInArchive(); + bool nameFieldEnabled(); void setEntryValues(const QHash &contentHash); public slots: bool showDialog(const QHash &hash = QHash());