[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [calligra] libs/flake: remove unused and buggy command KoSeparatePathCommand
From: Jan Hambrecht <jaham () gmx ! net>
Date: 2012-06-09 21:52:53
Message-ID: 20120609215253.D826BA60D2 () git ! kde ! org
[Download RAW message or body]
Git commit ef6816a1f71c08a87c597b7dea6122d4111a6d68 by Jan Hambrecht.
Committed on 09/06/2012 at 04:16.
Pushed by jaham into branch 'master'.
remove unused and buggy command KoSeparatePathCommand
M +0 -2 libs/flake/CMakeLists.txt
D +0 -101 libs/flake/commands/KoPathSeparateCommand.cpp
D +0 -53 libs/flake/commands/KoPathSeparateCommand.h
http://commits.kde.org/calligra/ef6816a1f71c08a87c597b7dea6122d4111a6d68
diff --git a/libs/flake/CMakeLists.txt b/libs/flake/CMakeLists.txt
index 2b74350..15b6e6c 100644
--- a/libs/flake/CMakeLists.txt
+++ b/libs/flake/CMakeLists.txt
@@ -147,7 +147,6 @@ set(flake_SRCS
commands/KoPathBreakAtPointCommand.cpp
commands/KoPathSegmentTypeCommand.cpp
commands/KoPathCombineCommand.cpp
- commands/KoPathSeparateCommand.cpp
commands/KoSubpathRemoveCommand.cpp
commands/KoSubpathJoinCommand.cpp
commands/KoParameterHandleMoveCommand.cpp
@@ -324,7 +323,6 @@ install(
commands/KoPathPointTypeCommand.h
commands/KoPathReverseCommand.h
commands/KoPathSegmentTypeCommand.h
- commands/KoPathSeparateCommand.h
commands/KoShapeAlignCommand.h
commands/KoShapeBackgroundCommand.h
commands/KoShapeStrokeCommand.h
diff --git a/libs/flake/commands/KoPathSeparateCommand.cpp \
b/libs/flake/commands/KoPathSeparateCommand.cpp deleted file mode 100644
index acf3824..0000000
--- a/libs/flake/commands/KoPathSeparateCommand.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (C) 2006 Jan Hambrecht <jaham@gmx.net>
- * Copyright (C) 2006,2007 Thorsten Zachmann <zachmann@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 as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * 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 "KoPathSeparateCommand.h"
-#include "KoShapeBasedDocumentBase.h"
-#include "KoPathShape.h"
-#include <klocale.h>
-
-class KoPathSeparateCommand::Private
-{
-public:
- Private(KoShapeBasedDocumentBase *c, const QList<KoPathShape*> &p)
- : controller(c),
- paths(p),
- isSeparated(false) {
- }
-
- ~Private() {
- if (isSeparated && controller) {
- foreach(KoPathShape* p, paths)
- delete p;
- } else {
- foreach(KoPathShape* p, separatedPaths)
- delete p;
- }
- }
-
- KoShapeBasedDocumentBase *controller;
- QList<KoPathShape*> paths;
- QList<KoPathShape*> separatedPaths;
- bool isSeparated;
-};
-
-
-KoPathSeparateCommand::KoPathSeparateCommand(KoShapeBasedDocumentBase *controller, \
const QList<KoPathShape*> &paths, KUndo2Command *parent)
- : KUndo2Command(parent),
- d(new Private(controller, paths))
-{
- setText(i18nc("(qtundo-format)", "Separate paths"));
-}
-
-KoPathSeparateCommand::~KoPathSeparateCommand()
-{
- delete d;
-}
-
-void KoPathSeparateCommand::redo()
-{
- KUndo2Command::redo();
- if (d->separatedPaths.isEmpty()) {
- foreach(KoPathShape* p, d->paths) {
- QList<KoPathShape*> separatedPaths;
- if (p->separate(separatedPaths))
- d->separatedPaths << separatedPaths;
- }
- }
-
- d->isSeparated = true;
-
- if (d->controller) {
- foreach(KoPathShape* p, d->paths)
- d->controller->removeShape(p);
- foreach(KoPathShape *p, d->separatedPaths)
- d->controller->addShape(p);
- }
- foreach(KoPathShape* p, d->paths)
- p->update();
-}
-
-void KoPathSeparateCommand::undo()
-{
- KUndo2Command::undo();
- if (d->controller) {
- foreach(KoPathShape *p, d->separatedPaths)
- d->controller->removeShape(p);
- foreach(KoPathShape* p, d->paths)
- d->controller->addShape(p);
- }
-
- d->isSeparated = false;
-
- foreach(KoPathShape* p, d->paths)
- p->update();
-}
diff --git a/libs/flake/commands/KoPathSeparateCommand.h \
b/libs/flake/commands/KoPathSeparateCommand.h deleted file mode 100644
index 3bfbe1b..0000000
--- a/libs/flake/commands/KoPathSeparateCommand.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (C) 2006 Jan Hambrecht <jaham@gmx.net>
- * Copyright (C) 2006,2007 Thorsten Zachmann <zachmann@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 as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * 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 KOPATHSEPARATECOMMAND_H
-#define KOPATHSEPARATECOMMAND_H
-
-#include <kundo2command.h>
-#include <QList>
-#include "flake_export.h"
-
-class KoPathShape;
-class KoShapeBasedDocumentBase;
-
-/// The undo / redo command for separating subpaths into different paths
-class FLAKE_EXPORT KoPathSeparateCommand : public KUndo2Command
-{
-public:
- /**
- * Command for separating subpaths of a list of paths into different paths.
- * @param controller the controller to used for removing/inserting.
- * @param paths the list of paths to separate
- * @param parent the parent command used for macro commands
- */
- KoPathSeparateCommand(KoShapeBasedDocumentBase *controller, const \
QList<KoPathShape*> &paths,
- KUndo2Command *parent = 0);
- virtual ~KoPathSeparateCommand();
- /// redo the command
- void redo();
- /// revert the actions done in redo
- void undo();
-private:
- class Private;
- Private * const d;
-};
-
-#endif // KOPATHSEPARATECOMMAND_H
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic