diff --git a/src/widgets/kpropertiesdialog.cpp b/src/widgets/kpropertiesdialog.cpp --- a/src/widgets/kpropertiesdialog.cpp +++ b/src/widgets/kpropertiesdialog.cpp @@ -993,16 +993,27 @@ } d->nameArea = lab; } else { - d->m_lined = new KLineEdit(d->m_frame); - d->m_lined->setObjectName("KFilePropsPlugin::nameLineEdit"); - d->m_lined->setText(filename); - d->nameArea = d->m_lined; - d->m_lined->setFocus(); - //if we don't have permissions to rename, we need to make "m_lined" read only. KFileItemListProperties itemList(KFileItemList() << item); setFileNameReadOnly(!itemList.supportsMoving()); - + // if supports writing then KLineEdit, else QLabel + if (itemList.supportsWriting()) { + d->m_lined = new KLineEdit(d->m_frame); + d->m_lined->setObjectName("KFilePropsPlugin::nameLineEdit"); + d->m_lined->setText(filename); + d->nameArea = d->m_lined; + d->m_lined->setFocus(); + grid->addWidget(d->nameArea, curRow++, 2); + + connect(d->m_lined, SIGNAL(textChanged(QString)), + this, SLOT(nameFileChanged(QString))); + } else { + QLabel *nameLabel = new QLabel(d->m_frame); + nameLabel->setText(filename); + nameLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); + grid->addWidget(nameLabel, curRow++, 2); + } + // Enhanced rename: Don't highlight the file extension. QString extension = db.suffixForFileName(filename); if (!extension.isEmpty()) { @@ -1014,12 +1025,8 @@ } } - connect(d->m_lined, SIGNAL(textChanged(QString)), - this, SLOT(nameFileChanged(QString))); } - grid->addWidget(d->nameArea, curRow++, 2); - KSeparator *sep = new KSeparator(Qt::Horizontal, d->m_frame); grid->addWidget(sep, curRow, 0, 1, 3); ++curRow;