X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/9f2bb143b5ee00eddaaebbfe83da2f2da9f18863..d0c71a1435bc9d:/src/panels/folders/folderspanel.cpp diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp index 020c41e55..73c3137d3 100644 --- a/src/panels/folders/folderspanel.cpp +++ b/src/panels/folders/folderspanel.cpp @@ -1,21 +1,8 @@ -/*************************************************************************** - * Copyright (C) 2006-2010 by Peter Penz * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ +/* + * SPDX-FileCopyrightText: 2006-2010 Peter Penz + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "folderspanel.h" @@ -30,13 +17,13 @@ #include "kitemviews/kitemlistselectionmanager.h" #include "treeviewcontextmenu.h" #include "views/draganddrophelper.h" -#include "views/renamedialog.h" #include #include #include #include #include +#include #include #include @@ -104,14 +91,14 @@ void FoldersPanel::rename(const KFileItem& item) const int index = m_model->index(item); m_controller->view()->editRole(index, "text"); } else { - RenameDialog* dialog = new RenameDialog(this, KFileItemList() << item); + KIO::RenameFileDialog* dialog = new KIO::RenameFileDialog(KFileItemList({item}), this); 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; @@ -258,7 +245,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));