mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 09:40:06 +00:00
Qt: fix playlist title when adding a folder with one item
This commit is contained in:
parent
faaf84aef3
commit
230787808c
@ -306,11 +306,14 @@ void MainWindow::addFilesToPlaylist(QStringList files)
|
|||||||
|
|
||||||
fileInfo = fileName;
|
fileInfo = fileName;
|
||||||
|
|
||||||
if (files.count() == 1 && list.count() == 1 && i == 0)
|
/* Make sure we're looking at a user-specified field and not just "<multiple>"
|
||||||
|
* 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();
|
fileBaseNameArray = selectedName.toUtf8();
|
||||||
pathArray = QDir::toNativeSeparators(selectedPath).toUtf8();
|
pathArray = QDir::toNativeSeparators(selectedPath).toUtf8();
|
||||||
}
|
}
|
||||||
|
/* Otherwise just use the file name itself (minus extension) for the playlist entry title */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fileBaseNameArray = fileInfo.completeBaseName().toUtf8();
|
fileBaseNameArray = fileInfo.completeBaseName().toUtf8();
|
||||||
|
@ -182,6 +182,11 @@ void PlaylistEntryDialog::loadPlaylistOptions()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PlaylistEntryDialog::nameFieldEnabled()
|
||||||
|
{
|
||||||
|
return m_nameLineEdit->isEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
void PlaylistEntryDialog::setEntryValues(const QHash<QString, QString> &contentHash)
|
void PlaylistEntryDialog::setEntryValues(const QHash<QString, QString> &contentHash)
|
||||||
{
|
{
|
||||||
QString db;
|
QString db;
|
||||||
|
@ -20,6 +20,7 @@ public:
|
|||||||
const QString getSelectedPath();
|
const QString getSelectedPath();
|
||||||
const QStringList getSelectedExtensions();
|
const QStringList getSelectedExtensions();
|
||||||
bool filterInArchive();
|
bool filterInArchive();
|
||||||
|
bool nameFieldEnabled();
|
||||||
void setEntryValues(const QHash<QString, QString> &contentHash);
|
void setEntryValues(const QHash<QString, QString> &contentHash);
|
||||||
public slots:
|
public slots:
|
||||||
bool showDialog(const QHash<QString, QString> &hash = QHash<QString, QString>());
|
bool showDialog(const QHash<QString, QString> &hash = QHash<QString, QString>());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user