X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/48b58f830a585b773435c9af5ee2fe8f0c7c641d..681d8bb6c:/src/panels/folders/folderspanel.cpp diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp index 61417dc5e..01f338461 100644 --- a/src/panels/folders/folderspanel.cpp +++ b/src/panels/folders/folderspanel.cpp @@ -105,16 +105,13 @@ void FoldersPanel::rename(const KFileItem& item) m_controller->view()->editRole(index, "text"); } else { RenameDialog* dialog = new RenameDialog(this, KFileItemList() << item); - dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->show(); - dialog->raise(); - dialog->activateWindow(); + dialog->open(); } } bool FoldersPanel::urlChanged() { - if (!url().isValid() || url().scheme().contains(QStringLiteral("search"))) { + if (!url().isValid() || url().scheme().contains(QLatin1String("search"))) { // Skip results shown by a search, as possible identical // directory names are useless without parent-path information. return false; @@ -181,7 +178,7 @@ void FoldersPanel::showEvent(QShowEvent* event) container->setEnabledFrame(false); QVBoxLayout* layout = new QVBoxLayout(this); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(container); } @@ -217,12 +214,10 @@ void FoldersPanel::slotItemMiddleClicked(int index) void FoldersPanel::slotItemContextMenuRequested(int index, const QPointF& pos) { - Q_UNUSED(pos); - const KFileItem fileItem = m_model->fileItem(index); QPointer contextMenu = new TreeViewContextMenu(this, fileItem); - contextMenu.data()->open(); + contextMenu.data()->open(pos.toPoint()); if (contextMenu.data()) { delete contextMenu.data(); } @@ -230,10 +225,8 @@ void FoldersPanel::slotItemContextMenuRequested(int index, const QPointF& pos) void FoldersPanel::slotViewContextMenuRequested(const QPointF& pos) { - Q_UNUSED(pos); - QPointer contextMenu = new TreeViewContextMenu(this, KFileItem()); - contextMenu.data()->open(); + contextMenu.data()->open(pos.toPoint()); if (contextMenu.data()) { delete contextMenu.data(); } @@ -265,7 +258,7 @@ void FoldersPanel::slotRoleEditingFinished(int index, const QByteArray& role, co if (role == "text") { const KFileItem item = m_model->fileItem(index); const QString newName = value.toString(); - if (!newName.isEmpty() && newName != item.text() && newName != QLatin1String(".") && newName != QLatin1String("..")) { + if (!newName.isEmpty() && newName != item.text() && newName != QLatin1Char('.') && newName != QLatin1String("..")) { const QUrl oldUrl = item.url(); QUrl newUrl = oldUrl.adjusted(QUrl::RemoveFilename); newUrl.setPath(newUrl.path() + KIO::encodeFileName(newName));