diff --git a/src/widgets/kpropertiesdialog.cpp b/src/widgets/kpropertiesdialog.cpp --- a/src/widgets/kpropertiesdialog.cpp +++ b/src/widgets/kpropertiesdialog.cpp @@ -984,7 +984,6 @@ if (d->bMultiple) { d->m_fileNameLabel->setText(KIO::itemsSummaryString(iFileCount + iDirCount, iFileCount, iDirCount, 0, false)); } - } else { d->m_lined = new KLineEdit(d->m_frame); d->m_lined->setObjectName(QStringLiteral("KFilePropsPlugin::nameLineEdit")); @@ -1221,7 +1220,14 @@ d->m_lined = nullptr; d->m_fileNameLabel = new QLabel(d->m_frame); d->m_fileNameLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); - d->m_fileNameLabel->setText(d->oldName); // will get overwritten if d->bMultiple + + if (d->oldName.isEmpty() || d->oldName == QStringLiteral(".")) { + // Use the text() when oldName was empty or not useful + d->m_fileNameLabel->setText(properties->item().text()); // will get overwritten if d->bMultiple + } else { + d->m_fileNameLabel->setText(d->oldName); // will get overwritten if d->bMultiple + } + d->m_grid->addWidget(d->m_fileNameLabel, 0, 2); } }