diff --git a/src/widgets/kpropertiesdialog.cpp b/src/widgets/kpropertiesdialog.cpp --- a/src/widgets/kpropertiesdialog.cpp +++ b/src/widgets/kpropertiesdialog.cpp @@ -984,42 +984,41 @@ } grid->addWidget(d->iconArea, curRow, 0, Qt::AlignCenter); - if (d->bMultiple || isTrash || hasRoot) { + KFileItemListProperties itemList(KFileItemList() << item); + if (d->bMultiple || isTrash || hasRoot || !itemList.supportsMoving() || (itemList.isDirectory() & !itemList.supportsWriting())) { QLabel *lab = new QLabel(d->m_frame); + lab->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); if (d->bMultiple) { lab->setText(KIO::itemsSummaryString(iFileCount + iDirCount, iFileCount, iDirCount, 0, false)); } else { lab->setText(filename); } d->nameArea = lab; + grid->addWidget(d->nameArea, curRow++, 2); } 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()); - - // Enhanced rename: Don't highlight the file extension. - QString extension = db.suffixForFileName(filename); - if (!extension.isEmpty()) { - d->m_lined->setSelection(0, filename.length() - extension.length() - 1); - } else { - int lastDot = filename.lastIndexOf('.'); - if (lastDot > 0) { - d->m_lined->setSelection(0, lastDot); - } - } - - connect(d->m_lined, SIGNAL(textChanged(QString)), - this, SLOT(nameFileChanged(QString))); + 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); + + // Enhanced rename: Don't highlight the file extension. + QString extension = db.suffixForFileName(filename); + if (!extension.isEmpty()) { + d->m_lined->setSelection(0, filename.length() - extension.length() - 1); + } else { + int lastDot = filename.lastIndexOf('.'); + if (lastDot > 0) { + d->m_lined->setSelection(0, lastDot); + } + } + + 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;