Commit 4413d7ab authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

Revert "Remove conditional debug output"

This reverts commit fff60307.
parent 92dd3f6c
......@@ -249,12 +249,14 @@ void kpTransformResizeScaleCommand::scaleSelectionRegionWithDocument ()
// public virtual [base kpCommand]
void kpTransformResizeScaleCommand::execute ()
{
#if DEBUG_KP_TOOL_RESIZE_SCALE_COMMAND
qCDebug(kpLogCommands) << "kpTransformResizeScaleCommand::execute() type="
<< (int) m_type
<< " oldWidth=" << m_oldWidth
<< " oldHeight=" << m_oldHeight
<< " newWidth=" << m_newWidth
<< " newHeight=" << m_newHeight;
#endif
if (m_oldWidth == m_newWidth && m_oldHeight == m_newHeight)
return;
......@@ -370,8 +372,10 @@ void kpTransformResizeScaleCommand::execute ()
// public virtual [base kpCommand]
void kpTransformResizeScaleCommand::unexecute ()
{
#if DEBUG_KP_TOOL_RESIZE_SCALE_COMMAND
qCDebug(kpLogCommands) << "kpTransformResizeScaleCommand::unexecute() type="
<< m_type;
#endif
if (m_oldWidth == m_newWidth && m_oldHeight == m_newHeight) {
return;
......
......@@ -35,7 +35,6 @@
#include "mainWindow/kpMainWindow.h"
#include "tools/kpTool.h"
#include "commands/tools/selection/kpToolSelectionCreateCommand.h"
#include "kpLogCategories.h"
kpCommandHistory::kpCommandHistory (bool doReadConfig, kpMainWindow *mainWindow)
......@@ -94,10 +93,14 @@ void kpCommandHistory::addCreateSelectionCommand (kpToolSelectionCreateCommand *
// public slot virtual [base KCommandHistory]
void kpCommandHistory::undo ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistory::undo() CALLED!";
#endif
if (m_mainWindow && m_mainWindow->toolHasBegunShape ())
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\thas begun shape - cancel draw";
#endif
m_mainWindow->tool ()->cancelShapeInternal ();
}
else {
......
......@@ -142,8 +142,10 @@ int kpCommandHistoryBase::undoMinLimit () const
// public
void kpCommandHistoryBase::setUndoMinLimit (int limit)
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::setUndoMinLimit("
<< limit << ")";
#endif
if (limit < 1 || limit > 5000/*"ought to be enough for anybody"*/)
{
......@@ -170,8 +172,10 @@ int kpCommandHistoryBase::undoMaxLimit () const
// public
void kpCommandHistoryBase::setUndoMaxLimit (int limit)
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::setUndoMaxLimit("
<< limit << ")";
#endif
if (limit < 1 || limit > 5000/*"ought to be enough for anybody"*/)
{
......@@ -198,8 +202,10 @@ kpCommandSize::SizeType kpCommandHistoryBase::undoMaxLimitSizeLimit () const
// public
void kpCommandHistoryBase::setUndoMaxLimitSizeLimit (kpCommandSize::SizeType sizeLimit)
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::setUndoMaxLimitSizeLimit("
<< sizeLimit << ")";
#endif
if (sizeLimit < 0 ||
sizeLimit > (500 * 1048576)/*"ought to be enough for anybody"*/)
......@@ -221,7 +227,9 @@ void kpCommandHistoryBase::setUndoMaxLimitSizeLimit (kpCommandSize::SizeType siz
// public
void kpCommandHistoryBase::readConfig ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::readConfig()";
#endif
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupUndoRedo);
setUndoMinLimit (cfg.readEntry (kpSettingUndoMinLimit, undoMinLimit ()));
......@@ -236,7 +244,9 @@ void kpCommandHistoryBase::readConfig ()
// public
void kpCommandHistoryBase::writeConfig ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::writeConfig()";
#endif
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupUndoRedo);
cfg.writeEntry (kpSettingUndoMinLimit, undoMinLimit ());
......@@ -251,9 +261,11 @@ void kpCommandHistoryBase::writeConfig ()
// public
void kpCommandHistoryBase::addCommand (kpCommand *command, bool execute)
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::addCommand("
<< command
<< ",execute=" << execute << ")";
<< ",execute=" << execute << ")"
#endif
if (execute) {
command->execute ();
......@@ -262,7 +274,9 @@ void kpCommandHistoryBase::addCommand (kpCommand *command, bool execute)
m_undoCommandList.push_front (command);
::ClearPointerList (&m_redoCommandList);
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\tdocumentRestoredPosition=" << m_documentRestoredPosition;
#endif
if (m_documentRestoredPosition != INT_MAX)
{
if (m_documentRestoredPosition > 0) {
......@@ -271,7 +285,9 @@ void kpCommandHistoryBase::addCommand (kpCommand *command, bool execute)
else {
m_documentRestoredPosition--;
}
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\t\tdocumentRestoredPosition=" << m_documentRestoredPosition;
#endif
}
trimCommandListsUpdateActions ();
......@@ -280,7 +296,9 @@ void kpCommandHistoryBase::addCommand (kpCommand *command, bool execute)
// public
void kpCommandHistoryBase::clear ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::clear()";
#endif
::ClearPointerList (&m_undoCommandList);
::ClearPointerList (&m_redoCommandList);
......@@ -295,7 +313,9 @@ void kpCommandHistoryBase::clear ()
// protected slot
void kpCommandHistoryBase::undoInternal ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::undoInternal()";
#endif
kpCommand *undoCommand = nextUndoCommand ();
if (!undoCommand) {
......@@ -308,14 +328,17 @@ void kpCommandHistoryBase::undoInternal ()
m_undoCommandList.erase (m_undoCommandList.begin ());
m_redoCommandList.push_front (undoCommand);
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\tdocumentRestoredPosition=" << m_documentRestoredPosition;
#endif
if (m_documentRestoredPosition != INT_MAX)
{
m_documentRestoredPosition++;
if (m_documentRestoredPosition == 0)
emit documentRestored ();
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\t\tdocumentRestoredPosition=" << m_documentRestoredPosition;
#endif
}
}
......@@ -324,7 +347,9 @@ void kpCommandHistoryBase::undoInternal ()
// protected slot
void kpCommandHistoryBase::redoInternal ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::redoInternal()";
#endif
kpCommand *redoCommand = nextRedoCommand ();
if (!redoCommand) {
......@@ -337,14 +362,18 @@ void kpCommandHistoryBase::redoInternal ()
m_redoCommandList.erase (m_redoCommandList.begin ());
m_undoCommandList.push_front (redoCommand);
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\tdocumentRestoredPosition=" << m_documentRestoredPosition;
#endif
if (m_documentRestoredPosition != INT_MAX)
{
m_documentRestoredPosition--;
if (m_documentRestoredPosition == 0) {
emit documentRestored ();
}
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\t\tdocumentRestoredPosition=" << m_documentRestoredPosition;
#endif
}
}
......@@ -353,7 +382,9 @@ void kpCommandHistoryBase::redoInternal ()
// public slot virtual
void kpCommandHistoryBase::undo ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::undo()";
#endif
undoInternal ();
trimCommandListsUpdateActions ();
......@@ -364,7 +395,9 @@ void kpCommandHistoryBase::undo ()
// public slot virtual
void kpCommandHistoryBase::redo ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::redo()";
#endif
redoInternal ();
trimCommandListsUpdateActions ();
......@@ -375,7 +408,9 @@ void kpCommandHistoryBase::redo ()
// public slot virtual
void kpCommandHistoryBase::undoUpToNumber (QAction *which)
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::undoUpToNumber(" << which << ")";
#endif
for (int i = 0;
i <= which->data().toInt() && !m_undoCommandList.isEmpty ();
......@@ -390,7 +425,9 @@ void kpCommandHistoryBase::undoUpToNumber (QAction *which)
// public slot virtual
void kpCommandHistoryBase::redoUpToNumber (QAction *which)
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::redoUpToNumber(" << which << ")";
#endif
for (int i = 0;
i <= which->data().toInt() && !m_redoCommandList.isEmpty ();
......@@ -440,7 +477,9 @@ QString kpCommandHistoryBase::redoActionToolTip () const
// protected
void kpCommandHistoryBase::trimCommandListsUpdateActions ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::trimCommandListsUpdateActions()";
#endif
trimCommandLists ();
updateActions ();
......@@ -449,8 +488,10 @@ void kpCommandHistoryBase::trimCommandListsUpdateActions ()
// protected
void kpCommandHistoryBase::trimCommandList (QLinkedList <kpCommand *> *commandList)
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::trimCommandList()";
QTime timer; timer.start ();
#endif
if (!commandList)
{
......@@ -459,17 +500,24 @@ void kpCommandHistoryBase::trimCommandList (QLinkedList <kpCommand *> *commandLi
}
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\tsize=" << commandList->size ()
<< " undoMinLimit=" << m_undoMinLimit
<< " undoMaxLimit=" << m_undoMaxLimit
<< " undoMaxLimitSizeLimit=" << m_undoMaxLimitSizeLimit;
#endif
if (static_cast<int> (commandList->size ()) <= m_undoMinLimit)
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\t\tsize under undoMinLimit - done";
#endif
return;
}
#if DEBUG_KP_COMMAND_HISTORY && 0
qCDebug(kpLogCommands) << "\tsize over undoMinLimit - iterating thru cmds:";
#endif
QLinkedList <kpCommand *>::iterator it = commandList->begin ();
int upto = 0;
......@@ -485,10 +533,12 @@ void kpCommandHistoryBase::trimCommandList (QLinkedList <kpCommand *> *commandLi
sizeSoFar += (*it)->size ();
}
#if DEBUG_KP_COMMAND_HISTORY && 0
qCDebug(kpLogCommands) << "\t\t" << upto << ":"
<< " name='" << (*it)->name ()
<< "' size=" << (*it)->size ()
<< " sizeSoFar=" << sizeSoFar;
#endif
if (upto >= m_undoMinLimit)
{
......@@ -510,26 +560,36 @@ void kpCommandHistoryBase::trimCommandList (QLinkedList <kpCommand *> *commandLi
upto++;
}
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\ttook " << timer.elapsed () << "ms";
#endif
}
// protected
void kpCommandHistoryBase::trimCommandLists ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::trimCommandLists()";
#endif
trimCommandList (&m_undoCommandList);
trimCommandList (&m_redoCommandList);
qCDebug(kpLogCommands) << "\tdocumentRestoredPosition=" << m_documentRestoredPosition;
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\tdocumentRestoredPosition=" << m_documentRestoredPosition
#endif
if (m_documentRestoredPosition != INT_MAX)
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\t\tundoCmdList.size=" << m_undoCommandList.size ()
<< " redoCmdList.size=" << m_redoCommandList.size ();
#endif
if (m_documentRestoredPosition > static_cast<int> (m_redoCommandList.size ()) ||
-m_documentRestoredPosition > static_cast<int> (m_undoCommandList.size ()))
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\t\t\tinvalidate documentRestoredPosition";
#endif
m_documentRestoredPosition = INT_MAX;
}
}
......@@ -570,7 +630,9 @@ static void populatePopupMenu (QMenu *popupMenu,
// protected
void kpCommandHistoryBase::updateActions ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::updateActions()";
#endif
m_actionUndo->setEnabled (static_cast<bool> (nextUndoCommand ()));
// Don't want to keep changing toolbar text.
......@@ -582,12 +644,16 @@ void kpCommandHistoryBase::updateActions ()
// But in icon mode, a tooltip with context is useful.
m_actionUndo->setToolTip (undoActionToolTip ());
#if DEBUG_KP_COMMAND_HISTORY
QTime timer; timer.start ();
#endif
populatePopupMenu (m_actionUndo->menu (),
i18n ("Undo"),
m_undoCommandList);
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\tpopuplatePopupMenu undo=" << timer.elapsed ()
<< "ms";
#endif
m_actionRedo->setEnabled (static_cast<bool> (nextRedoCommand ()));
// Don't want to keep changing toolbar text.
......@@ -599,12 +665,16 @@ void kpCommandHistoryBase::updateActions ()
// But in icon mode, a tooltip with context is useful.
m_actionRedo->setToolTip (redoActionToolTip ());
#if DEBUG_KP_COMMAND_HISTORY
timer.restart ();
#endif
populatePopupMenu (m_actionRedo->menu (),
i18n ("Redo"),
m_redoCommandList);
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\tpopuplatePopupMenu redo=" << timer.elapsed ()
<< "ms";
#endif
}
......@@ -632,7 +702,9 @@ kpCommand *kpCommandHistoryBase::nextRedoCommand () const
// public
void kpCommandHistoryBase::setNextUndoCommand (kpCommand *command)
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::setNextUndoCommand("<< command << ")";
#endif
if (m_undoCommandList.isEmpty ()) {
return;
......@@ -648,7 +720,11 @@ void kpCommandHistoryBase::setNextUndoCommand (kpCommand *command)
// public slot virtual
void kpCommandHistoryBase::documentSaved ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpCommandHistoryBase::documentSaved()";
#endif
m_documentRestoredPosition = 0;
}
......@@ -31,12 +31,11 @@
#include "commands/kpCommandSize.h"
#include "layers/selections/kpAbstractSelection.h"
#include "kpLogCategories.h"
#include <QImage>
#include <QPolygon>
#include <QString>
#include <QDebug>
// public static
kpCommandSize::SizeType kpCommandSize::PixmapSize (const QImage &image)
......@@ -58,11 +57,13 @@ kpCommandSize::SizeType kpCommandSize::PixmapSize (int width, int height, int de
kpCommandSize::SizeType ret =
static_cast<kpCommandSize::SizeType> (width) * height * roundedDepth / 8;
#if DEBUG_KP_COMMAND_SIZE && 0
qCDebug(kpLogCommands) << "kpCommandSize::PixmapSize() w=" << width
<< " h=" << height
<< " d=" << depth
<< " roundedDepth=" << roundedDepth
<< " ret=" << ret;
#endif
return ret;
}
......@@ -87,11 +88,13 @@ kpCommandSize::SizeType kpCommandSize::QImageSize (int width, int height, int de
kpCommandSize::SizeType ret =
static_cast<kpCommandSize::SizeType> (width) * height * roundedDepth / 8;
#if DEBUG_KP_COMMAND_SIZE && 0
qCDebug(kpLogCommands) << "kpCommandSize::QImageSize() w=" << width
<< " h=" << height
<< " d=" << depth
<< " roundedDepth=" << roundedDepth
<< " ret=" << ret;
#endif
return ret;
}
......@@ -126,9 +129,11 @@ kpCommandSize::SizeType kpCommandSize::SelectionSize (const kpAbstractSelection
// public static
kpCommandSize::SizeType kpCommandSize::StringSize (const QString &string)
{
#if DEBUG_KP_COMMAND_SIZE && 1
qCDebug(kpLogCommands) << "kpCommandSize::StringSize(" << string << ")"
<< " len=" << string.length ()
<< " sizeof(QChar)=" << sizeof (QChar);
#endif
return static_cast<SizeType> (static_cast<unsigned int> (string.length ()) * sizeof (QChar));
}
......@@ -136,9 +141,11 @@ kpCommandSize::SizeType kpCommandSize::StringSize (const QString &string)
// public static
kpCommandSize::SizeType kpCommandSize::PolygonSize (const QPolygon &points)
{
#if DEBUG_KP_COMMAND_SIZE && 1
qCDebug(kpLogCommands) << "kpCommandSize::PolygonSize() points.size="
<< points.size ()
<< " sizeof(QPoint)=" << sizeof (QPoint);
#endif
return static_cast<SizeType> (static_cast<unsigned int> (points.size ()) * sizeof (QPoint));
}
......
......@@ -35,7 +35,6 @@
#include <climits>
#include <QtAlgorithms>
#include "kpLogCategories.h"
//---------------------------------------------------------------------
......@@ -63,18 +62,26 @@ kpMacroCommand::~kpMacroCommand ()
// public virtual [base kpCommand]
kpCommandSize::SizeType kpMacroCommand::size () const
{
#if DEBUG_KP_COMMAND_HISTORY && 0
qCDebug(kpLogCommands) << "kpMacroCommand::size()";
#endif
SizeType s = 0;
#if DEBUG_KP_COMMAND_HISTORY && 0
qCDebug(kpLogCommands) << "\tcalculating:";
for (auto *cmd : m_commandList)
#endif
foreach (kpCommand *cmd, m_commandList)
{
#if DEBUG_KP_COMMAND_HISTORY && 0
qCDebug(kpLogCommands) << "\t\tcurrentSize=" << s << " + "
<< cmd->name () << ".size=" << cmd->size ();
#endif
s += cmd->size ();
}
#if DEBUG_KP_COMMAND_HISTORY && 0
qCDebug(kpLogCommands) << "\treturning " << s;
#endif
return s;
}
......@@ -83,7 +90,9 @@ kpCommandSize::SizeType kpMacroCommand::size () const
// public virtual [base kpCommand]
void kpMacroCommand::execute ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpMacroCommand::execute()";
#endif
viewManager()->setQueueUpdates();
......@@ -91,7 +100,9 @@ void kpMacroCommand::execute ()
it != m_commandList.end ();
++it)
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\texecuting " << (*it)->name ();
#endif
(*it)->execute ();
}
......@@ -103,7 +114,9 @@ void kpMacroCommand::execute ()
// public virtual [base kpCommand]
void kpMacroCommand::unexecute ()
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "kpMacroCommand::unexecute()";
#endif
viewManager()->setQueueUpdates();
......@@ -112,7 +125,9 @@ void kpMacroCommand::unexecute ()
while (it != m_commandList.end ())
{
#if DEBUG_KP_COMMAND_HISTORY
qCDebug(kpLogCommands) << "\tunexecuting " << (*it)->name ();
#endif
(*it)->unexecute ();
it--;
......
......@@ -36,7 +36,6 @@
#include "pixmapfx/kpPixmapFX.h"
#include "tools/kpTool.h"
#include "views/manager/kpViewManager.h"
#include "kpLogCategories.h"
#include <QRect>
......@@ -103,12 +102,16 @@ void kpToolFlowCommand::updateBoundingRect (const QPoint &point)
// public
void kpToolFlowCommand::updateBoundingRect (const QRect &rect)
{
#if DEBUG_KP_TOOL_FLOW_COMMAND & 0
qCDebug(kpLogCommands) << "kpToolFlowCommand::updateBoundingRect() existing="
<< d->boundingRect
<< " plus="
<< rect;
#endif
d->boundingRect = d->boundingRect.united (rect);
#if DEBUG_KP_TOOL_FLOW_COMMAND & 0
qCDebug(kpLogCommands) << "\tresult=" << d->boundingRect;
#endif
}
// public
......
......@@ -98,8 +98,10 @@ void kpToolFloodFillCommand::setFillEntireImage (bool yes)
// protected virtual [base kpCommand]
void kpToolFloodFillCommand::execute ()
{
#if DEBUG_KP_TOOL_FLOOD_FILL && 1
qCDebug(kpLogCommands) << "kpToolFloodFillCommand::execute() fillEntireImage="
<< d->fillEntireImage;
#endif
kpDocument *doc = document ();
Q_ASSERT (doc);
......@@ -125,7 +127,9 @@ void kpToolFloodFillCommand::execute ()
}
else
{
#if DEBUG_KP_TOOL_FLOOD_FILL && 1
qCDebug(kpLogCommands) << "\tinvalid boundingRect - must be NOP case";
#endif
}
}
}
......@@ -135,8 +139,10 @@ void kpToolFloodFillCommand::execute ()
// protected virtual [base kpCommand]
void kpToolFloodFillCommand::unexecute ()
{
#if DEBUG_KP_TOOL_FLOOD_FILL && 1
qCDebug(kpLogCommands) << "kpToolFloodFillCommand::unexecute() fillEntireImage="
<< d->fillEntireImage;
#endif
kpDocument *doc = document ();
Q_ASSERT (doc);
......
......@@ -65,7 +65,9 @@ kpCommandSize::SizeType kpToolImageSelectionTransparencyCommand::size () const
// public virtual [base kpCommand]
void kpToolImageSelectionTransparencyCommand::execute ()
{
#if DEBUG_KP_TOOL_SELECTION && 1
qCDebug(kpLogCommands) << "kpToolImageSelectionTransparencyCommand::execute()";
#endif
kpSetOverrideCursorSaver cursorSaver (Qt::WaitCursor);
......@@ -79,7 +81,9 @@ void kpToolImageSelectionTransparencyCommand::execute ()
// public virtual [base kpCommand]
void kpToolImageSelectionTransparencyCommand::unexecute ()
{
#if DEBUG_KP_TOOL_SELECTION && 1
qCDebug(kpLogCommands) << "kpToolImageSelectionTransparencyCommand::unexecute()";
#endif
kpSetOverrideCursorSaver cursorSaver (Qt::WaitCursor);
......
......@@ -94,18 +94,23 @@ void kpToolSelectionCreateCommand::setFromSelection (const kpAbstractSelection &
// public virtual [base kpCommand]
void kpToolSelectionCreateCommand::execute ()
{
#if DEBUG_KP_TOOL_SELECTION
qCDebug(kpLogCommands) << "kpToolSelectionCreateCommand::execute()";
#endif
kpDocument *doc = document ();
Q_ASSERT (doc);
if (m_fromSelection)
{
#if DEBUG_KP_TOOL_SELECTION
qCDebug(kpLogCommands) << "\tusing fromSelection";
qCDebug(kpLogCommands) << "\t\thave sel=" << doc->selection ();
auto *imageSel = dynamic_cast <kpAbstractImageSelection *> (m_fromSelection);
auto *textSel = dynamic_cast <kpTextSelection *> (m_fromSelection);
qCDebug(kpLogCommands) << "\t\thave sel=" << doc->selection () << endl;