X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/76e3eab6ea3545339da2fd30b838acbc8c0ff607..91a4d5da94a6b0b60ad7989a402f654710103e99:/src/dolphinpart.cpp diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 0af0fd6b3..4ba1f0742 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -142,24 +141,21 @@ void DolphinPart::createActions() { // Edit menu - m_newFileMenu = new DolphinNewFileMenu(actionCollection(), this); + m_newFileMenu = new DolphinNewFileMenu(actionCollection()->action(QStringLiteral("create_dir")), this); m_newFileMenu->setParentWidget(widget()); -#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0) - m_newFileMenu->setNewFolderShortcutAction(actionCollection()->action("create_dir")); -#endif connect(m_newFileMenu->menu(), &QMenu::aboutToShow, this, &DolphinPart::updateNewMenu); QAction *editMimeTypeAction = actionCollection()->addAction(QStringLiteral("editMimeType")); - editMimeTypeAction->setText(i18nc("@action:inmenu Edit", "&Edit File Type...")); + editMimeTypeAction->setText(i18nc("@action:inmenu Edit", "&Edit File Type…")); connect(editMimeTypeAction, &QAction::triggered, this, &DolphinPart::slotEditMimeType); QAction *selectItemsMatching = actionCollection()->addAction(QStringLiteral("select_items_matching")); - selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching...")); + selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching…")); actionCollection()->setDefaultShortcut(selectItemsMatching, Qt::CTRL | Qt::Key_S); connect(selectItemsMatching, &QAction::triggered, this, &DolphinPart::slotSelectItemsMatchingPattern); QAction *unselectItemsMatching = actionCollection()->addAction(QStringLiteral("unselect_items_matching")); - unselectItemsMatching->setText(i18nc("@action:inmenu Edit", "Unselect Items Matching...")); + unselectItemsMatching->setText(i18nc("@action:inmenu Edit", "Unselect Items Matching…")); connect(unselectItemsMatching, &QAction::triggered, this, &DolphinPart::slotUnselectItemsMatchingPattern); KStandardAction::selectAll(m_view, &DolphinView::selectAll, actionCollection()); @@ -191,7 +187,7 @@ void DolphinPart::createActions() // Tools menu m_findFileAction = KStandardAction::find(this, &DolphinPart::slotFindFile, actionCollection()); - m_findFileAction->setText(i18nc("@action:inmenu Tools", "Find File...")); + m_findFileAction->setText(i18nc("@action:inmenu Tools", "Find File…")); #ifndef Q_OS_WIN if (KAuthorized::authorize(QStringLiteral("shell_access"))) { @@ -343,11 +339,7 @@ void DolphinPart::slotItemActivated(const KFileItem &item) args.setMimeType(item.mimetype()); } - // Ideally, konqueror should be changed to not require trustedSource for directory views, - // since the idea was not to need BrowserArguments for non-browser stuff... - KParts::BrowserArguments browserArgs; - browserArgs.trustedSource = true; - Q_EMIT m_extension->openUrlRequest(item.targetUrl(), args, browserArgs); + Q_EMIT m_extension->openUrlRequest(item.targetUrl(), args); } void DolphinPart::slotItemsActivated(const KFileItemList &items) @@ -396,7 +388,8 @@ void DolphinPart::slotOpenContextMenu(const QPoint &pos, const KFileItem &_item, const bool supportsMoving = capabilities.supportsMoving(); if (capabilities.supportsDeleting()) { - const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) || !item.isLocalFile()); + const bool showDeleteAction = + (KSharedConfig::openConfig()->group(QStringLiteral("KDE")).readEntry("ShowDeleteCommand", false) || !item.isLocalFile()); const bool showMoveToTrashAction = capabilities.isLocal() && supportsMoving; if (showDeleteAction && showMoveToTrashAction) { @@ -429,7 +422,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint &pos, const KFileItem &_item, actionGroups.insert(QStringLiteral("editactions"), editActions); - Q_EMIT m_extension->popupMenu(pos, items, KParts::OpenUrlArguments(), KParts::BrowserArguments(), popupFlags, actionGroups); + Q_EMIT m_extension->popupMenu(pos, items, KParts::OpenUrlArguments(), popupFlags, actionGroups); } void DolphinPart::slotDirectoryRedirection(const QUrl &oldUrl, const QUrl &newUrl) @@ -468,7 +461,7 @@ void DolphinPart::openSelectionDialog(const QString &title, const QString &text, dialog->setWindowTitle(title); dialog->setLabelText(text); - const KConfigGroup group = KSharedConfig::openConfig("dolphinpartrc")->group("Select Dialog"); + const KConfigGroup group = KSharedConfig::openConfig("dolphinpartrc")->group(QStringLiteral("Select Dialog")); dialog->setComboBoxEditable(true); dialog->setComboBoxItems(group.readEntry("History", QStringList())); @@ -483,7 +476,7 @@ void DolphinPart::openSelectionDialog(const QString &title, const QString &text, // Need to evaluate this again here, because the captured value is const // (even if the const were removed from 'const KConfigGroup group =' above). - KConfigGroup group = KSharedConfig::openConfig("dolphinpartrc")->group("Select Dialog"); + KConfigGroup group = KSharedConfig::openConfig("dolphinpartrc")->group(QStringLiteral("Select Dialog")); // Limit the size of the saved history. group.writeEntry("History", items.mid(0, 10)); group.sync(); @@ -552,11 +545,7 @@ void DolphinPart::updateNewMenu() // As requested by KNewFileMenu : m_newFileMenu->checkUpToDate(); // And set the files that the menu apply on : -#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0) m_newFileMenu->setWorkingDirectory(url()); -#else - m_newFileMenu->setPopupFiles(QList() << url()); -#endif } void DolphinPart::updateStatusBar() @@ -571,11 +560,7 @@ void DolphinPart::updateProgress(int percent) void DolphinPart::createDirectory() { -#if KIO_VERSION >= QT_VERSION_CHECK(5, 97, 0) m_newFileMenu->setWorkingDirectory(url()); -#else - m_newFileMenu->setPopupFiles(QList() << url()); -#endif m_newFileMenu->createDirectory(); } @@ -608,3 +593,4 @@ bool DolphinPart::eventFilter(QObject *obj, QEvent *event) } #include "dolphinpart.moc" +#include "moc_dolphinpart.cpp"