b30490e
From 106fe0496bc197d4b60d8b5a46a5e9d6b16cf6d4 Mon Sep 17 00:00:00 2001
b30490e
From: Anthony Fieroni <bvbfan@abv.bg>
b30490e
Date: Sun, 17 Jan 2021 21:06:47 +0200
b30490e
Subject: [PATCH 32/54] Remove duplicated actions provided by parent view
b30490e
b30490e
BUG: 426801
b30490e
b30490e
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
b30490e
---
b30490e
 karbon/ui/KarbonView.cpp | 73 ++++------------------------------------
b30490e
 karbon/ui/KarbonView.h   |  4 ---
b30490e
 2 files changed, 6 insertions(+), 71 deletions(-)
b30490e
b30490e
diff --git a/karbon/ui/KarbonView.cpp b/karbon/ui/KarbonView.cpp
b30490e
index c6946734755..8f30933ba53 100644
b30490e
--- a/karbon/ui/KarbonView.cpp
b30490e
+++ b/karbon/ui/KarbonView.cpp
b30490e
@@ -152,12 +152,12 @@ public:
b30490e
     Private(KarbonPart *part, KarbonDocument * doc)
b30490e
             : karbonPart(part), part(doc)
b30490e
             , colorBar(0), closePath(0), combinePath(0)
b30490e
-            , separatePath(0), reversePath(0), intersectPath(0), subtractPath(0)
b30490e
-            , unitePath(0), excludePath(0), pathSnapToGrid(0), configureAction(0)
b30490e
-            , deleteSelectionAction(0), clipObjects(0), unclipObjects(0)
b30490e
-            , flipVertical(0), flipHorizontal(0), viewAction(0)
b30490e
-            , snapGridAction(0), showPageMargins(0), showGuidesAction(0)
b30490e
-            , showPaletteAction(0)
b30490e
+            , separatePath(0), reversePath(0), intersectPath(0)
b30490e
+            , subtractPath(0), unitePath(0), excludePath(0)
b30490e
+            , pathSnapToGrid(0), configureAction(0), clipObjects(0)
b30490e
+            , unclipObjects(0), flipVertical(0), flipHorizontal(0)
b30490e
+            , viewAction(0), snapGridAction(0), showPageMargins(0)
b30490e
+            , showGuidesAction(0), showPaletteAction(0)
b30490e
             , status(0), cursorCoords(0), smallPreview(0)
b30490e
     {}
b30490e
 
b30490e
@@ -176,7 +176,6 @@ public:
b30490e
     QAction * excludePath;
b30490e
     QAction * pathSnapToGrid;
b30490e
     QAction * configureAction;
b30490e
-    QAction * deleteSelectionAction;
b30490e
     QAction * clipObjects;
b30490e
     QAction * unclipObjects;
b30490e
     QAction * flipVertical;
b30490e
@@ -472,41 +471,6 @@ void KarbonView::selectionDuplicate()
b30490e
     kopaCanvas()->toolProxy()->paste();
b30490e
 }
b30490e
 
b30490e
-void KarbonView::editSelectAll()
b30490e
-{
b30490e
-    KoSelection* selection = shapeManager()->selection();
b30490e
-    if (! selection) {
b30490e
-        return;
b30490e
-    }
b30490e
-    QList<KoShape*> shapes;
b30490e
-    for (int i = 0; i < kopaDocument()->pages().count(); ++i) {
b30490e
-        KoShapeLayer *l = dynamic_cast<KoShapeLayer*>(kopaDocument()->pages().at(i));
b30490e
-        shapes += l->shapes();
b30490e
-    }
b30490e
-    debugKarbonUi << "shapes.size() =" << shapes.size();
b30490e
-
b30490e
-    foreach(KoShape* shape, shapes) {
b30490e
-        selection->select(shape);
b30490e
-        shape->update();
b30490e
-    }
b30490e
-
b30490e
-    selectionChanged();
b30490e
-}
b30490e
-
b30490e
-void KarbonView::editDeselectAll()
b30490e
-{
b30490e
-    KoSelection* selection = shapeManager()->selection();
b30490e
-    if (selection)
b30490e
-        selection->deselectAll();
b30490e
-
b30490e
-    selectionChanged();
b30490e
-}
b30490e
-
b30490e
-void KarbonView::editDeleteSelection()
b30490e
-{
b30490e
-    kopaCanvas()->toolProxy()->deleteSelection();
b30490e
-}
b30490e
-
b30490e
 void KarbonView::selectionDistributeHorizontalCenter()
