X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/f9bbbd82f43c40971f20a463ad63706ef6f91170..a4f16761fc273eb20f778c85e88c80a0d73db82a:/src/dolphinpart.cpp diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index b3b47304e..e0f06bc5f 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -18,50 +18,49 @@ */ #include "dolphinpart.h" -#include "dolphinremoveaction.h" -#include +#include "dolphindebug.h" +#include "dolphinnewfilemenu.h" +#include "dolphinpart_ext.h" +#include "dolphinremoveaction.h" +#include "kitemviews/kfileitemmodel.h" +#include "kitemviews/private/kfileitemmodeldirlister.h" +#include "views/dolphinnewfilemenuobserver.h" +#include "views/dolphinremoteencoding.h" +#include "views/dolphinview.h" +#include "views/dolphinviewactionhandler.h" #include #include -#include "dolphindebug.h" +#include +#include +#include #include +#include #include #include +#include #include #include -#include -#include -#include #include -#include -#include -#include - -#include "dolphinpart_ext.h" -#include "dolphinnewfilemenu.h" -#include "views/dolphinview.h" -#include "views/dolphinviewactionhandler.h" -#include "views/dolphinnewfilemenuobserver.h" -#include "views/dolphinremoteencoding.h" -#include "kitemviews/kfileitemmodel.h" -#include "kitemviews/private/kfileitemmodeldirlister.h" +#include -#include #include -#include #include #include #include -#include #include +#include +#include +#include +#include K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin();) DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args) : KParts::ReadOnlyPart(parent) - ,m_openTerminalAction(0) - ,m_removeAction(0) + ,m_openTerminalAction(nullptr) + ,m_removeAction(nullptr) { Q_UNUSED(args) setComponentData(*createAboutData(), false); @@ -174,7 +173,7 @@ void DolphinPart::createActions() QAction* selectItemsMatching = actionCollection()->addAction(QStringLiteral("select_items_matching")); selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching...")); - actionCollection()->setDefaultShortcut(selectItemsMatching, Qt::CTRL | Qt::Key_S); + actionCollection()->setDefaultShortcut(selectItemsMatching, Qt::CTRL + Qt::Key_S); connect(selectItemsMatching, &QAction::triggered, this, &DolphinPart::slotSelectItemsMatchingPattern); QAction* unselectItemsMatching = actionCollection()->addAction(QStringLiteral("unselect_items_matching")); @@ -189,7 +188,7 @@ void DolphinPart::createActions() QAction* invertSelection = actionCollection()->addAction(QStringLiteral("invert_selection")); invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection")); - actionCollection()->setDefaultShortcut(invertSelection, Qt::CTRL | Qt::SHIFT | Qt::Key_A); + actionCollection()->setDefaultShortcut(invertSelection, Qt::CTRL + Qt::SHIFT + Qt::Key_A); connect(invertSelection, &QAction::triggered, m_view, &DolphinView::invertSelection); // View menu: all done by DolphinViewActionHandler @@ -219,10 +218,11 @@ void DolphinPart::createActions() // Tools menu m_findFileAction = actionCollection()->addAction(QStringLiteral("find_file")); m_findFileAction->setText(i18nc("@action:inmenu Tools", "Find File...")); - actionCollection()->setDefaultShortcut(m_findFileAction, Qt::CTRL | Qt::Key_F); + actionCollection()->setDefaultShortcut(m_findFileAction, Qt::CTRL + Qt::Key_F); m_findFileAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-find"))); connect(m_findFileAction, &QAction::triggered, this, &DolphinPart::slotFindFile); +#ifndef Q_OS_WIN if (KAuthorized::authorize(QStringLiteral("shell_access"))) { m_openTerminalAction = actionCollection()->addAction(QStringLiteral("open_terminal")); m_openTerminalAction->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); @@ -230,6 +230,7 @@ void DolphinPart::createActions() connect(m_openTerminalAction, &QAction::triggered, this, &DolphinPart::slotOpenTerminal); actionCollection()->setDefaultShortcut(m_openTerminalAction, Qt::Key_F4); } +#endif } void DolphinPart::createGoAction(const char* name, const char* iconName, @@ -316,7 +317,7 @@ bool DolphinPart::openUrl(const QUrl &url) QString prettyUrl = visibleUrl.toDisplayString(QUrl::PreferLocalFile); emit setWindowCaption(prettyUrl); emit m_extension->setLocationBarUrl(prettyUrl); - emit started(0); // get the wheel to spin + emit started(nullptr); // get the wheel to spin m_view->setNameFilter(m_nameFilter); m_view->setUrl(url); updatePasteAction(); @@ -431,7 +432,7 @@ void DolphinPart::slotOpenContextMenu(const QPoint& pos, if (showDeleteAction && showMoveToTrashAction) { delete m_removeAction; - m_removeAction = 0; + m_removeAction = nullptr; editActions.append(actionCollection()->action(KStandardAction::name(KStandardAction::MoveToTrash))); editActions.append(actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile))); } else if (showDeleteAction && !showMoveToTrashAction) {