Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 51b09dbd authored by Alexander Potashev's avatar Alexander Potashev

Port Calligra to kundo2

This patch has been generated by "port-kundo2.sh forward".
parent f1fce612
......@@ -18,7 +18,7 @@
#include <qtest_kde.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include "kis_benchmark_values.h"
#include "kis_paint_device.h"
......
......@@ -18,7 +18,7 @@
*/
#include <qtest_kde.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include "kis_benchmark_values.h"
......
......@@ -19,7 +19,7 @@
#define KIS_CHANGE_FILTER_COMMAND_H
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include <QRect>
#include "kis_types.h"
#include <klocale.h>
......@@ -28,7 +28,7 @@
class KisNode;
template <typename T>
class KisChangeFilterCmd : public QUndoCommand
class KisChangeFilterCmd : public KUndo2Command
{
public:
......@@ -37,7 +37,7 @@ public:
KisFilterConfiguration* config,
const QString& before,
const QString& after)
: QUndoCommand(i18n("Change Filter")) {
: KUndo2Command(i18n("Change Filter")) {
m_node = node;
m_config = config;
m_before = before;
......
......@@ -19,7 +19,7 @@
#define KIS_CHANGE_GENERATOR_COMMAND_H_
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include <QRect>
#include "kis_types.h"
#include <klocale.h>
......@@ -28,7 +28,7 @@
class KisNode;
template <typename T>
class KisChangeGeneratorCmd : public QUndoCommand
class KisChangeGeneratorCmd : public KUndo2Command
{
public:
......@@ -37,7 +37,7 @@ public:
KisFilterConfiguration* config,
const QString& before,
const QString& after)
: QUndoCommand(i18n("Change Generator")) {
: KUndo2Command(i18n("Change Generator")) {
m_node = node;
m_config = config;
m_before = before;
......
......@@ -26,8 +26,8 @@
#include "kis_selection_mask.h"
#include "kis_pixel_selection.h"
KisDeselectGlobalSelectionCommand::KisDeselectGlobalSelectionCommand(KisImageWSP image, QUndoCommand * parent) :
QUndoCommand(i18n("Deselect"), parent)
KisDeselectGlobalSelectionCommand::KisDeselectGlobalSelectionCommand(KisImageWSP image, KUndo2Command * parent) :
KUndo2Command(i18n("Deselect"), parent)
, m_image(image)
{
}
......
......@@ -19,12 +19,12 @@
#define KIS_DESELECT_GLOBAL_SELECTION_COMMAND_H_
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include "kis_types.h"
/// The command for deselection the global selection of KisImage
class KRITAIMAGE_EXPORT KisDeselectGlobalSelectionCommand : public QUndoCommand
class KRITAIMAGE_EXPORT KisDeselectGlobalSelectionCommand : public KUndo2Command
{
public:
......@@ -33,7 +33,7 @@ public:
* @param image the image
* @param parent the parent command
*/
KisDeselectGlobalSelectionCommand(KisImageWSP image, QUndoCommand * parent = 0);
KisDeselectGlobalSelectionCommand(KisImageWSP image, KUndo2Command * parent = 0);
virtual ~KisDeselectGlobalSelectionCommand();
virtual void redo();
......
......@@ -25,7 +25,7 @@
KisImageCommand::KisImageCommand(const QString& name, KisImageWSP image)
: QUndoCommand(name)
: KUndo2Command(name)
, m_image(image)
{
}
......
......@@ -22,7 +22,7 @@
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include <QSize>
#include <QRect>
#include "kis_types.h"
......@@ -30,7 +30,7 @@
/// the base command for commands altering a KisImage
class KisImageCommand : public QUndoCommand
class KisImageCommand : public KUndo2Command
{
public:
......
......@@ -22,7 +22,7 @@
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include <QSize>
#include <QBitArray>
#include "kis_types.h"
......
......@@ -22,7 +22,7 @@
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include "kis_types.h"
#include "kis_image_command.h"
......
......@@ -22,7 +22,7 @@
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include <QSize>
#include <QBitArray>
......
......@@ -22,7 +22,7 @@
#include "commands/kis_layer_commands.h"
KisLayerCommand::KisLayerCommand(const QString& name, KisLayerSP layer) :
QUndoCommand(name), m_layer(layer)
KUndo2Command(name), m_layer(layer)
{
}
......
......@@ -19,14 +19,14 @@
#ifndef KIS_LAYER_COMMAND_H_
#define KIS_LAYER_COMMAND_H_
#include <QUndoCommand>
#include <kundo2command.h>
#include <krita_export.h>
#include "kis_types.h"
class KisLayer;
/// the base command for commands altering a layer
class KRITAIMAGE_EXPORT KisLayerCommand : public QUndoCommand
class KRITAIMAGE_EXPORT KisLayerCommand : public KUndo2Command
{
public:
......
......@@ -22,7 +22,7 @@
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include <QSize>
#include <QBitArray>
#include "kis_types.h"
......
......@@ -22,7 +22,7 @@
#include "kis_node.h"
KisNodeCommand::KisNodeCommand(const QString& name, KisNodeSP node)
: QUndoCommand(name), m_node(node)
: KUndo2Command(name), m_node(node)
{
}
......
......@@ -20,13 +20,13 @@
#define KIS_NODE_COMMAND_H_
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include "kis_types.h"
class KisNode;
/// the base command for commands altering a node
class KRITAIMAGE_EXPORT KisNodeCommand : public QUndoCommand
class KRITAIMAGE_EXPORT KisNodeCommand : public KUndo2Command
{
public:
......
......@@ -21,7 +21,7 @@
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include <QSize>
#include <QBitArray>
......@@ -32,7 +32,7 @@
#include "kis_types.h"
#include "kis_paint_device.h"
class KisPaintDeviceConvertTypeCommand : public QUndoCommand
class KisPaintDeviceConvertTypeCommand : public KUndo2Command
{
public:
......@@ -68,7 +68,7 @@ public:
virtual void redo() {
//QUndoStack calls redo(), so the first call needs to be blocked
//KUndo2QStack calls redo(), so the first call needs to be blocked
if (m_firstRedo) {
m_firstRedo = false;
return;
......
......@@ -26,8 +26,8 @@
#include "kis_selection_mask.h"
#include "kis_pixel_selection.h"
KisReselectGlobalSelectionCommand::KisReselectGlobalSelectionCommand(KisImageWSP image, QUndoCommand * parent) :
QUndoCommand(i18n("Reselect"), parent)
KisReselectGlobalSelectionCommand::KisReselectGlobalSelectionCommand(KisImageWSP image, KUndo2Command * parent) :
KUndo2Command(i18n("Reselect"), parent)
, m_image(image)
{
}
......
......@@ -19,11 +19,11 @@
#define KIS_RESELECT_GLOBAL_SELECTION_COMMAND_H
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include "kis_types.h"
/// The command for deselection the global selection of KisImage
class KRITAIMAGE_EXPORT KisReselectGlobalSelectionCommand : public QUndoCommand
class KRITAIMAGE_EXPORT KisReselectGlobalSelectionCommand : public KUndo2Command
{
public:
......@@ -32,7 +32,7 @@ public:
* @param image the image
* @param parent the parent command
*/
KisReselectGlobalSelectionCommand(KisImageWSP image, QUndoCommand * parent = 0);
KisReselectGlobalSelectionCommand(KisImageWSP image, KUndo2Command * parent = 0);
virtual ~KisReselectGlobalSelectionCommand();
virtual void redo();
......
......@@ -26,8 +26,8 @@
#include "kis_selection_mask.h"
#include "kis_pixel_selection.h"
KisSetGlobalSelectionCommand::KisSetGlobalSelectionCommand(KisImageWSP image, QUndoCommand * parent, KisSelectionSP selection) :
QUndoCommand(parent)
KisSetGlobalSelectionCommand::KisSetGlobalSelectionCommand(KisImageWSP image, KUndo2Command * parent, KisSelectionSP selection) :
KUndo2Command(parent)
, m_image(image)
{
m_oldSelection = m_image->globalSelection();
......
......@@ -19,11 +19,11 @@
#define KIS_SET_GLOBAL_SELECTION_COMMAND_H
#include <krita_export.h>
#include <QUndoCommand>
#include <kundo2command.h>
#include "kis_types.h"
/// The command for setting the global selection
class KRITAIMAGE_EXPORT KisSetGlobalSelectionCommand : public QUndoCommand
class KRITAIMAGE_EXPORT KisSetGlobalSelectionCommand : public KUndo2Command
{
public:
......@@ -33,7 +33,7 @@ public:
* @param parent the parent command
* @param selection the selection that will be set a global selection, if 0 a new selection will be created
*/
KisSetGlobalSelectionCommand(KisImageWSP image, QUndoCommand * parent = 0, KisSelectionSP selection = 0);
KisSetGlobalSelectionCommand(KisImageWSP image, KUndo2Command * parent = 0, KisSelectionSP selection = 0);
virtual ~KisSetGlobalSelectionCommand();
virtual void redo();
......
......@@ -109,7 +109,7 @@ bool KisColorSpaceConvertVisitor::convertPaintDevice(KisLayer* layer)
m_image->undoAdapter()->addCommand(propsCommand);
if (layer->original()) {
QUndoCommand* cmd = layer->original()->convertTo(m_dstColorSpace, m_renderingIntent);
KUndo2Command* cmd = layer->original()->convertTo(m_dstColorSpace, m_renderingIntent);
if (cmd)
m_image->undoAdapter()->addCommand(cmd);
else
......@@ -117,7 +117,7 @@ bool KisColorSpaceConvertVisitor::convertPaintDevice(KisLayer* layer)
}
if (layer->paintDevice()) {
QUndoCommand* cmd = layer->paintDevice()->convertTo(m_dstColorSpace, m_renderingIntent);
KUndo2Command* cmd = layer->paintDevice()->convertTo(m_dstColorSpace, m_renderingIntent);
if (cmd)
m_image->undoAdapter()->addCommand(cmd);
else
......@@ -125,7 +125,7 @@ bool KisColorSpaceConvertVisitor::convertPaintDevice(KisLayer* layer)
}
if (layer->projection()) {
QUndoCommand* cmd = layer->projection()->convertTo(m_dstColorSpace, m_renderingIntent);
KUndo2Command* cmd = layer->projection()->convertTo(m_dstColorSpace, m_renderingIntent);
if (cmd)
m_image->undoAdapter()->addCommand(cmd);
else
......
......@@ -57,7 +57,7 @@ public:
bool visit(KisExternalLayer *layer) {
KisUndoAdapter *undoAdapter = layer->image()->undoAdapter();
QUndoCommand* command = layer->crop(m_rect);
KUndo2Command* command = layer->crop(m_rect);
if (command)
undoAdapter->addCommand(command);
return true;
......@@ -125,7 +125,7 @@ private:
if (m_movelayers) {
QPoint oldPos(layer->x(), layer->y());
QPoint newPos(layer->x() - m_rect.x(), layer->y() - m_rect.y());
QUndoCommand *cmd = new KisNodeMoveCommand(layer, oldPos, newPos, layer->image());
KUndo2Command *cmd = new KisNodeMoveCommand(layer, oldPos, newPos, layer->image());
undoAdapter->addCommand(cmd);
}
return true;
......
......@@ -18,7 +18,7 @@
#include "kis_dumb_undo_adapter.h"
#include <QUndoCommand>
#include <kundo2command.h>
KisDumbUndoAdapter::KisDumbUndoAdapter()
......@@ -30,11 +30,11 @@ KisDumbUndoAdapter::~KisDumbUndoAdapter()
{
}
const QUndoCommand * KisDumbUndoAdapter::presentCommand() {
const KUndo2Command * KisDumbUndoAdapter::presentCommand() {
return 0;
}
void KisDumbUndoAdapter::addCommand(QUndoCommand *command) {
void KisDumbUndoAdapter::addCommand(KUndo2Command *command) {
command->redo();
notifyCommandAdded(command);
delete command;
......
......@@ -21,7 +21,7 @@
#include "kis_undo_adapter.h"
class QUndoCommand;
class KUndo2Command;
class KRITAIMAGE_EXPORT KisDumbUndoAdapter : public KisUndoAdapter
{
......@@ -30,9 +30,9 @@ public:
virtual ~KisDumbUndoAdapter();
public:
const QUndoCommand * presentCommand();
const KUndo2Command * presentCommand();
void addCommand(QUndoCommand *command);
void addCommand(KUndo2Command *command);
void undoLastCommand();
void beginMacro(const QString& macroName);
......
......@@ -29,7 +29,7 @@ class QString;
class QIcon;
class QDomDocument;
class QDomElement;
class QUndoCommand;
class KUndo2Command;
/**
A base interface for layers that are implemented outside the Krita
......@@ -45,12 +45,12 @@ public:
return KIcon("system-run");
}
virtual QUndoCommand* crop(const QRect & rect) {
virtual KUndo2Command* crop(const QRect & rect) {
Q_UNUSED(rect);
return 0;
}
virtual QUndoCommand* transform(double xscale, double yscale, double xshear, double yshear, double angle, qint32 translatex, qint32 translatey) {
virtual KUndo2Command* transform(double xscale, double yscale, double xshear, double yshear, double angle, qint32 translatex, qint32 translatey) {
Q_UNUSED(xscale);
Q_UNUSED(yscale);
Q_UNUSED(xshear);
......
......@@ -554,7 +554,7 @@ bool KisPaintDevice::read(KoStore *store)
return retval;
}
QUndoCommand* KisPaintDevice::convertTo(const KoColorSpace * dstColorSpace, KoColorConversionTransformation::Intent renderingIntent)
KUndo2Command* KisPaintDevice::convertTo(const KoColorSpace * dstColorSpace, KoColorConversionTransformation::Intent renderingIntent)
{
m_d->cache.invalidate();
dbgImage << this << colorSpace()->id() << dstColorSpace->id() << renderingIntent;
......
......@@ -34,7 +34,7 @@
#include <krita_export.h>
class QUndoCommand;
class KUndo2Command;
class QRect;
class QImage;
class QPoint;
......@@ -396,7 +396,7 @@ public:
*
* @return a command that can be used to undo the conversion.
*/
QUndoCommand* convertTo(const KoColorSpace * dstColorSpace, KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual);
KUndo2Command* convertTo(const KoColorSpace * dstColorSpace, KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual);
/**
* Changes the profile of the colorspace of this paint device to the given
......
......@@ -36,7 +36,7 @@
#include <QRect>
#include <QString>
#include <QStringList>
#include <QUndoCommand>
#include <kundo2command.h>
#include <kis_debug.h>
#include <klocale.h>
......
......@@ -33,7 +33,7 @@
class QPen;
class QRegion;
class QUndoCommand;
class KUndo2Command;
class QRect;
class QRectF;
class QStringList;
......
......@@ -24,7 +24,7 @@
#include "kis_layer.h"
#include "kis_undo_adapter.h"
KisSelectedTransactionData::KisSelectedTransactionData(const QString& name, KisNodeSP node, QUndoCommand* parent)
KisSelectedTransactionData::KisSelectedTransactionData(const QString& name, KisNodeSP node, KUndo2Command* parent)
: KisTransactionData(name, node->paintDevice(), parent)
, m_selTransaction(0)
, m_hadSelection(false /*device->hasSelection()*/)
......
......@@ -35,7 +35,7 @@ class KRITAIMAGE_EXPORT KisSelectedTransactionData : public KisTransactionData
{
public:
KisSelectedTransactionData(const QString& name, KisNodeSP node, QUndoCommand* parent = 0);
KisSelectedTransactionData(const QString& name, KisNodeSP node, KUndo2Command* parent = 0);
virtual ~KisSelectedTransactionData();
public:
......
......@@ -21,7 +21,7 @@
#include <krita_export.h>
class QRect;
class QUndoCommand;
class KUndo2Command;
class KisSelection;
class KRITAIMAGE_EXPORT KisSelectionComponent
......@@ -38,7 +38,7 @@ public:
virtual void moveX(qint32 x) { Q_UNUSED(x); }