b30490e
 {
b30490e
     selectionDistribute(KoShapeDistributeCommand::HorizontalCenterDistribution);
b30490e
@@ -906,26 +870,10 @@ void KarbonView::initActions()
b30490e
     if (!mainWindow())
b30490e
         return;
b30490e
 
b30490e
-    // edit ----->
b30490e
-    QAction *action = actionCollection()->addAction(KStandardAction::Cut,  "edit_cut", 0, 0);
b30490e
-    new KoCutController(kopaCanvas(), action);
b30490e
-    action = actionCollection()->addAction(KStandardAction::Copy,  "edit_copy", 0, 0);
b30490e
-    new KoCopyController(kopaCanvas(), action);
b30490e
-    action = actionCollection()->addAction(KStandardAction::Paste,  "edit_paste", 0, 0);
b30490e
-    new KoPasteController(kopaCanvas(), action);
b30490e
-    actionCollection()->addAction(KStandardAction::SelectAll,  "edit_select_all", this, SLOT(editSelectAll()));
b30490e
-    actionCollection()->addAction(KStandardAction::Deselect,  "edit_deselect_all", this, SLOT(editDeselectAll()));
b30490e
-
b30490e
     QAction *actionImportGraphic  = new QAction(i18n("&Import Graphic..."), this);
b30490e
     actionCollection()->addAction("file_import", actionImportGraphic);
b30490e
     connect(actionImportGraphic, SIGNAL(triggered()), this, SLOT(fileImportGraphic()));
b30490e
 
b30490e
-    d->deleteSelectionAction  = new QAction(koIcon("edit-delete"), i18n("D&elete"), this);
b30490e
-    actionCollection()->addAction("edit_delete", d->deleteSelectionAction);
b30490e
-    d->deleteSelectionAction->setShortcut(QKeySequence("Del"));
b30490e
-    connect(d->deleteSelectionAction, SIGNAL(triggered()), this, SLOT(editDeleteSelection()));
b30490e
-    connect(kopaCanvas()->toolProxy(), SIGNAL(selectionChanged(bool)), d->deleteSelectionAction, SLOT(setEnabled(bool)));
b30490e
-
b30490e
     QAction *actionEditGuides = new QAction(koIcon("edit-guides"), i18n("Edit Guides"), this);
b30490e
     actionCollection()->addAction("edit_guides", actionEditGuides);
b30490e
     connect(actionEditGuides, SIGNAL(triggered()), this, SLOT(editGuides()));
b30490e
@@ -975,15 +923,6 @@ void KarbonView::initActions()
b30490e
     d->showPaletteAction->setChecked(true);
b30490e
     connect(d->showPaletteAction, SIGNAL(triggered()), this, SLOT(showPalette()));
b30490e
 
b30490e
-    action = actionCollection()->action("object_group");
b30490e
-    if (action) {
b30490e
-        action->setShortcut(QKeySequence("Ctrl+G"));
b30490e
-    }
b30490e
-    action = actionCollection()->action("object_ungroup");
b30490e
-    if (action) {
b30490e
-        action->setShortcut(QKeySequence("Ctrl+Shift+G"));
b30490e
-    }
b30490e
-
b30490e
     d->clipObjects  = new QAction(i18n("&Clip Object"), this);
b30490e
     actionCollection()->addAction("object_clip", d->clipObjects );
b30490e
     connect(d->clipObjects, SIGNAL(triggered()), this, SLOT(clipObjects()));
b30490e
diff --git a/karbon/ui/KarbonView.h b/karbon/ui/KarbonView.h
b30490e
index ffe4c2bbebd..017f59379f8 100644
b30490e
--- a/karbon/ui/KarbonView.h
b30490e
+++ b/karbon/ui/KarbonView.h
b30490e
@@ -84,10 +84,6 @@ public:
b30490e
     KarbonPaletteBarWidget *colorBar() const;
b30490e
 
b30490e
 public Q_SLOTS:
b30490e
-    // editing:
b30490e
-    void editSelectAll();
b30490e
-    void editDeselectAll();
b30490e
-    void editDeleteSelection();
b30490e
 
b30490e
     void selectionDuplicate();
b30490e
     void selectionDistributeHorizontalCenter();
b30490e
-- 
b30490e
2.31.1
b30490e