[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [calligra/calligra/2.9] krita/ui: Remove KisStandardActions
From: Boudewijn Rempt <boud () valdyas ! org>
Date: 2014-12-28 12:15:10
Message-ID: E1Y5CkY-000626-HW () scm ! kde ! org
[Download RAW message or body]
Git commit 3f0a162d70ef60c6795e7a3961bb9032055dbafa by Boudewijn Rempt.
Committed on 24/12/2014 at 14:37.
Pushed by rempt into branch 'calligra/2.9'.
Remove KisStandardActions
It had only one action, show guides, and that actually isn't used at
the moment...
M +0 -1 krita/ui/CMakeLists.txt
D +0 -66 krita/ui/KisStandardAction.cpp
D +0 -60 krita/ui/KisStandardAction.h
M +4 -4 krita/ui/kis_zoom_manager.cc
http://commits.kde.org/calligra/3f0a162d70ef60c6795e7a3961bb9032055dbafa
diff --git a/krita/ui/CMakeLists.txt b/krita/ui/CMakeLists.txt
index f447a2a..7176b70 100644
--- a/krita/ui/CMakeLists.txt
+++ b/krita/ui/CMakeLists.txt
@@ -302,7 +302,6 @@ set(kritaui_LIB_SRCS
KisPart.cpp
KisPrintJob.cpp
KisRecentDocumentsPane.cpp
- KisStandardAction.cpp
KisStartupDialog.cpp
KisTemplate.cpp
KisTemplateCreateDia.cpp
diff --git a/krita/ui/KisStandardAction.cpp b/krita/ui/KisStandardAction.cpp
deleted file mode 100644
index cf884b6..0000000
--- a/krita/ui/KisStandardAction.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* This file is part of the KDE libraries
- Copyright (C) 2009 Thomas Zander <zander@kde.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License version 2 as published by the Free Software Foundation.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "KisStandardAction.h"
-
-#include <kactioncollection.h>
-#include <ktoggleaction.h>
-#include <klocale.h>
-
-KAction *KisStandardAction::create(StandardAction id, const QObject *recvr, const \
char *slot, QObject *parent)
-{
- KAction *newAction = 0;
-
- switch (id) {
- case ShowGuides: {
- KToggleAction *toggle = new KToggleAction(i18n("Show Guides"), parent);
- toggle->setToolTip(i18n("Shows or hides guides"));
- newAction = toggle;
- break;
- }
- case ActionNone:
- return 0;
- }
-
- Q_ASSERT(newAction);
- newAction->setObjectName(name(id));
-
- if (recvr && slot)
- QObject::connect(newAction, SIGNAL(triggered(bool)), recvr, slot);
-
- KActionCollection *collection = qobject_cast<KActionCollection *>(parent);
- if (collection)
- collection->addAction(newAction->objectName(), newAction);
-
- return newAction;
-}
-
-const char* KisStandardAction::name(StandardAction id)
-{
- switch (id) {
- case ShowGuides:
- return "view_show_guides";
- default:
- return 0;
- };
-}
-
-KToggleAction *KisStandardAction::showGuides(const QObject *receiver, const char \
*slot, QObject *parent)
-{
- return static_cast<KToggleAction*>(create(ShowGuides, receiver, slot, parent));
-}
diff --git a/krita/ui/KisStandardAction.h b/krita/ui/KisStandardAction.h
deleted file mode 100644
index c8cde56..0000000
--- a/krita/ui/KisStandardAction.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* This file is part of the KDE libraries
- Copyright (C) 2009 Thomas Zander <zander@kde.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License version 2 as published by the Free Software Foundation.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-#ifndef KOSTANDARDACTION_H
-#define KOSTANDARDACTION_H
-
-#include "krita_export.h"
-
-class QObject;
-class KAction;
-class KToggleAction;
-
-/**
- * Convenience methods to access all standard Calligra actions.
- * See KStandardAction for usage details.
- */
-namespace KisStandardAction
-{
- /**
- * The standard actions.
- */
- enum StandardAction {
- ActionNone,
-
- ShowGuides
- };
-
- /**
- * Creates an action corresponding to the
- * KisStandardAction::StandardAction enum.
- */
- KRITAUI_EXPORT KAction* create(StandardAction id, const QObject *receiver, const \
char *slot, QObject *parent);
-
- /**
- * This will return the internal name of a given standard action.
- */
- KRITAUI_EXPORT const char* name(StandardAction id);
-
- /**
- * Show or hide guide lines
- */
- KRITAUI_EXPORT KToggleAction *showGuides(const QObject *receiver, const char \
*slot, QObject *parent);
-}
-
-#endif // KSTDACTION_H
-
diff --git a/krita/ui/kis_zoom_manager.cc b/krita/ui/kis_zoom_manager.cc
index d4dd163..7dd12cb 100644
--- a/krita/ui/kis_zoom_manager.cc
+++ b/krita/ui/kis_zoom_manager.cc
@@ -29,7 +29,6 @@
#include <ktoggleaction.h>
#include <kis_debug.h>
-#include <KisStandardAction.h>
#include <KisView.h>
#include <KoZoomAction.h>
#include <KoRuler.h>
@@ -126,10 +125,11 @@ void KisZoomManager::setup(KActionCollection * \
actionCollection)
"and can be used to position your mouse at \
the right place on the canvas. <p>Uncheck this to hide the \
rulers.</p>"));
connect(m_showRulersAction, SIGNAL(toggled(bool)), \
SLOT(toggleShowRulers(bool)));
- m_showGuidesAction = KisStandardAction::showGuides(this, SLOT(showGuides()), \
this);
- actionCollection->addAction(KisStandardAction::name(KisStandardAction::ShowGuides), \
m_showGuidesAction); + m_showGuidesAction = new KToggleAction(i18n("Show Guides"), \
this); + m_showGuidesAction->setToolTip(i18n("Shows or hides guides"));
m_showGuidesAction->setChecked(m_view->document()->guidesData().showGuideLines());
-
+ connect(m_showGuidesAction, SIGNAL(triggered(bool)), this, SLOT(showGuides()));
+ actionCollection->addAction("view_show_guides", m_showGuidesAction);
m_100pct = new KAction(i18n("Reset zoom"), this);
actionCollection->addAction("zoom_to_100pct", m_100pct);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic