diff --git a/commands/imagelib/effects/kpEffectBlurSharpenCommand.cpp b/commands/imagelib/effects/kpEffectBlurSharpenCommand.cpp --- a/commands/imagelib/effects/kpEffectBlurSharpenCommand.cpp +++ b/commands/imagelib/effects/kpEffectBlurSharpenCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_BLUR_SHARPEN 0 - - #include "kpEffectBlurSharpenCommand.h" #include diff --git a/commands/imagelib/effects/kpEffectEmbossCommand.cpp b/commands/imagelib/effects/kpEffectEmbossCommand.cpp --- a/commands/imagelib/effects/kpEffectEmbossCommand.cpp +++ b/commands/imagelib/effects/kpEffectEmbossCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_EMBOSS 0 - - #include "kpEffectEmbossCommand.h" #include "imagelib/effects/kpEffectEmboss.h" diff --git a/commands/imagelib/effects/kpEffectFlattenCommand.cpp b/commands/imagelib/effects/kpEffectFlattenCommand.cpp --- a/commands/imagelib/effects/kpEffectFlattenCommand.cpp +++ b/commands/imagelib/effects/kpEffectFlattenCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_FLATTEN 0 - - #include "kpEffectFlattenCommand.h" #include "imagelib/effects/kpEffectFlatten.h" diff --git a/commands/imagelib/effects/kpEffectReduceColorsCommand.cpp b/commands/imagelib/effects/kpEffectReduceColorsCommand.cpp --- a/commands/imagelib/effects/kpEffectReduceColorsCommand.cpp +++ b/commands/imagelib/effects/kpEffectReduceColorsCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_REDUCE_COLORS 0 - - #include "kpEffectReduceColorsCommand.h" #include "imagelib/effects/kpEffectReduceColors.h" diff --git a/commands/imagelib/transforms/kpTransformResizeScaleCommand.cpp b/commands/imagelib/transforms/kpTransformResizeScaleCommand.cpp --- a/commands/imagelib/transforms/kpTransformResizeScaleCommand.cpp +++ b/commands/imagelib/transforms/kpTransformResizeScaleCommand.cpp @@ -25,11 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_RESIZE_SCALE_COMMAND 0 -#define DEBUG_KP_TOOL_RESIZE_SCALE_DIALOG 0 - - #include "kpTransformResizeScaleCommand.h" #include "layers/selections/image/kpAbstractImageSelection.h" @@ -188,10 +183,7 @@ // private void kpTransformResizeScaleCommand::scaleSelectionRegionWithDocument () { -#if DEBUG_KP_TOOL_RESIZE_SCALE_COMMAND - qCDebug(kpLogCommands) << "kpTransformResizeScaleCommand::scaleSelectionRegionWithDocument" - << endl; -#endif + qCDebug(kpLogCommands) << "kpTransformResizeScaleCommand::scaleSelectionRegionWithDocument"; Q_ASSERT (m_oldSelectionPtr); Q_ASSERT (!m_oldSelectionPtr->hasContent ()); diff --git a/commands/imagelib/transforms/kpTransformRotateCommand.cpp b/commands/imagelib/transforms/kpTransformRotateCommand.cpp --- a/commands/imagelib/transforms/kpTransformRotateCommand.cpp +++ b/commands/imagelib/transforms/kpTransformRotateCommand.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_ROTATE 0 - - #include "kpTransformRotateCommand.h" #include "layers/selections/image/kpAbstractImageSelection.h" @@ -158,14 +155,11 @@ // TODO: fix the latter "victim of" problem in kpAbstractImageSelection by // allowing the border width & height != pixmap width & height // Or maybe autocrop? - #if DEBUG_KP_TOOL_ROTATE qCDebug(kpLogCommands) << "kpTransformRotateCommand::execute() currentPoints.boundingRect=" << currentPoints.boundingRect () << " newPixmap: w=" << newImage.width () << " h=" << newImage.height () - << " (victim of rounding error and/or rotated-a-(rectangular)-pixmap-that-was-transparent-in-the-corners-making-sel-uselessly-bigger-than-needs-be)" - << endl; - #endif + << " (victim of rounding error and/or rotated-a-(rectangular)-pixmap-that-was-transparent-in-the-corners-making-sel-uselessly-bigger-than-needs-be)"; doc->setSelection ( kpRectangularImageSelection ( QRect (newTopLeft.x (), newTopLeft.y (), diff --git a/commands/imagelib/transforms/kpTransformSkewCommand.cpp b/commands/imagelib/transforms/kpTransformSkewCommand.cpp --- a/commands/imagelib/transforms/kpTransformSkewCommand.cpp +++ b/commands/imagelib/transforms/kpTransformSkewCommand.cpp @@ -25,11 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SKEW 0 -#define DEBUG_KP_TOOL_SKEW_DIALOG 0 - - #include "kpTransformSkewCommand.h" #include "layers/selections/image/kpAbstractImageSelection.h" @@ -145,14 +140,11 @@ // TODO: fix the latter "victim of" problem in kpAbstractImageSelection by // allowing the border width & height != pixmap width & height // Or maybe autocrop? - #if DEBUG_KP_TOOL_SKEW qCDebug(kpLogCommands) << "kpTransformSkewCommand::execute() currentPoints.boundingRect=" << currentPoints.boundingRect () << " newPixmap: w=" << newImage.width () << " h=" << newImage.height () - << " (victim of rounding error and/or skewed-a-(rectangular)-pixmap-that-was-transparent-in-the-corners-making-sel-uselessly-bigger-than-needs-be))" - << endl; - #endif + << " (victim of rounding error and/or skewed-a-(rectangular)-pixmap-that-was-transparent-in-the-corners-making-sel-uselessly-bigger-than-needs-be))"; doc->setSelection ( kpRectangularImageSelection ( QRect (currentPoints.boundingRect ().x (), diff --git a/commands/kpCommand.cpp b/commands/kpCommand.cpp --- a/commands/kpCommand.cpp +++ b/commands/kpCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_COMMAND_HISTORY 0 - - #include "kpCommand.h" #include "environments/commands/kpCommandEnvironment.h" diff --git a/commands/kpCommandHistory.cpp b/commands/kpCommandHistory.cpp --- a/commands/kpCommandHistory.cpp +++ b/commands/kpCommandHistory.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_COMMAND_HISTORY 0 - - #include "kpCommandHistory.h" #include "layers/selections/kpAbstractSelection.h" diff --git a/commands/kpCommandHistoryBase.cpp b/commands/kpCommandHistoryBase.cpp --- a/commands/kpCommandHistoryBase.cpp +++ b/commands/kpCommandHistoryBase.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_COMMAND_HISTORY 0 - - #include "kpCommandHistoryBase.h" #include @@ -513,9 +509,7 @@ if (upto >= m_undoMaxLimit || sizeSoFar > m_undoMaxLimitSizeLimit) { - #if DEBUG_KP_COMMAND_HISTORY && 0 qCDebug(kpLogCommands) << "\t\t\tkill"; - #endif delete (*it); it = m_undoCommandList.erase (it); advanceIt = false; diff --git a/commands/kpCommandSize.cpp b/commands/kpCommandSize.cpp --- a/commands/kpCommandSize.cpp +++ b/commands/kpCommandSize.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_COMMAND_SIZE 0 - - #include "commands/kpCommandSize.h" #include "layers/selections/kpAbstractSelection.h" #include "kpLogCategories.h" diff --git a/commands/kpMacroCommand.cpp b/commands/kpMacroCommand.cpp --- a/commands/kpMacroCommand.cpp +++ b/commands/kpMacroCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_COMMAND_HISTORY 0 - - #include "commands/kpMacroCommand.h" #include "views/manager/kpViewManager.h" diff --git a/commands/tools/flow/kpToolFlowCommand.cpp b/commands/tools/flow/kpToolFlowCommand.cpp --- a/commands/tools/flow/kpToolFlowCommand.cpp +++ b/commands/tools/flow/kpToolFlowCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_FLOW_COMMAND 0 - - #include "kpToolFlowCommand.h" #include "document/kpDocument.h" @@ -40,7 +36,6 @@ #include - struct kpToolFlowCommandPrivate { kpImage image; diff --git a/commands/tools/kpToolColorPickerCommand.cpp b/commands/tools/kpToolColorPickerCommand.cpp --- a/commands/tools/kpToolColorPickerCommand.cpp +++ b/commands/tools/kpToolColorPickerCommand.cpp @@ -24,11 +24,6 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - - -#define DEBUG_KP_TOOL_COLOR_PICKER 0 - - #include "kpToolColorPickerCommand.h" #include "environments/commands/kpCommandEnvironment.h" diff --git a/commands/tools/kpToolFloodFillCommand.cpp b/commands/tools/kpToolFloodFillCommand.cpp --- a/commands/tools/kpToolFloodFillCommand.cpp +++ b/commands/tools/kpToolFloodFillCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_FLOOD_FILL 0 - - #include "kpToolFloodFillCommand.h" #include "imagelib/kpColor.h" diff --git a/commands/tools/polygonal/kpToolPolygonalCommand.cpp b/commands/tools/polygonal/kpToolPolygonalCommand.cpp --- a/commands/tools/polygonal/kpToolPolygonalCommand.cpp +++ b/commands/tools/polygonal/kpToolPolygonalCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_POLYGON 0 - - #include "kpToolPolygonalCommand.h" #include "document/kpDocument.h" diff --git a/commands/tools/rectangular/kpToolRectangularCommand.cpp b/commands/tools/rectangular/kpToolRectangularCommand.cpp --- a/commands/tools/rectangular/kpToolRectangularCommand.cpp +++ b/commands/tools/rectangular/kpToolRectangularCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_RECTANGULAR_COMMAND 0 - - #include "kpToolRectangularCommand.h" #include "imagelib/kpColor.h" diff --git a/commands/tools/selection/kpToolImageSelectionTransparencyCommand.cpp b/commands/tools/selection/kpToolImageSelectionTransparencyCommand.cpp --- a/commands/tools/selection/kpToolImageSelectionTransparencyCommand.cpp +++ b/commands/tools/selection/kpToolImageSelectionTransparencyCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpToolImageSelectionTransparencyCommand.h" #include "environments/commands/kpCommandEnvironment.h" diff --git a/commands/tools/selection/kpToolSelectionCreateCommand.cpp b/commands/tools/selection/kpToolSelectionCreateCommand.cpp --- a/commands/tools/selection/kpToolSelectionCreateCommand.cpp +++ b/commands/tools/selection/kpToolSelectionCreateCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "commands/tools/selection/kpToolSelectionCreateCommand.h" #include "layers/selections/kpAbstractSelection.h" diff --git a/commands/tools/selection/kpToolSelectionDestroyCommand.cpp b/commands/tools/selection/kpToolSelectionDestroyCommand.cpp --- a/commands/tools/selection/kpToolSelectionDestroyCommand.cpp +++ b/commands/tools/selection/kpToolSelectionDestroyCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpToolSelectionDestroyCommand.h" #include "kpLogCategories.h" #include "layers/selections/kpAbstractSelection.h" diff --git a/commands/tools/selection/kpToolSelectionMoveCommand.cpp b/commands/tools/selection/kpToolSelectionMoveCommand.cpp --- a/commands/tools/selection/kpToolSelectionMoveCommand.cpp +++ b/commands/tools/selection/kpToolSelectionMoveCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpToolSelectionMoveCommand.h" #include "layers/selections/kpAbstractSelection.h" diff --git a/commands/tools/selection/kpToolSelectionPullFromDocumentCommand.cpp b/commands/tools/selection/kpToolSelectionPullFromDocumentCommand.cpp --- a/commands/tools/selection/kpToolSelectionPullFromDocumentCommand.cpp +++ b/commands/tools/selection/kpToolSelectionPullFromDocumentCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpToolSelectionPullFromDocumentCommand.h" #include "layers/selections/image/kpAbstractImageSelection.h" diff --git a/commands/tools/selection/kpToolSelectionResizeScaleCommand.cpp b/commands/tools/selection/kpToolSelectionResizeScaleCommand.cpp --- a/commands/tools/selection/kpToolSelectionResizeScaleCommand.cpp +++ b/commands/tools/selection/kpToolSelectionResizeScaleCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpToolSelectionResizeScaleCommand.h" #include "layers/selections/kpAbstractSelection.h" diff --git a/commands/tools/selection/text/kpToolTextBackspaceCommand.cpp b/commands/tools/selection/text/kpToolTextBackspaceCommand.cpp --- a/commands/tools/selection/text/kpToolTextBackspaceCommand.cpp +++ b/commands/tools/selection/text/kpToolTextBackspaceCommand.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "kpToolTextBackspaceCommand.h" #include "layers/selections/text/kpTextSelection.h" diff --git a/commands/tools/selection/text/kpToolTextChangeStyleCommand.cpp b/commands/tools/selection/text/kpToolTextChangeStyleCommand.cpp --- a/commands/tools/selection/text/kpToolTextChangeStyleCommand.cpp +++ b/commands/tools/selection/text/kpToolTextChangeStyleCommand.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "kpToolTextChangeStyleCommand.h" #include "environments/commands/kpCommandEnvironment.h" diff --git a/commands/tools/selection/text/kpToolTextDeleteCommand.cpp b/commands/tools/selection/text/kpToolTextDeleteCommand.cpp --- a/commands/tools/selection/text/kpToolTextDeleteCommand.cpp +++ b/commands/tools/selection/text/kpToolTextDeleteCommand.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "kpToolTextDeleteCommand.h" #include "layers/selections/text/kpTextSelection.h" diff --git a/commands/tools/selection/text/kpToolTextEnterCommand.cpp b/commands/tools/selection/text/kpToolTextEnterCommand.cpp --- a/commands/tools/selection/text/kpToolTextEnterCommand.cpp +++ b/commands/tools/selection/text/kpToolTextEnterCommand.cpp @@ -24,10 +24,6 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_TEXT 0 - - #include "kpToolTextEnterCommand.h" #include "layers/selections/text/kpTextSelection.h" diff --git a/commands/tools/selection/text/kpToolTextGiveContentCommand.cpp b/commands/tools/selection/text/kpToolTextGiveContentCommand.cpp --- a/commands/tools/selection/text/kpToolTextGiveContentCommand.cpp +++ b/commands/tools/selection/text/kpToolTextGiveContentCommand.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpToolTextGiveContentCommand.h" #include "environments/commands/kpCommandEnvironment.h" diff --git a/commands/tools/selection/text/kpToolTextInsertCommand.cpp b/commands/tools/selection/text/kpToolTextInsertCommand.cpp --- a/commands/tools/selection/text/kpToolTextInsertCommand.cpp +++ b/commands/tools/selection/text/kpToolTextInsertCommand.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "kpToolTextInsertCommand.h" #include "layers/selections/text/kpTextSelection.h" diff --git a/cursors/kpCursorLightCross.cpp b/cursors/kpCursorLightCross.cpp --- a/cursors/kpCursorLightCross.cpp +++ b/cursors/kpCursorLightCross.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_CURSOR_LIGHT_CROSS 0 - - #include "kpCursorLightCross.h" #include "kpLogCategories.h" diff --git a/dialogs/imagelib/effects/kpEffectsDialog.cpp b/dialogs/imagelib/effects/kpEffectsDialog.cpp --- a/dialogs/imagelib/effects/kpEffectsDialog.cpp +++ b/dialogs/imagelib/effects/kpEffectsDialog.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECTS_DIALOG 0 - - #include "kpEffectsDialog.h" #include "kpDefs.h" @@ -203,9 +199,7 @@ // public slot void kpEffectsDialog::selectEffect (int which) { -#if DEBUG_KP_EFFECTS_DIALOG qCDebug(kpLogDialogs) << "kpEffectsDialog::selectEffect(" << which << ")"; -#endif if (which < 0 || which >= m_effectsComboBox->count ()) diff --git a/dialogs/imagelib/kpDocumentMetaInfoDialog.cpp b/dialogs/imagelib/kpDocumentMetaInfoDialog.cpp --- a/dialogs/imagelib/kpDocumentMetaInfoDialog.cpp +++ b/dialogs/imagelib/kpDocumentMetaInfoDialog.cpp @@ -24,10 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_DOCUMENT_META_INFO_DIALOG 0 - - #include "kpDocumentMetaInfoDialog.h" #include "kpDefs.h" diff --git a/dialogs/imagelib/transforms/kpTransformPreviewDialog.cpp b/dialogs/imagelib/transforms/kpTransformPreviewDialog.cpp --- a/dialogs/imagelib/transforms/kpTransformPreviewDialog.cpp +++ b/dialogs/imagelib/transforms/kpTransformPreviewDialog.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TRANSFORM_PREVIEW_DIALOG 0 - - #include "dialogs/imagelib/transforms/kpTransformPreviewDialog.h" #include diff --git a/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp b/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp --- a/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp +++ b/dialogs/imagelib/transforms/kpTransformResizeScaleDialog.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_RESIZE_SCALE_DIALOG 0 - - #include "kpTransformResizeScaleDialog.h" diff --git a/dialogs/imagelib/transforms/kpTransformRotateDialog.cpp b/dialogs/imagelib/transforms/kpTransformRotateDialog.cpp --- a/dialogs/imagelib/transforms/kpTransformRotateDialog.cpp +++ b/dialogs/imagelib/transforms/kpTransformRotateDialog.cpp @@ -24,9 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_ROTATE 0 - - #include "kpTransformRotateDialog.h" #include "kpDefs.h" diff --git a/dialogs/imagelib/transforms/kpTransformSkewDialog.cpp b/dialogs/imagelib/transforms/kpTransformSkewDialog.cpp --- a/dialogs/imagelib/transforms/kpTransformSkewDialog.cpp +++ b/dialogs/imagelib/transforms/kpTransformSkewDialog.cpp @@ -24,11 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SKEW 0 -#define DEBUG_KP_TOOL_SKEW_DIALOG 0 - - #include "dialogs/imagelib/transforms/kpTransformSkewDialog.h" #include diff --git a/dialogs/kpDocumentSaveOptionsPreviewDialog.cpp b/dialogs/kpDocumentSaveOptionsPreviewDialog.cpp --- a/dialogs/kpDocumentSaveOptionsPreviewDialog.cpp +++ b/dialogs/kpDocumentSaveOptionsPreviewDialog.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_DOCUMENT_SAVE_OPTIONS_WIDGET 0 - - #include "kpDocumentSaveOptionsPreviewDialog.h" #include diff --git a/document/kpDocument.cpp b/document/kpDocument.cpp --- a/document/kpDocument.cpp +++ b/document/kpDocument.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_DOCUMENT 0 - - #include "kpDocument.h" #include "kpDocumentPrivate.h" @@ -78,9 +74,7 @@ m_oldWidth (-1), m_oldHeight (-1), d (new kpDocumentPrivate ()) { -#if DEBUG_KP_DOCUMENT && 0 qCDebug(kpLogDocument) << "kpDocument::kpDocument (" << w << "," << h << ")"; -#endif m_image = new kpImage(w, h, QImage::Format_ARGB32_Premultiplied); m_image->fill(QColor(Qt::white).rgb()); diff --git a/document/kpDocumentSaveOptions.cpp b/document/kpDocumentSaveOptions.cpp --- a/document/kpDocumentSaveOptions.cpp +++ b/document/kpDocumentSaveOptions.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_DOCUMENT_SAVE_OPTIONS 0 - - #include "kpDocumentSaveOptions.h" #include "kpDefs.h" diff --git a/document/kpDocument_Open.cpp b/document/kpDocument_Open.cpp --- a/document/kpDocument_Open.cpp +++ b/document/kpDocument_Open.cpp @@ -24,10 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_DOCUMENT 0 - - #include "kpDocument.h" #include "kpDocumentPrivate.h" diff --git a/document/kpDocument_Save.cpp b/document/kpDocument_Save.cpp --- a/document/kpDocument_Save.cpp +++ b/document/kpDocument_Save.cpp @@ -24,10 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_DOCUMENT 0 - - #include "kpDocument.h" #include "kpDocumentPrivate.h" diff --git a/document/kpDocument_Selection.cpp b/document/kpDocument_Selection.cpp --- a/document/kpDocument_Selection.cpp +++ b/document/kpDocument_Selection.cpp @@ -25,14 +25,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_DOCUMENT 0 - - #include "kpDocument.h" #include "kpDocumentPrivate.h" - #include #include #include diff --git a/imagelib/effects/kpEffectBalance.cpp b/imagelib/effects/kpEffectBalance.cpp --- a/imagelib/effects/kpEffectBalance.cpp +++ b/imagelib/effects/kpEffectBalance.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_BALANCE 0 - - #include "kpEffectBalance.h" #include #include diff --git a/imagelib/effects/kpEffectBlurSharpen.cpp b/imagelib/effects/kpEffectBlurSharpen.cpp --- a/imagelib/effects/kpEffectBlurSharpen.cpp +++ b/imagelib/effects/kpEffectBlurSharpen.cpp @@ -24,10 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_BLUR_SHARPEN 0 - - #include "kpEffectBlurSharpen.h" #include "blitz.h" #include "kpLogCategories.h" diff --git a/imagelib/effects/kpEffectEmboss.cpp b/imagelib/effects/kpEffectEmboss.cpp --- a/imagelib/effects/kpEffectEmboss.cpp +++ b/imagelib/effects/kpEffectEmboss.cpp @@ -24,10 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_EMBOSS 0 - - #include "kpEffectEmboss.h" #include "blitz.h" diff --git a/imagelib/effects/kpEffectGrayscale.cpp b/imagelib/effects/kpEffectGrayscale.cpp --- a/imagelib/effects/kpEffectGrayscale.cpp +++ b/imagelib/effects/kpEffectGrayscale.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_PIXMAP_FX 0 - - #include "kpEffectGrayscale.h" #include "pixmapfx/kpPixmapFX.h" diff --git a/imagelib/effects/kpEffectInvert.cpp b/imagelib/effects/kpEffectInvert.cpp --- a/imagelib/effects/kpEffectInvert.cpp +++ b/imagelib/effects/kpEffectInvert.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_INVERT 0 - - #include "kpEffectInvert.h" #include diff --git a/imagelib/effects/kpEffectReduceColors.cpp b/imagelib/effects/kpEffectReduceColors.cpp --- a/imagelib/effects/kpEffectReduceColors.cpp +++ b/imagelib/effects/kpEffectReduceColors.cpp @@ -26,10 +26,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_REDUCE_COLORS 0 - - #include "imagelib/effects/kpEffectReduceColors.h" #include "kpLogCategories.h" diff --git a/imagelib/kpColor.cpp b/imagelib/kpColor.cpp --- a/imagelib/kpColor.cpp +++ b/imagelib/kpColor.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_COLOR 0 - - #include "kpColor.h" #include diff --git a/imagelib/kpColor_Constants.cpp b/imagelib/kpColor_Constants.cpp --- a/imagelib/kpColor_Constants.cpp +++ b/imagelib/kpColor_Constants.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_COLOR 0 - - #include "kpColor.h" diff --git a/imagelib/kpFloodFill.cpp b/imagelib/kpFloodFill.cpp --- a/imagelib/kpFloodFill.cpp +++ b/imagelib/kpFloodFill.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_FLOOD_FILL 0 - - #include "kpFloodFill.h" #include diff --git a/imagelib/transforms/kpTransformAutoCrop.cpp b/imagelib/transforms/kpTransformAutoCrop.cpp --- a/imagelib/transforms/kpTransformAutoCrop.cpp +++ b/imagelib/transforms/kpTransformAutoCrop.cpp @@ -538,21 +538,17 @@ if ((*b)->isSingleColor ()) { kpColor col = (*b)->referenceColor (); - #if DEBUG_KP_TOOL_AUTO_CROP && 1 qCDebug(kpLogImagelib) << "\tdrawing border " << (*b)->rect () - << " rgb=" << (int *) col.toQRgb () /* %X hack */ << endl; - #endif + << " rgb=" << (int *) col.toQRgb () /* %X hack */; const QRect r = (*b)->rect (); kpPainter::fillRect (&image, r.x (), r.y (), r.width (), r.height (), col); } else { - #if DEBUG_KP_TOOL_AUTO_CROP && 1 qCDebug(kpLogImagelib) << "\trestoring border image " << (*b)->rect (); - #endif if (*p) { // REFACTOR: Add equivalent method to kpPainter and use. @@ -669,13 +665,10 @@ topBorder.exists () + botBorder.exists ()) == 0)) { - #if DEBUG_KP_TOOL_AUTO_CROP qCDebug(kpLogImagelib) << "\tcan't find border; leftBorder.rect=" << leftBorder.rect () << " rightBorder.rect=" << rightBorder.rect () << " topBorder.rect=" << topBorder.rect () - << " botBorder.rect=" << botBorder.rect () - << endl; - #endif + << " botBorder.rect=" << botBorder.rect (); ::ShowNothingToAutocropMessage (mainWindow, static_cast (doc->selection ())); return false; } diff --git a/imagelib/transforms/kpTransformCrop.cpp b/imagelib/transforms/kpTransformCrop.cpp --- a/imagelib/transforms/kpTransformCrop.cpp +++ b/imagelib/transforms/kpTransformCrop.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_CROP 0 - - #include "kpTransformCrop.h" #include "kpTransformCropPrivate.h" diff --git a/imagelib/transforms/kpTransformCrop_TextSelection.cpp b/imagelib/transforms/kpTransformCrop_TextSelection.cpp --- a/imagelib/transforms/kpTransformCrop_TextSelection.cpp +++ b/imagelib/transforms/kpTransformCrop_TextSelection.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_CROP 0 - - #include "kpTransformCrop.h" #include "kpTransformCropPrivate.h" diff --git a/kpThumbnail.cpp b/kpThumbnail.cpp --- a/kpThumbnail.cpp +++ b/kpThumbnail.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_THUMBNAIL 0 - - #include "kpThumbnail.h" #include "kpDefs.h" @@ -43,7 +39,6 @@ #include #include - struct kpThumbnailPrivate { kpMainWindow *mainWindow; @@ -83,9 +78,7 @@ // public void kpThumbnail::setView (kpThumbnailView *view) { -#if DEBUG_KP_THUMBNAIL qCDebug(kpLogMisc) << "kpThumbnail::setView(" << view << ")"; -#endif if (d->view == view) return; @@ -121,33 +114,26 @@ updateCaption (); } - // public slot void kpThumbnail::updateCaption () { setWindowTitle (view () ? view ()->caption () : i18nc ("@title:window", "Thumbnail")); } - // protected slot void kpThumbnail::slotViewDestroyed () { -#if DEBUG_KP_THUMBNAIL qCDebug(kpLogMisc) << "kpThumbnail::slotViewDestroyed()"; -#endif d->view = nullptr; updateCaption (); } - // protected virtual [base QWidget] void kpThumbnail::resizeEvent (QResizeEvent *e) { -#if DEBUG_KP_THUMBNAIL qCDebug(kpLogMisc) << "kpThumbnail::resizeEvent(" << width () - << "," << height () << ")" << endl; -#endif + << "," << height () << ")"; QWidget::resizeEvent (e); diff --git a/kpViewScrollableContainer.cpp b/kpViewScrollableContainer.cpp --- a/kpViewScrollableContainer.cpp +++ b/kpViewScrollableContainer.cpp @@ -25,8 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_VIEW_SCROLLABLE_CONTAINER 0 - #include "kpViewScrollableContainer.h" #include @@ -183,9 +181,7 @@ // protected void kpGrip::cancel () { -#if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER qCDebug(kpLogMisc) << "kpGrip::cancel()"; -#endif if (m_currentPoint == KP_INVALID_POINT) return; @@ -272,11 +268,8 @@ // protected virtual [base QWidget] void kpGrip::mouseMoveEvent (QMouseEvent *e) { -#if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER qCDebug(kpLogMisc) << "kpGrip::mouseMoveEvent() m_startPoint=" << m_startPoint - << " stateAfter: buttons=" << (int *) (int) e->buttons () - << endl; -#endif + << " stateAfter: buttons=" << (int *) (int) e->buttons (); if (m_startPoint == KP_INVALID_POINT) { @@ -293,11 +286,8 @@ // protected virtual [base QWidget] void kpGrip::mouseReleaseEvent (QMouseEvent *e) { -#if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER qCDebug(kpLogMisc) << "kpGrip::mouseReleaseEvent() m_startPoint=" << m_startPoint - << " stateAfter: buttons=" << (int *) (int) e->buttons () - << endl; -#endif + << " stateAfter: buttons=" << (int *) (int) e->buttons (); if (m_startPoint != KP_INVALID_POINT) { @@ -328,19 +318,15 @@ // protected virtual [base QWidget] void kpGrip::enterEvent (QEvent * /*e*/) { -#if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER qCDebug(kpLogMisc) << "kpGrip::enterEvent()" << " m_startPoint=" << m_startPoint << " shouldReleaseMouseButtons=" - << m_shouldReleaseMouseButtons << endl; -#endif + << m_shouldReleaseMouseButtons; if (m_startPoint == KP_INVALID_POINT && !m_shouldReleaseMouseButtons) { - #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER qCDebug(kpLogMisc) << "\tsending message"; - #endif setUserMessage (haventBegunDrawUserMessage ()); } } @@ -350,12 +336,10 @@ // protected virtual [base QWidget] void kpGrip::leaveEvent (QEvent * /*e*/) { -#if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER qCDebug(kpLogMisc) << "kpGrip::leaveEvent()" << " m_startPoint=" << m_startPoint << " shouldReleaseMouseButtons=" - << m_shouldReleaseMouseButtons << endl; -#endif + << m_shouldReleaseMouseButtons; if (m_startPoint == KP_INVALID_POINT && !m_shouldReleaseMouseButtons) { @@ -466,9 +450,7 @@ // public void kpViewScrollableContainer::clearStatusMessage () { -#if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER && 1 qCDebug(kpLogMisc) << "kpViewScrollableContainer::clearStatusMessage()"; -#endif m_bottomRightGrip->setUserMessage(QString()); m_bottomGrip->setUserMessage(QString()); m_rightGrip->setUserMessage(QString()); @@ -662,16 +644,12 @@ void kpViewScrollableContainer::updateResizeLines (int viewX, int viewY, int viewDX, int viewDY) { -#if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER && 0 qCDebug(kpLogMisc) << "kpViewScrollableContainer::updateResizeLines(" << viewX << "," << viewY << ")" << " oldViewX=" << m_resizeRoundedLastViewX << " oldViewY=" << m_resizeRoundedLastViewY << " viewDX=" << viewDX - << " viewDY=" << viewDY - << endl; -#endif - + << " viewDY=" << viewDY; if (viewX >= 0 && viewY >= 0) { @@ -728,13 +706,10 @@ int viewDX = inViewDX, viewDY = inViewDY; -#if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER qCDebug(kpLogMisc) << "kpViewScrollableContainer::slotGripContinuedDraw(" << viewDX << "," << viewDY << ") size=" << newDocSize (viewDX, viewDY) - << " dueToDragScroll=" << dueToDragScroll - << endl; -#endif + << " dueToDragScroll=" << dueToDragScroll; if (!m_view) return; @@ -745,11 +720,8 @@ const QPoint newViewDeltaPoint = docResizingGrip ()->viewDeltaPoint (); viewDX = newViewDeltaPoint.x (); viewDY = newViewDeltaPoint.y (); - #if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER qCDebug(kpLogMisc) << "\tdrag scrolled - new view delta point=" - << newViewDeltaPoint - << endl; - #endif + << newViewDeltaPoint; } m_haveMovedFromOriginalDocSize = true; @@ -784,12 +756,9 @@ // protected slot void kpViewScrollableContainer::slotGripEndedDraw (int viewDX, int viewDY) { -#if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER qCDebug(kpLogMisc) << "kpViewScrollableContainer::slotGripEndedDraw(" << viewDX << "," << viewDY << ") size=" - << newDocSize (viewDX, viewDY) - << endl; -#endif + << newDocSize (viewDX, viewDY); if (!m_view) return; @@ -827,14 +796,11 @@ // public slot void kpViewScrollableContainer::recalculateStatusMessage () { -#if DEBUG_KP_VIEW_SCROLLABLE_CONTAINER qCDebug(kpLogMisc) << "kpViewScrollabelContainer::recalculateStatusMessage()"; qCDebug(kpLogMisc) << "\tQCursor::pos=" << QCursor::pos () << " global visibleRect=" << kpWidgetMapper::toGlobal (this, - QRect(0, 0, viewport->width(), viewport->height())) - << endl; -#endif + QRect(0, 0, viewport()->width(), viewport()->height())); // HACK: After dragging to a new size, handles move so that they are now // under the mouse pointer but no mouseMoveEvent() is generated for diff --git a/layers/selections/image/kpAbstractImageSelection.cpp b/layers/selections/image/kpAbstractImageSelection.cpp --- a/layers/selections/image/kpAbstractImageSelection.cpp +++ b/layers/selections/image/kpAbstractImageSelection.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_SELECTION 0 - - #include "layers/selections/image/kpAbstractImageSelection.h" #include diff --git a/layers/selections/image/kpEllipticalImageSelection.cpp b/layers/selections/image/kpEllipticalImageSelection.cpp --- a/layers/selections/image/kpEllipticalImageSelection.cpp +++ b/layers/selections/image/kpEllipticalImageSelection.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_SELECTION 0 - - #include "layers/selections/image/kpEllipticalImageSelection.h" #include diff --git a/layers/selections/image/kpFreeFormImageSelection.cpp b/layers/selections/image/kpFreeFormImageSelection.cpp --- a/layers/selections/image/kpFreeFormImageSelection.cpp +++ b/layers/selections/image/kpFreeFormImageSelection.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_SELECTION 0 - - #include "layers/selections/image/kpFreeFormImageSelection.h" #include "kpLogCategories.h" diff --git a/layers/selections/image/kpImageSelectionTransparency.cpp b/layers/selections/image/kpImageSelectionTransparency.cpp --- a/layers/selections/image/kpImageSelectionTransparency.cpp +++ b/layers/selections/image/kpImageSelectionTransparency.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_SELECTION_TRANSPARENCY 0 - - #include "layers/selections/image/kpImageSelectionTransparency.h" #include "kpLogCategories.h" diff --git a/layers/selections/image/kpRectangularImageSelection.cpp b/layers/selections/image/kpRectangularImageSelection.cpp --- a/layers/selections/image/kpRectangularImageSelection.cpp +++ b/layers/selections/image/kpRectangularImageSelection.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_SELECTION 0 - - #include "layers/selections/image/kpRectangularImageSelection.h" #include diff --git a/layers/selections/kpAbstractSelection.cpp b/layers/selections/kpAbstractSelection.cpp --- a/layers/selections/kpAbstractSelection.cpp +++ b/layers/selections/kpAbstractSelection.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_SELECTION 0 - - #include "layers/selections/kpAbstractSelection.h" #include @@ -93,10 +89,8 @@ // friend QDataStream &operator<< (QDataStream &stream, const kpAbstractSelection &selection) { -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "kpAbstractSelection::operator<<(sel: rect=" << - selection.boundingRect () << endl; -#endif + selection.boundingRect (); stream << selection.serialID (); selection.writeToStream (stream); return stream; @@ -191,23 +185,17 @@ // public virtual void kpAbstractSelection::moveBy (int dx, int dy) { -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "kpAbstractSelection::moveBy(" << dx << "," << dy << ")"; -#endif if (dx == 0 && dy == 0) return; QRect oldRect = boundingRect (); -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "\toldRect=" << oldRect; -#endif d->rect.translate (dx, dy); -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "\tnewRect=" << d->rect; -#endif emit changed (oldRect); emit changed (boundingRect ()); @@ -222,13 +210,9 @@ // public void kpAbstractSelection::moveTo (const QPoint &topLeftPoint) { -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "kpAbstractSelection::moveTo(" << topLeftPoint << ")"; -#endif QRect oldBoundingRect = boundingRect (); -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "\toldBoundingRect=" << oldBoundingRect; -#endif if (topLeftPoint == oldBoundingRect.topLeft ()) return; @@ -245,19 +229,14 @@ { (void) selectionFinished; -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "kpAbstractSelection::paintRectangularBorder() boundingRect=" - << boundingRect () << endl; -#endif + << boundingRect (); -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "\tselection border = rectangle"; qCDebug(kpLogLayers) << "\t\tx=" << boundingRect ().x () - docRect.x () << " y=" << boundingRect ().y () - docRect.y () << " w=" << boundingRect ().width () - << " h=" << boundingRect ().height () - << endl; -#endif + << " h=" << boundingRect ().height (); kpPixmapFX::drawStippleRect(destPixmap, boundingRect ().x () - docRect.x (), boundingRect ().y () - docRect.y (), @@ -275,10 +254,8 @@ const QRect &docRect, bool selectionFinished) const { -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "kpAbstractSelection::paintPolygonalBorder() boundingRect=" - << boundingRect () << endl; -#endif + << boundingRect (); QPolygon pointsTranslated = points; pointsTranslated.translate (-docRect.x (), -docRect.y ()); diff --git a/layers/selections/kpSelectionDrag.cpp b/layers/selections/kpSelectionDrag.cpp --- a/layers/selections/kpSelectionDrag.cpp +++ b/layers/selections/kpSelectionDrag.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_SELECTION_DRAG 0 - - #include "kpSelectionDrag.h" #include @@ -51,11 +47,8 @@ kpSelectionDrag::kpSelectionDrag (const kpAbstractImageSelection &sel) { -#if DEBUG_KP_SELECTION_DRAG && 1 qCDebug(kpLogLayers) << "kpSelectionDrag() w=" << sel.width () - << " h=" << sel.height () - << endl; -#endif + << " h=" << sel.height (); Q_ASSERT (sel.hasContent ()); @@ -70,11 +63,8 @@ // Store as image (so that QMimeData::hasImage()) works). // OPT: an awful waste of memory storing image in both selection and QImage const QImage image = sel.baseImage (); -#if DEBUG_KP_SELECTION_DRAG && 1 qCDebug(kpLogLayers) << "\timage: w=" << image.width () - << " h=" << image.height () - << endl; -#endif + << " h=" << image.height (); if (image.isNull ()) { // TODO: proper error handling. @@ -92,11 +82,9 @@ { Q_ASSERT(mimeData); -#if DEBUG_KP_SELECTION_DRAG qCDebug(kpLogLayers) << "kpSelectionDrag::canDecode()" << "hasSel=" << mimeData->hasFormat(kpSelectionDrag::SelectionMimeType) << "hasImage=" << mimeData->hasImage(); -#endif // mimeData->hasImage() would not check if the data is a valid image return mimeData->hasFormat(kpSelectionDrag::SelectionMimeType) || @@ -108,33 +96,25 @@ kpAbstractImageSelection *kpSelectionDrag::decode(const QMimeData *mimeData) { -#if DEBUG_KP_SELECTION_DRAG qCDebug(kpLogLayers) << "kpSelectionDrag::decode(kpAbstractSelection)"; -#endif Q_ASSERT (mimeData); if (mimeData->hasFormat (kpSelectionDrag::SelectionMimeType)) { - #if DEBUG_KP_SELECTION_DRAG qCDebug(kpLogLayers) << "\tmimeSource hasFormat selection - just return it in QByteArray"; - #endif QByteArray data = mimeData->data (kpSelectionDrag::SelectionMimeType); QDataStream stream (&data, QIODevice::ReadOnly); return kpSelectionFactory::FromStream (stream); } else { - #if DEBUG_KP_SELECTION_DRAG qCDebug(kpLogLayers) << "\tmimeSource doesn't provide selection - try image"; - #endif QImage image = qvariant_cast (mimeData->imageData ()); if (!image.isNull ()) { - #if DEBUG_KP_SELECTION_DRAG qCDebug(kpLogLayers) << "\tok w=" << image.width () << " h=" << image.height (); - #endif return new kpRectangularImageSelection ( QRect (0, 0, image.width (), image.height ()), image); @@ -155,10 +135,8 @@ } } - #if DEBUG_KP_SELECTION_DRAG qCDebug(kpLogLayers) << "kpSelectionDrag::decode(kpAbstractSelection) mimeSource had no sel " - "and could not decode to image" << endl; - #endif + "and could not decode to image"; return nullptr; } } diff --git a/layers/selections/kpSelectionFactory.cpp b/layers/selections/kpSelectionFactory.cpp --- a/layers/selections/kpSelectionFactory.cpp +++ b/layers/selections/kpSelectionFactory.cpp @@ -25,34 +25,28 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_SELECTION 0 - - #include "kpSelectionFactory.h" #include #include "layers/selections/image/kpRectangularImageSelection.h" #include "layers/selections/image/kpEllipticalImageSelection.h" #include "layers/selections/image/kpFreeFormImageSelection.h" +#include "kpLogCategories.h" + //--------------------------------------------------------------------- // public static // TODO: KolourPaint has not been tested against invalid or malicious // clipboard data [Bug #28]. kpAbstractImageSelection *kpSelectionFactory::FromStream (QDataStream &stream) { -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "kpSelectionFactory::FromStream()"; -#endif int serialID; stream >> serialID; -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "\tserialID=" << serialID; -#endif // Only image selections are marshalled. // diff --git a/layers/selections/text/kpTextSelection.cpp b/layers/selections/text/kpTextSelection.cpp --- a/layers/selections/text/kpTextSelection.cpp +++ b/layers/selections/text/kpTextSelection.cpp @@ -26,10 +26,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_SELECTION 0 - - #include "kpTextSelection.h" #include "kpTextSelectionPrivate.h" diff --git a/layers/selections/text/kpTextSelection_Cursor.cpp b/layers/selections/text/kpTextSelection_Cursor.cpp --- a/layers/selections/text/kpTextSelection_Cursor.cpp +++ b/layers/selections/text/kpTextSelection_Cursor.cpp @@ -26,10 +26,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_SELECTION 0 - - #include "kpTextSelection.h" #include "kpTextSelectionPrivate.h" @@ -97,15 +93,12 @@ (preeditText.isEmpty () && (row >= static_cast (d->textLines.size ()) || col > static_cast (d->textLines [row].length ())))) { -#if DEBUG_KP_SELECTION && 1 qCDebug(kpLogLayers) << "kpTextSelection::pointForTextRowCol(" << row << "," << col << ") out of range" << " textLines='" << text () - << "'" - << endl; -#endif + << "'"; return KP_INVALID_POINT; } diff --git a/layers/selections/text/kpTextSelection_Paint.cpp b/layers/selections/text/kpTextSelection_Paint.cpp --- a/layers/selections/text/kpTextSelection_Paint.cpp +++ b/layers/selections/text/kpTextSelection_Paint.cpp @@ -28,10 +28,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_SELECTION 0 - - #include "kpTextSelection.h" #include "kpTextSelectionPrivate.h" @@ -114,13 +110,10 @@ // public virtual [kpAbstractSelection] void kpTextSelection::paint(QImage *destPixmap, const QRect &docRect) const { -#if DEBUG_KP_SELECTION qCDebug(kpLogLayers) << "kpTextSelection::paint() textStyle: fcol=" << (int *) d->textStyle.foregroundColor ().toQRgb () << " bcol=" - << (int *) d->textStyle.backgroundColor ().toQRgb () - << endl; -#endif + << (int *) d->textStyle.backgroundColor ().toQRgb (); // Drawing text is slow so if the text box will be rendered completely // outside of , don't bother rendering it at all. @@ -148,15 +141,12 @@ const QFontMetrics fontMetrics (theTextStyle.font ()); -#if DEBUG_KP_SELECTION qCDebug(kpLogLayers) << "kpTextSelection_Paint.cpp:DrawTextHelper"; qCDebug(kpLogLayers) << "\theight=" << fontMetrics.height () << " leading=" << fontMetrics.leading () << " ascent=" << fontMetrics.ascent () << " descent=" << fontMetrics.descent () - << " lineSpacing=" << fontMetrics.lineSpacing () - << endl; -#endif + << " lineSpacing=" << fontMetrics.lineSpacing (); QPainter painter(&floatImage); diff --git a/lgpl/generic/kpColorCollection.cpp b/lgpl/generic/kpColorCollection.cpp --- a/lgpl/generic/kpColorCollection.cpp +++ b/lgpl/generic/kpColorCollection.cpp @@ -24,8 +24,6 @@ //----------------------------------------------------------------------------- // KDE color collection -#define DEBUG_KP_COLOR_COLLECTION 0 - #include "kpColorCollection.h" #include "kpUrlFormatter.h" diff --git a/lgpl/generic/widgets/kpColorCellsBase.cpp b/lgpl/generic/widgets/kpColorCellsBase.cpp --- a/lgpl/generic/widgets/kpColorCellsBase.cpp +++ b/lgpl/generic/widgets/kpColorCellsBase.cpp @@ -19,9 +19,6 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -//----------------------------------------------------------------------------- - -#define DEBUG_KP_COLOR_CELLS_BASE 0 #include "kpColorCellsBase.h" diff --git a/mainWindow/kpMainWindowPrivate.h b/mainWindow/kpMainWindowPrivate.h --- a/mainWindow/kpMainWindowPrivate.h +++ b/mainWindow/kpMainWindowPrivate.h @@ -25,14 +25,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #ifndef kpMainWindowPrivate_H #define kpMainWindowPrivate_H - -#define DEBUG_KP_MAIN_WINDOW 0 - - #include "document/kpDocumentSaveOptions.h" diff --git a/mainWindow/kpMainWindow_File.cpp b/mainWindow/kpMainWindow_File.cpp --- a/mainWindow/kpMainWindow_File.cpp +++ b/mainWindow/kpMainWindow_File.cpp @@ -26,7 +26,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #include "kpMainWindow.h" #include "kpMainWindowPrivate.h" @@ -741,10 +740,8 @@ bool *allowOverwritePrompt, bool *allowLossyPrompt) { -#if DEBUG_KP_MAIN_WINDOW qCDebug(kpLogMainWindow) << "kpMainWindow::askForURL() startURL=" << startURL; startSaveOptions.printDebug ("\tstartSaveOptions"); -#endif bool reparsedConfiguration = false; @@ -1395,9 +1392,7 @@ // private virtual [base KMainWindow] bool kpMainWindow::queryClose () { -#if DEBUG_KP_MAIN_WINDOW qCDebug(kpLogMainWindow) << "kpMainWindow::queryClose()"; -#endif toolEndShape (); if (!queryCloseDocument ()) diff --git a/mainWindow/kpMainWindow_StatusBar.cpp b/mainWindow/kpMainWindow_StatusBar.cpp --- a/mainWindow/kpMainWindow_StatusBar.cpp +++ b/mainWindow/kpMainWindow_StatusBar.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_STATUS_BAR (DEBUG_KP_MAIN_WINDOW && 0) - - #include "mainWindow/kpMainWindow.h" #include "kpMainWindowPrivate.h" @@ -170,22 +167,17 @@ // private slot void kpMainWindow::setStatusBarShapeSize (const QSize &size) { -#if DEBUG_STATUS_BAR && 0 qCDebug(kpLogMainWindow) << "kpMainWindow::setStatusBarShapeSize(" << size - << ") ok=" << d->statusBarCreated - << endl; -#endif + << ") ok=" << d->statusBarCreated; if (!d->statusBarCreated) return; if (d->statusBarShapeLastSizeInitialised && size == d->statusBarShapeLastSize) { - #if DEBUG_STATUS_BAR && 0 qCDebug(kpLogMainWindow) << "\tNOP"; - #endif return; } @@ -299,18 +291,13 @@ d->scrollView->newDocSize ().isEmpty () && d->viewManager && d->viewManager->viewUnderCursor ()) { - #if DEBUG_STATUS_BAR && 1 - qCDebug(kpLogMainWindow) << "\t\tnot resizing & viewUnderCursor - message is wrong - clearing" - << endl; - #endif + qCDebug(kpLogMainWindow) << "\t\tnot resizing & viewUnderCursor - message is wrong - clearing"; d->scrollView->blockSignals (true); d->scrollView->clearStatusMessage (); d->scrollView->blockSignals (false); scrollViewMessage.clear (); - #if DEBUG_STATUS_BAR && 1 qCDebug(kpLogMainWindow) << "\t\t\tdone"; - #endif } if (!scrollViewMessage.isEmpty ()) diff --git a/mainWindow/kpMainWindow_Text.cpp b/mainWindow/kpMainWindow_Text.cpp --- a/mainWindow/kpMainWindow_Text.cpp +++ b/mainWindow/kpMainWindow_Text.cpp @@ -24,7 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #include "mainWindow/kpMainWindow.h" #include "kpMainWindowPrivate.h" @@ -131,9 +130,7 @@ if (textToolBar ()) { - #if DEBUG_KP_MAIN_WINDOW qCDebug(kpLogMainWindow) << "\thave toolbar - setShown"; - #endif // COMPAT: KDE4 does not place the Text Tool Bar in a new row, underneath // the Main Tool Bar, if there isn't enough room. This makes // accessing the Text Tool Bar's buttons difficult. @@ -150,8 +147,7 @@ << "fontFamily=" << d->actionTextFontFamily->font () << "action.currentItem=" - << d->actionTextFontFamily->currentItem () - << endl; + << d->actionTextFontFamily->currentItem (); if (!d->isFullyConstructed) return; @@ -181,8 +177,7 @@ qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontSizeChanged() alive=" << d->isFullyConstructed << " fontSize=" - << d->actionTextFontSize->fontSize () - << endl; + << d->actionTextFontSize->fontSize (); if (!d->isFullyConstructed) return; @@ -212,8 +207,7 @@ qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontBoldChanged() alive=" << d->isFullyConstructed << " bold=" - << d->actionTextBold->isChecked () - << endl; + << d->actionTextBold->isChecked (); if (!d->isFullyConstructed) return; @@ -235,8 +229,7 @@ qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontItalicChanged() alive=" << d->isFullyConstructed << " bold=" - << d->actionTextItalic->isChecked () - << endl; + << d->actionTextItalic->isChecked (); if (!d->isFullyConstructed) return; @@ -258,8 +251,7 @@ qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextFontUnderlineChanged() alive=" << d->isFullyConstructed << " underline=" - << d->actionTextUnderline->isChecked () - << endl; + << d->actionTextUnderline->isChecked (); if (!d->isFullyConstructed) return; @@ -281,8 +273,7 @@ qCDebug(kpLogMainWindow) << "kpMainWindow::slotTextStrikeThruChanged() alive=" << d->isFullyConstructed << " strikeThru=" - << d->actionTextStrikeThru->isChecked () - << endl; + << d->actionTextStrikeThru->isChecked (); if (!d->isFullyConstructed) return; diff --git a/mainWindow/kpMainWindow_Tools.cpp b/mainWindow/kpMainWindow_Tools.cpp --- a/mainWindow/kpMainWindow_Tools.cpp +++ b/mainWindow/kpMainWindow_Tools.cpp @@ -409,9 +409,7 @@ // private slot void kpMainWindow::slotToolSelected (kpTool *tool) { -#if DEBUG_KP_MAIN_WINDOW qCDebug(kpLogMainWindow) << "kpMainWindow::slotToolSelected (" << tool << ")"; -#endif kpTool *previousTool = d->toolToolBar ? d->toolToolBar->previousTool () : nullptr; diff --git a/pixmapfx/kpPixmapFX_DrawShapes.cpp b/pixmapfx/kpPixmapFX_DrawShapes.cpp --- a/pixmapfx/kpPixmapFX_DrawShapes.cpp +++ b/pixmapfx/kpPixmapFX_DrawShapes.cpp @@ -25,13 +25,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_PIXMAP_FX 0 - - #include "kpPixmapFX.h" - #include #include #include diff --git a/pixmapfx/kpPixmapFX_GetSetPixmapParts.cpp b/pixmapfx/kpPixmapFX_GetSetPixmapParts.cpp --- a/pixmapfx/kpPixmapFX_GetSetPixmapParts.cpp +++ b/pixmapfx/kpPixmapFX_GetSetPixmapParts.cpp @@ -25,13 +25,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_PIXMAP_FX 0 - - #include "kpPixmapFX.h" - #include #include #include diff --git a/pixmapfx/kpPixmapFX_Transforms.cpp b/pixmapfx/kpPixmapFX_Transforms.cpp --- a/pixmapfx/kpPixmapFX_Transforms.cpp +++ b/pixmapfx/kpPixmapFX_Transforms.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_PIXMAP_FX 0 - - #include "kpPixmapFX.h" #include diff --git a/tools/flow/kpToolColorEraser.cpp b/tools/flow/kpToolColorEraser.cpp --- a/tools/flow/kpToolColorEraser.cpp +++ b/tools/flow/kpToolColorEraser.cpp @@ -24,9 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_COLOR_ERASER 0 - #include "kpToolColorEraser.h" #include diff --git a/tools/flow/kpToolEraser.cpp b/tools/flow/kpToolEraser.cpp --- a/tools/flow/kpToolEraser.cpp +++ b/tools/flow/kpToolEraser.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_ERASER 0 - #include "kpToolEraser.h" #include "commands/kpCommandHistory.h" diff --git a/tools/flow/kpToolFlowBase.cpp b/tools/flow/kpToolFlowBase.cpp --- a/tools/flow/kpToolFlowBase.cpp +++ b/tools/flow/kpToolFlowBase.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_FLOW_BASE 0 - #include "kpToolFlowBase.h" #include diff --git a/tools/flow/kpToolSpraycan.cpp b/tools/flow/kpToolSpraycan.cpp --- a/tools/flow/kpToolSpraycan.cpp +++ b/tools/flow/kpToolSpraycan.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SPRAYCAN 0 - #include "kpToolSpraycan.h" #include "kpDefs.h" diff --git a/tools/kpTool.cpp b/tools/kpTool.cpp --- a/tools/kpTool.cpp +++ b/tools/kpTool.cpp @@ -27,9 +27,6 @@ // // Tool initialisation and basic accessors. // - -#define DEBUG_KP_TOOL 0 - #include "kpTool.h" #include "kpToolPrivate.h" diff --git a/tools/kpToolColorPicker.cpp b/tools/kpToolColorPicker.cpp --- a/tools/kpToolColorPicker.cpp +++ b/tools/kpToolColorPicker.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_COLOR_PICKER 0 - - #include "kpToolColorPicker.h" #include "kpLogCategories.h" #include "widgets/toolbars/kpColorToolBar.h" diff --git a/tools/kpToolFloodFill.cpp b/tools/kpToolFloodFill.cpp --- a/tools/kpToolFloodFill.cpp +++ b/tools/kpToolFloodFill.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_FLOOD_FILL 0 - - #include "kpToolFloodFill.h" #include "commands/kpCommandHistory.h" diff --git a/tools/kpToolZoom.cpp b/tools/kpToolZoom.cpp --- a/tools/kpToolZoom.cpp +++ b/tools/kpToolZoom.cpp @@ -24,10 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_ZOOM 0 - - #include "kpToolZoom.h" #include "kpDefs.h" diff --git a/tools/kpTool_Drawing.cpp b/tools/kpTool_Drawing.cpp --- a/tools/kpTool_Drawing.cpp +++ b/tools/kpTool_Drawing.cpp @@ -29,10 +29,6 @@ // Tool methods for drawing shapes (subclasses reimplement most of these). // - -#define DEBUG_KP_TOOL 0 - - #include "tools/kpTool.h" #include "kpToolPrivate.h" diff --git a/tools/kpTool_KeyboardEvents.cpp b/tools/kpTool_KeyboardEvents.cpp --- a/tools/kpTool_KeyboardEvents.cpp +++ b/tools/kpTool_KeyboardEvents.cpp @@ -29,10 +29,6 @@ // Tool reaction to view keyboard input. // - -#define DEBUG_KP_TOOL 0 - - // TODO: reduce number of includes #include "tools/kpTool.h" #include "kpToolPrivate.h" diff --git a/tools/kpTool_MouseEvents.cpp b/tools/kpTool_MouseEvents.cpp --- a/tools/kpTool_MouseEvents.cpp +++ b/tools/kpTool_MouseEvents.cpp @@ -29,8 +29,6 @@ // Tool reaction to view mouse input. // -#define DEBUG_KP_TOOL 0 - #include "tools/kpTool.h" #include "kpToolPrivate.h" diff --git a/tools/kpTool_Utilities.cpp b/tools/kpTool_Utilities.cpp --- a/tools/kpTool_Utilities.cpp +++ b/tools/kpTool_Utilities.cpp @@ -29,10 +29,6 @@ // Tool utility methods - mainly for subclasses' convenience. // - -#define DEBUG_KP_TOOL 0 - - #include "tools/kpTool.h" #include "kpToolPrivate.h" diff --git a/tools/polygonal/kpToolCurve.cpp b/tools/polygonal/kpToolCurve.cpp --- a/tools/polygonal/kpToolCurve.cpp +++ b/tools/polygonal/kpToolCurve.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_CURVE 0 - - #include "kpToolCurve.h" #include "kpLogCategories.h" #include "environments/tools/kpToolEnvironment.h" diff --git a/tools/polygonal/kpToolLine.cpp b/tools/polygonal/kpToolLine.cpp --- a/tools/polygonal/kpToolLine.cpp +++ b/tools/polygonal/kpToolLine.cpp @@ -24,10 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_LINE 0 - - #include "kpToolLine.h" #include "kpToolPolyline.h" #include "kpLogCategories.h" diff --git a/tools/polygonal/kpToolPolygonalBase.cpp b/tools/polygonal/kpToolPolygonalBase.cpp --- a/tools/polygonal/kpToolPolygonalBase.cpp +++ b/tools/polygonal/kpToolPolygonalBase.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_POLYGON 0 - - #include "kpToolPolygonalBase.h" #include diff --git a/tools/polygonal/kpToolPolyline.cpp b/tools/polygonal/kpToolPolyline.cpp --- a/tools/polygonal/kpToolPolyline.cpp +++ b/tools/polygonal/kpToolPolyline.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_POLYLINE 0 - - #include "kpToolPolyline.h" #include "kpLogCategories.h" #include "environments/tools/kpToolEnvironment.h" @@ -88,10 +84,8 @@ // public virtual [base kpTool] void kpToolPolyline::endDraw (const QPoint &, const QRect &) { -#if DEBUG_KP_TOOL_POLYLINE qCDebug(kpLogTools) << "kpToolPolyline::endDraw() points=" - << points ()->toList () << endl; -#endif + << points ()->toList (); // A click of the other mouse button (to finish shape, instead of adding // another control point) would have caused endShape() to have been @@ -102,9 +96,7 @@ if (points ()->count () >= kpToolPolygonalBase::MaxPoints) { - #if DEBUG_KP_TOOL_POLYLINE qCDebug(kpLogTools) << "\tending shape"; - #endif endShape (); return; } diff --git a/tools/rectangular/kpToolRectangularBase.cpp b/tools/rectangular/kpToolRectangularBase.cpp --- a/tools/rectangular/kpToolRectangularBase.cpp +++ b/tools/rectangular/kpToolRectangularBase.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_RECTANGULAR_BASE 0 - - #include "tools/rectangular/kpToolRectangularBase.h" #include diff --git a/tools/selection/image/kpAbstractImageSelectionTool_Transparency.cpp b/tools/selection/image/kpAbstractImageSelectionTool_Transparency.cpp --- a/tools/selection/image/kpAbstractImageSelectionTool_Transparency.cpp +++ b/tools/selection/image/kpAbstractImageSelectionTool_Transparency.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpAbstractImageSelectionTool.h" #include "layers/selections/image/kpAbstractImageSelection.h" @@ -60,10 +56,8 @@ { if (environ ()->settingImageSelectionTransparency ()) { - #if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "\trecursion - abort setting selection transparency: " - << environ ()->settingImageSelectionTransparency () << endl; - #endif + << environ ()->settingImageSelectionTransparency (); return false; } @@ -83,9 +77,7 @@ const kpImageSelectionTransparency &newTrans, const kpImageSelectionTransparency &oldTrans) { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "CALL(" << name << ")"; -#endif kpSetOverrideCursorSaver cursorSaver (Qt::WaitCursor); @@ -141,9 +133,7 @@ // protected slot virtual [kpAbstractSelectionTool] void kpAbstractImageSelectionTool::slotIsOpaqueChanged (bool /*isOpaque*/) { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "kpAbstractImageSelectionTool::slotIsOpaqueChanged()"; -#endif if (!shouldChangeImageSelectionTransparency ()) return; @@ -163,9 +153,7 @@ // protected slot virtual [base kpTool] void kpAbstractImageSelectionTool::slotBackgroundColorChanged (const kpColor &) { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "kpAbstractImageSelectionTool::slotBackgroundColorChanged()"; -#endif if (!shouldChangeImageSelectionTransparency ()) return; @@ -183,9 +171,7 @@ // protected slot virtual [base kpTool] void kpAbstractImageSelectionTool::slotColorSimilarityChanged (double, int) { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "kpAbstractImageSelectionTool::slotColorSimilarityChanged()"; -#endif if (!shouldChangeImageSelectionTransparency ()) return; diff --git a/tools/selection/image/kpToolEllipticalSelection.cpp b/tools/selection/image/kpToolEllipticalSelection.cpp --- a/tools/selection/image/kpToolEllipticalSelection.cpp +++ b/tools/selection/image/kpToolEllipticalSelection.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_ELLIPTICAL_SELECTION 0 - - #include "kpToolEllipticalSelection.h" #include "kpLogCategories.h" @@ -61,9 +58,7 @@ // Prevent unintentional creation of 1-pixel selections. if (!dragAccepted && accidentalDragAdjustedPoint == startPoint ()) { - #if DEBUG_KP_TOOL_ELLIPTICAL_SELECTION && 1 qCDebug(kpLogTools) << "\tnon-text NOP - return"; - #endif setUserShapePoints (accidentalDragAdjustedPoint); return false; } diff --git a/tools/selection/image/kpToolFreeFormSelection.cpp b/tools/selection/image/kpToolFreeFormSelection.cpp --- a/tools/selection/image/kpToolFreeFormSelection.cpp +++ b/tools/selection/image/kpToolFreeFormSelection.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_FREE_FROM_SELECTION 0 - - #include "kpToolFreeFormSelection.h" #include "kpLogCategories.h" @@ -64,19 +60,15 @@ const QPoint &accidentalDragAdjustedPoint, const QRect &/*normalizedRect*/) { -#if DEBUG_KP_TOOL_FREE_FROM_SELECTION qCDebug(kpLogTools) << "kpToolFreeFormSelection::createMoreSelectionAndUpdateStatusBar(" << "dragAccepted=" << dragAccepted << ",accidentalDragAdjustedPoint=" << accidentalDragAdjustedPoint - << ")" << endl; -#endif + << ")"; // Prevent unintentional creation of 1-pixel selections. if (!dragAccepted && accidentalDragAdjustedPoint == startPoint ()) { - #if DEBUG_KP_TOOL_FREE_FROM_SELECTION && 1 qCDebug(kpLogTools) << "\tnon-text NOP - return"; - #endif setUserShapePoints (accidentalDragAdjustedPoint); return false; } @@ -109,11 +101,7 @@ // Get existing points in selection. points = oldPointsSel->cardinallyAdjacentPoints (); } - - -#if DEBUG_KP_TOOL_FREE_FROM_SELECTION qCDebug(kpLogTools) << "\tlast old point=" << points.last (); -#endif // TODO: There should be an upper limit on this before drawing the // polygon becomes too slow. @@ -127,11 +115,8 @@ // (deleted by kpDocument::setSelection()). oldPointsSel = nullptr; -#if DEBUG_KP_TOOL_FREE_FROM_SELECTION && 1 qCDebug(kpLogTools) << "\t\tfreeform; #points=" - << document ()->selection ()->calculatePoints ().count () - << endl; -#endif + << document ()->selection ()->calculatePoints ().count (); setUserShapePoints (accidentalDragAdjustedPoint); diff --git a/tools/selection/image/kpToolRectSelection.cpp b/tools/selection/image/kpToolRectSelection.cpp --- a/tools/selection/image/kpToolRectSelection.cpp +++ b/tools/selection/image/kpToolRectSelection.cpp @@ -25,8 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_RECT_SELECTION 0 - #include "kpToolRectSelection.h" #include "kpLogCategories.h" #include "document/kpDocument.h" @@ -60,9 +58,7 @@ // REFACTOR: This line is duplicated code with other tools. if (!dragAccepted && accidentalDragAdjustedPoint == startPoint ()) { - #if DEBUG_KP_TOOL_RECT_SELECTION && 1 qCDebug(kpLogTools) << "\tnon-text NOP - return"; - #endif setUserShapePoints (accidentalDragAdjustedPoint); return false; } diff --git a/tools/selection/kpAbstractSelectionTool.cpp b/tools/selection/kpAbstractSelectionTool.cpp --- a/tools/selection/kpAbstractSelectionTool.cpp +++ b/tools/selection/kpAbstractSelectionTool.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpAbstractSelectionTool.h" #include "kpAbstractSelectionToolPrivate.h" @@ -158,10 +154,8 @@ // protected void kpAbstractSelectionTool::pushOntoDocument () { -#if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "kpAbstractSelectionTool::pushOntoDocument() selection=" - << document ()->selection () << endl; -#endif + << document ()->selection (); Q_ASSERT (document ()->selection ()); environ ()->deselectSelection (); } @@ -196,9 +190,7 @@ if (d->currentSelContentCommand) { // Make the border creation a command. - #if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "\thave currentSelContentCommand"; - #endif commandHistory ()->addCreateSelectionCommand ( new kpToolSelectionCreateCommand ( /*virtual*/nameOfCreateCommand (), @@ -249,12 +241,9 @@ // private QString kpAbstractSelectionTool::haventBegunDrawUserMessage () { -#if DEBUG_KP_TOOL_SELECTION && 0 qCDebug(kpLogTools) << "kpAbstractSelectionTool::haventBegunDrawUserMessage()" " cancelledShapeButStillHoldingButtons=" - << d->cancelledShapeButStillHoldingButtons - << endl; -#endif + << d->cancelledShapeButStillHoldingButtons; if (d->cancelledShapeButStillHoldingButtons) return i18n ("Let go of all the mouse buttons."); @@ -267,9 +256,7 @@ // public virtual [base kpTool] void kpAbstractSelectionTool::begin () { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "kpAbstractSelectionTool<" << objectName () << ">::begin()"; -#endif ::AssertAllTimersInactive (d); @@ -309,14 +296,11 @@ // public virtual [base kpTool] void kpAbstractSelectionTool::end () { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "kpAbstractSelectionTool<" << objectName () << ">::end()"; -#endif if (document ()->selection ()) pushOntoDocument (); - endCreate (); endMove (); endResizeScale (); @@ -349,9 +333,7 @@ // public virtual [base kpTool] void kpAbstractSelectionTool::reselect () { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "kpAbstractSelectionTool::reselect()"; -#endif if (document ()->selection ()) pushOntoDocument (); @@ -362,9 +344,7 @@ // protected virtual kpAbstractSelectionTool::DrawType kpAbstractSelectionTool::calculateDrawTypeInsideSelection () const { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "\t\tis move"; -#endif return kpAbstractSelectionTool::Move; } @@ -376,9 +356,7 @@ kpAbstractSelection *sel = document ()->selection (); if (!sel) return Create; -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "\thas sel region rect=" << sel->boundingRect (); -#endif if (onSelectionResizeHandle () && !controlOrShiftPressed ()) return ResizeScale; @@ -393,13 +371,10 @@ // public virtual [base kpTool] void kpAbstractSelectionTool::beginDraw () { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "kpAbstractSelectionTool::beginDraw() startPoint ()=" << startPoint () << " QCursor::pos() view startPoint=" - << viewUnderStartPoint ()->mapFromGlobal (QCursor::pos ()) - << endl; -#endif + << viewUnderStartPoint ()->mapFromGlobal (QCursor::pos ()); // endDraw() and cancelShape() should have taken care of these. ::AssertAllTimersInactive (d); @@ -431,9 +406,7 @@ // public virtual [base kpTool] void kpAbstractSelectionTool::hover (const QPoint &point) { -#if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "kpAbstractSelectionTool::hover" << point; -#endif operation (calculateDrawType (), SetCursor); @@ -460,15 +433,9 @@ void kpAbstractSelectionTool::draw (const QPoint &thisPoint, const QPoint & /*lastPoint*/, const QRect &normalizedRect) { -#if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "kpAbstractSelectionTool::draw (" << thisPoint << ",startPoint=" << startPoint () - << ",normalizedRect=" << normalizedRect << ")" << endl; -#else - Q_UNUSED (thisPoint); - Q_UNUSED (normalizedRect); -#endif - + << ",normalizedRect=" << normalizedRect << ")"; // OPT: return when thisPoint == lastPoint () so that e.g. when creating // Points sel, press modifiers doesn't add multiple points in same @@ -484,10 +451,8 @@ // public virtual [base kpTool] void kpAbstractSelectionTool::cancelShape () { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "kpAbstractSelectionTool::cancelShape() mouseButton=" - << mouseButton () << endl; -#endif + << mouseButton (); const DrawType oldDrawType = d->drawType; // kpTool::hasBegunDraw() returns false in this method so be consistent @@ -502,9 +467,7 @@ if (d->currentSelContentCommand) { - #if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "\t\tundo sel content"; - #endif d->currentSelContentCommand->unexecute (); delete d->currentSelContentCommand; d->currentSelContentCommand = nullptr; @@ -537,38 +500,30 @@ // protected void kpAbstractSelectionTool::popupRMBMenu () { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "CALL - exec'ing menu"; -#endif QMenu *pop = environ ()->selectionToolRMBMenu (); Q_ASSERT (pop); // Blocks until the menu closes. // WARNING: Enters event loop - may re-enter view/tool event handlers. pop->exec (QCursor::pos ()); -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "calling somethingBelowTheCursorChanged()"; -#endif // Cursor may have moved while the menu was up, triggering QMouseMoveEvents // for the menu -- but not the view -- so we may have missed cursor moves. // Update cursor position now. somethingBelowTheCursorChanged (); -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "DONE"; -#endif } //--------------------------------------------------------------------- // public virtual [base kpTool] void kpAbstractSelectionTool::endDraw (const QPoint & /*thisPoint*/, const QRect & /*normalizedRect*/) { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "kpAbstractSelectionTool::endDraw()"; -#endif const DrawType oldDrawType = d->drawType; // kpTool::hasBegunDraw() returns false in this method so be consistent diff --git a/tools/selection/kpAbstractSelectionTool_Create.cpp b/tools/selection/kpAbstractSelectionTool_Create.cpp --- a/tools/selection/kpAbstractSelectionTool_Create.cpp +++ b/tools/selection/kpAbstractSelectionTool_Create.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpAbstractSelectionTool.h" #include "kpAbstractSelectionToolPrivate.h" @@ -156,15 +152,11 @@ void kpAbstractSelectionTool::drawCreate (const QPoint &thisPoint, const QRect &normalizedRect) { -#if DEBUG_KP_TOOL_SELECTION && 1 - qCDebug(kpLogTools) << "\tnot moving - resizing rect to" << normalizedRect - << endl; + qCDebug(kpLogTools) << "\tnot moving - resizing rect to" << normalizedRect; qCDebug(kpLogTools) << "\t\tcreateNOPTimer->isActive()=" << d->createNOPTimer->isActive () << " viewManhattanLength from startPoint=" - << viewUnderStartPoint ()->transformDocToViewX ((thisPoint - startPoint ()).manhattanLength ()) - << endl; -#endif + << viewUnderStartPoint ()->transformDocToViewX ((thisPoint - startPoint ()).manhattanLength ()); QPoint accidentalDragAdjustedPoint = thisPoint; if (d->createNOPTimer->isActive ()) @@ -175,16 +167,12 @@ if (viewUnderStartPoint ()->transformDocToViewX ( (accidentalDragAdjustedPoint - startPoint ()).manhattanLength ()) <= 6) { - #if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "\t\tsuppress accidental movement"; - #endif accidentalDragAdjustedPoint = startPoint (); } else { - #if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "\t\tit's a \"big\" intended move - stop timer"; - #endif d->createNOPTimer->stop (); } } @@ -201,9 +189,7 @@ Q_ASSERT (d->dragAccepted); if (d->dragAccepted) { - #if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "\t\tdrawHasDoneSomething - kill create timer"; - #endif // No longer a NOP. d->createNOPTimer->stop (); } @@ -216,14 +202,11 @@ // private slot void kpAbstractSelectionTool::delayedDrawCreate () { -#if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "kpAbstractSelectionTool::delayedDrawCreate() hasBegunDraw=" << hasBegunDraw () << " currentPoint=" << currentPoint () << " lastPoint=" << lastPoint () - << " startPoint=" << startPoint () - << endl; -#endif + << " startPoint=" << startPoint (); // (just in case not called from single shot) d->createNOPTimer->stop (); @@ -238,10 +221,7 @@ // private void kpAbstractSelectionTool::cancelCreate () { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "\twas creating sel - kill"; -#endif - d->createNOPTimer->stop (); // TODO: should we give the user back the selection s/he had before (if any)? diff --git a/tools/selection/kpAbstractSelectionTool_KeyboardEvents.cpp b/tools/selection/kpAbstractSelectionTool_KeyboardEvents.cpp --- a/tools/selection/kpAbstractSelectionTool_KeyboardEvents.cpp +++ b/tools/selection/kpAbstractSelectionTool_KeyboardEvents.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpAbstractSelectionTool.h" #include "kpAbstractSelectionToolPrivate.h" @@ -46,33 +42,24 @@ // protected virtual [base kpTool] void kpAbstractSelectionTool::keyPressEvent (QKeyEvent *e) { -#if DEBUG_KP_TOOL_SELECTION && 0 qCDebug(kpLogTools) << "kpAbstractSelectionTool::keyPressEvent(e->text='" - << e->text () << "')" << endl; -#endif + << e->text () << "')"; e->ignore (); if (document ()->selection () && !hasBegunDraw () && e->key () == Qt::Key_Escape) { - #if DEBUG_KP_TOOL_SELECTION && 0 - qCDebug(kpLogTools) << "\tescape pressed with sel when not begun draw - deselecting" - << endl; - #endif - + qCDebug(kpLogTools) << "\tescape pressed with sel when not begun draw - deselecting"; pushOntoDocument (); e->accept (); } else { - #if DEBUG_KP_TOOL_SELECTION && 0 qCDebug(kpLogTools) << "\tkey processing did not accept (text was '" << e->text () - << "') - passing on event to kpTool" - << endl; - #endif + << "') - passing on event to kpTool"; if ( document()->selection() && !hasBegunDraw() && ((e->key() == Qt::Key_Left) || diff --git a/tools/selection/kpAbstractSelectionTool_Move.cpp b/tools/selection/kpAbstractSelectionTool_Move.cpp --- a/tools/selection/kpAbstractSelectionTool_Move.cpp +++ b/tools/selection/kpAbstractSelectionTool_Move.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpAbstractSelectionTool.h" #include "kpAbstractSelectionToolPrivate.h" #include "kpLogCategories.h" @@ -180,24 +176,19 @@ // private void kpAbstractSelectionTool::drawMove (const QPoint &thisPoint, const QRect &/*normalizedRect*/) { -#if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "\tmoving selection"; -#endif kpAbstractSelection *sel = document ()->selection (); QRect targetSelRect (thisPoint.x () - d->startMoveDragFromSelectionTopLeft.x (), thisPoint.y () - d->startMoveDragFromSelectionTopLeft.y (), sel->width (), sel->height ()); -#if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "\t\tstartPoint=" << startPoint () << " thisPoint=" << thisPoint << " startDragFromSel=" << d->startMoveDragFromSelectionTopLeft - << " targetSelRect=" << targetSelRect - << endl; -#endif + << " targetSelRect=" << targetSelRect; // Try to make sure selection still intersects document so that it's // reachable. @@ -212,18 +203,13 @@ else if (targetSelRect.top () >= document ()->height ()) targetSelRect.translate (0, document ()->height () - targetSelRect.top () - 1); -#if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "\t\t\tafter ensure sel rect clickable=" << targetSelRect; -#endif if (!d->dragAccepted && targetSelRect.topLeft () + d->startMoveDragFromSelectionTopLeft == startPoint ()) { - #if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "\t\t\t\tnop"; - #endif - if (!d->RMBMoveUpdateGUITimer->isActive ()) { @@ -289,19 +275,15 @@ // private void kpAbstractSelectionTool::cancelMove () { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "\twas drag moving - undo drag and undo acquire"; -#endif d->RMBMoveUpdateGUITimer->stop (); // NOP drag? if (!d->currentMoveCommand) return; -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "\t\tundo currentMoveCommand"; -#endif d->currentMoveCommand->finalize (); d->currentMoveCommand->unexecute (); delete d->currentMoveCommand; @@ -330,9 +312,7 @@ d->currentMoveCommand->finalize (); kpMacroCommand *renamedCmd = nullptr; -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "\thave moveCommand"; -#endif if (d->currentMoveCommandIsSmear) { renamedCmd = new kpMacroCommand (i18n ("%1: Smear", diff --git a/tools/selection/kpAbstractSelectionTool_ResizeScale.cpp b/tools/selection/kpAbstractSelectionTool_ResizeScale.cpp --- a/tools/selection/kpAbstractSelectionTool_ResizeScale.cpp +++ b/tools/selection/kpAbstractSelectionTool_ResizeScale.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_SELECTION 0 - - #include "kpAbstractSelectionTool.h" #include "kpAbstractSelectionToolPrivate.h" #include "kpLogCategories.h" @@ -106,10 +102,8 @@ // private void kpAbstractSelectionTool::setCursorResizeScale () { -#if DEBUG_KP_TOOL_SELECTION && 0 qCDebug(kpLogTools) << "\tonSelectionResizeHandle=" - << onSelectionResizeHandle () << endl; -#endif + << onSelectionResizeHandle (); Qt::CursorShape shape = Qt::ArrowCursor; switch (onSelectionResizeHandle ()) @@ -280,13 +274,10 @@ *newY -= (*newHeight - originalSelection.height ()); } -#if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "\t\tnewX=" << *newX << " newY=" << *newY << " newWidth=" << *newWidth - << " newHeight=" << *newHeight - << endl; -#endif + << " newHeight=" << *newHeight; } //--------------------------------------------------------------------- @@ -296,17 +287,13 @@ const QPoint &thisPoint, const QRect &/*normalizedRect*/) { -#if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "\tresize/scale"; -#endif kpAbstractSelection *sel = document ()->selection (); if (!d->dragAccepted && thisPoint == startPoint ()) { - #if DEBUG_KP_TOOL_SELECTION && 1 qCDebug(kpLogTools) << "\t\tnop"; - #endif setUserShapePoints (QPoint (sel->width (), sel->height ())); return; @@ -365,17 +352,13 @@ // private void kpAbstractSelectionTool::cancelResizeScale () { -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "\twas resize/scale sel - kill"; -#endif // NOP drag? if (!d->currentResizeScaleCommand) return; -#if DEBUG_KP_TOOL_SELECTION qCDebug(kpLogTools) << "\t\tundo currentResizeScaleCommand"; -#endif d->currentResizeScaleCommand->finalize (); // (unneeded but let's be safe) d->currentResizeScaleCommand->unexecute (); delete d->currentResizeScaleCommand; diff --git a/tools/selection/text/kpToolText.cpp b/tools/selection/text/kpToolText.cpp --- a/tools/selection/text/kpToolText.cpp +++ b/tools/selection/text/kpToolText.cpp @@ -27,9 +27,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "tools/selection/text/kpToolText.h" #include "kpToolTextPrivate.h" #include "kpLogCategories.h" @@ -69,11 +66,9 @@ kpAbstractSelectionContentCommand *kpToolText::newGiveContentCommand () const { kpTextSelection *textSel = document ()->textSelection (); -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::newGiveContentCommand()" << " textSel=" << textSel - << "; hasContent=" << textSel->hasContent () << endl; -#endif + << "; hasContent=" << textSel->hasContent (); Q_ASSERT (textSel && !textSel->hasContent ()); return new kpToolTextGiveContentCommand ( @@ -105,9 +100,7 @@ // public virtual [base kpAbstractSelectionTool] void kpToolText::begin () { -#if DEBUG_KP_TOOL_TEXT && 1 qCDebug(kpLogTools) << "kpToolText::begin()"; -#endif environ ()->enableTextToolBarActions (true); @@ -125,9 +118,7 @@ // public virtual [base kpAbstractSelectionTool] void kpToolText::end () { -#if DEBUG_KP_TOOL_TEXT && 1 qCDebug(kpLogTools) << "kpToolText::end()"; -#endif kpAbstractSelectionTool::end (); @@ -170,9 +161,7 @@ // public virtual [base kpAbstractSelectionTool] void kpToolText::cancelShape () { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::cancelShape()"; -#endif if (drawType () != None) kpAbstractSelectionTool::cancelShape (); @@ -190,9 +179,7 @@ // public virtual [base kpTool] void kpToolText::endShape (const QPoint &thisPoint, const QRect &normalizedRect) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::endShape()"; -#endif if (drawType () != None) kpAbstractSelectionTool::endDraw (thisPoint, normalizedRect); diff --git a/tools/selection/text/kpToolText_Commands.cpp b/tools/selection/text/kpToolText_Commands.cpp --- a/tools/selection/text/kpToolText_Commands.cpp +++ b/tools/selection/text/kpToolText_Commands.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "kpToolText.h" #include "kpToolTextPrivate.h" #include "kpLogCategories.h" diff --git a/tools/selection/text/kpToolText_Create.cpp b/tools/selection/text/kpToolText_Create.cpp --- a/tools/selection/text/kpToolText_Create.cpp +++ b/tools/selection/text/kpToolText_Create.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "tools/selection/text/kpToolText.h" #include "kpToolTextPrivate.h" @@ -107,11 +104,9 @@ int *minimumWidthOut, int *minimumHeightOut, bool *newDragAccepted) { -#if DEBUG_KP_TOOL_TEXT && 1 qCDebug(kpLogTools) << "CALL(dragAccepted=" << dragAccepted << ",accidentalDragAdjustedPoint=" << accidentalDragAdjustedPoint << ")"; -#endif *newDragAccepted = dragAccepted; // Is the drag so short that we're essentially just clicking? @@ -122,9 +117,7 @@ // We had an existing text box before the click? if (hadSelectionBeforeDraw ()) { - #if DEBUG_KP_TOOL_TEXT && 1 qCDebug(kpLogTools) << "\ttext box deselect - NOP - return"; - #endif // We must be attempting to deselect the text box. // This deselection has already been done by kpAbstractSelectionTool::beginDraw(). // Therefore, we are not doing a drag. @@ -142,9 +135,7 @@ // branch [x] will execute and the size will be determined based on // the size of the drag instead. - #if DEBUG_KP_TOOL_TEXT && 1 qCDebug(kpLogTools) << "\tclick creating text box"; - #endif // (Click creating text box with RMB would not be obvious // since RMB menu most likely hides text box immediately @@ -186,9 +177,7 @@ // The size will be determined based on the size of the drag. else { - #if DEBUG_KP_TOOL_TEXT && 1 qCDebug(kpLogTools) << "\tdrag creating text box"; - #endif *minimumWidthOut = kpTextSelection::MinimumWidthForTextStyle (textStyle); *minimumHeightOut = kpTextSelection::MinimumHeightForTextStyle (textStyle); @@ -246,12 +235,9 @@ normalizedRect.setY (normalizedRect.bottom () - minimumHeight + 1); } -#if DEBUG_KP_TOOL_TEXT && 1 qCDebug(kpLogTools) << "\t\tnormalizedRect=" << normalizedRect << " kpTextSelection::preferredMinimumSize=" - << QSize (minimumWidth, minimumHeight) - << endl; -#endif + << QSize (minimumWidth, minimumHeight); // diff --git a/tools/selection/text/kpToolText_CursorCalc.cpp b/tools/selection/text/kpToolText_CursorCalc.cpp --- a/tools/selection/text/kpToolText_CursorCalc.cpp +++ b/tools/selection/text/kpToolText_CursorCalc.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "tools/selection/text/kpToolText.h" #include "kpLogCategories.h" #include "document/kpDocument.h" diff --git a/tools/selection/text/kpToolText_InputMethodEvents.cpp b/tools/selection/text/kpToolText_InputMethodEvents.cpp --- a/tools/selection/text/kpToolText_InputMethodEvents.cpp +++ b/tools/selection/text/kpToolText_InputMethodEvents.cpp @@ -27,9 +27,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "tools/selection/text/kpToolText.h" #include "kpToolTextPrivate.h" #include "commands/tools/selection/text/kpToolTextInsertCommand.h" @@ -47,13 +44,11 @@ void kpToolText::inputMethodEvent (QInputMethodEvent *e) { -#if DEBUG_KP_TOOL_TEXT && 1 qCDebug(kpLogTools) << "kpToolText::inputMethodEvent() preeditString='" << e->preeditString () << "commitString = " << e->commitString () << " replacementStart=" << e->replacementStart () - << " replacementLength=" << e->replacementLength () - << endl; -#endif + << " replacementLength=" << e->replacementLength (); + kpTextSelection *textSel = document ()->textSelection (); if (hasBegunDraw() || !textSel) { diff --git a/tools/selection/text/kpToolText_KeyboardEvents.cpp b/tools/selection/text/kpToolText_KeyboardEvents.cpp --- a/tools/selection/text/kpToolText_KeyboardEvents.cpp +++ b/tools/selection/text/kpToolText_KeyboardEvents.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "tools/selection/text/kpToolText.h" #include "kpToolTextPrivate.h" @@ -58,40 +55,30 @@ (e->type () == QEvent::ShortcutOverride); const bool haveTextSelection = document ()->textSelection (); -#if DEBUG_KP_TOOL_TEXT && 0 qCDebug(kpLogTools) << "kpToolText::viewEvent() type=" << e->type () << " isShortcutOverrideEvent=" << isShortcutOverrideEvent - << " haveTextSel=" << haveTextSelection - << endl; -#endif + << " haveTextSel=" << haveTextSelection; if (!isShortcutOverrideEvent || !haveTextSelection) return kpAbstractSelectionTool::viewEvent (e); QKeyEvent *ke = static_cast (e); -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::viewEvent() key=" << ke->key () << " modifiers=" << ke->modifiers () - << " QChar.isPrint()=" << QChar (ke->key ()).isPrint () - << endl; -#endif + << " QChar.isPrint()=" << QChar (ke->key ()).isPrint (); // Can't be shortcut? if (ke->key () == 0 && ke->key () == Qt::Key_unknown) { - #if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tcan't be shortcut - safe to not react"; - #endif } // Normal letter (w/ or w/o shift, keypad button ok)? // TODO: don't like this check else if ((ke->modifiers () & (Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier)) == 0 && !( ke->text ().isEmpty ())) { - #if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tis text - grab"; - #endif e->accept (); } else @@ -108,45 +95,31 @@ // protected virtual [base kpAbstractSelectionTool] void kpToolText::keyPressEvent (QKeyEvent *e) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::keyPressEvent(e->text='" << e->text () << "')"; -#endif - e->ignore (); - if (hasBegunDraw ()) { - #if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\talready began draw with mouse - passing on event to kpTool"; - #endif kpAbstractSelectionTool::keyPressEvent (e); return; } - kpTextSelection * const textSel = document ()->textSelection (); if (!textSel) { - #if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tno text sel - passing on event to kpTool"; - #endif - //if (hasBegunShape ()) - // endShape (currentPoint (), normalizedRect ()); - kpAbstractSelectionTool::keyPressEvent (e); return; } - // (All handle.+()'s require this info) const QList textLines = textSel->textLines (); const int cursorRow = viewManager ()->textCursorRow (); const int cursorCol = viewManager ()->textCursorCol (); - // TODO: KTextEdit::keyPressEvent() uses KStandardShortcut instead of hardcoding; same fix for kpTool? switch (e->key ()) { @@ -184,29 +157,21 @@ handleDeleteKeyPress (e, textLines, cursorRow, cursorCol); break; - case Qt::Key_Enter: case Qt::Key_Return: handleEnterKeyPress (e, textLines, cursorRow, cursorCol); break; - default: handleTextTyped (e, textLines, cursorRow, cursorCol); break; } - if (!e->isAccepted ()) { - #if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tkey processing did not accept (text was '" << e->text () - << "') - passing on event to kpAbstractSelectionTool" - << endl; - #endif - //if (hasBegunShape ()) - // endShape (currentPoint (), normalizedRect ()); + << "') - passing on event to kpAbstractSelectionTool"; kpAbstractSelectionTool::keyPressEvent (e); return; diff --git a/tools/selection/text/kpToolText_KeyboardEvents_HandleArrowKeys.cpp b/tools/selection/text/kpToolText_KeyboardEvents_HandleArrowKeys.cpp --- a/tools/selection/text/kpToolText_KeyboardEvents_HandleArrowKeys.cpp +++ b/tools/selection/text/kpToolText_KeyboardEvents_HandleArrowKeys.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "tools/selection/text/kpToolText.h" #include "kpToolTextPrivate.h" @@ -53,9 +50,7 @@ void kpToolText::handleUpKeyPress (QKeyEvent *e, const QList &textLines, int cursorRow, int cursorCol) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tup pressed"; -#endif if (hasBegunShape ()) endShape (currentPoint (), normalizedRect ()); @@ -74,9 +69,7 @@ void kpToolText::handleDownKeyPress (QKeyEvent *e, const QList &textLines, int cursorRow, int cursorCol) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tdown pressed"; -#endif if (hasBegunShape ()) endShape (currentPoint (), normalizedRect ()); @@ -95,30 +88,22 @@ void kpToolText::handleLeftKeyPress (QKeyEvent *e, const QList &textLines, int cursorRow, int cursorCol) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tleft pressed"; -#endif if (hasBegunShape ()) endShape (currentPoint (), normalizedRect ()); if (!textLines.isEmpty ()) { if ((e->modifiers () & Qt::ControlModifier) == 0) { - #if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tmove single char"; - #endif - MoveCursorLeft (textLines, &cursorRow, &cursorCol); viewManager ()->setTextCursorPosition (cursorRow, cursorCol); } else { - #if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tmove to start of word"; - #endif - MoveCursorToWordStart (textLines, &cursorRow, &cursorCol); viewManager ()->setTextCursorPosition (cursorRow, cursorCol); } @@ -131,30 +116,22 @@ void kpToolText::handleRightKeyPress (QKeyEvent *e, const QList &textLines, int cursorRow, int cursorCol) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tright pressed"; -#endif if (hasBegunShape ()) endShape (currentPoint (), normalizedRect ()); if (!textLines.isEmpty ()) { if ((e->modifiers () & Qt::ControlModifier) == 0) { - #if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tmove single char"; - #endif - MoveCursorRight (textLines, &cursorRow, &cursorCol); viewManager ()->setTextCursorPosition (cursorRow, cursorCol); } else { - #if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tmove to start of next word"; - #endif - MoveCursorToNextWordStart (textLines, &cursorRow, &cursorCol); viewManager ()->setTextCursorPosition (cursorRow, cursorCol); } @@ -168,9 +145,7 @@ void kpToolText::handleHomeKeyPress (QKeyEvent *e, const QList &textLines, int cursorRow, int cursorCol) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\thome pressed"; -#endif if (hasBegunShape ()) endShape (currentPoint (), normalizedRect ()); @@ -192,10 +167,7 @@ void kpToolText::handleEndKeyPress (QKeyEvent *e, const QList &textLines, int cursorRow, int cursorCol) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tend pressed"; -#endif - if (hasBegunShape ()) endShape (currentPoint (), normalizedRect ()); diff --git a/tools/selection/text/kpToolText_KeyboardEvents_HandleTypingKeys.cpp b/tools/selection/text/kpToolText_KeyboardEvents_HandleTypingKeys.cpp --- a/tools/selection/text/kpToolText_KeyboardEvents_HandleTypingKeys.cpp +++ b/tools/selection/text/kpToolText_KeyboardEvents_HandleTypingKeys.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "tools/selection/text/kpToolText.h" #include "kpToolTextPrivate.h" #include "kpLogCategories.h" @@ -53,9 +50,7 @@ void kpToolText::handleBackspaceKeyPress (QKeyEvent *e, const QList &textLines, int cursorRow, int cursorCol) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tbackspace pressed"; -#endif if (!textLines.isEmpty ()) { @@ -95,9 +90,7 @@ void kpToolText::handleDeleteKeyPress (QKeyEvent *e, const QList & textLines, int cursorRow, int cursorCol) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tdelete pressed"; -#endif if (!textLines.isEmpty ()) { @@ -142,9 +135,7 @@ void kpToolText::handleEnterKeyPress (QKeyEvent *e, const QList & /*textLines*/, int /*cursorRow*/, int /*cursorCol*/) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tenter pressed"; -#endif // It's OK for to be empty. @@ -162,18 +153,14 @@ void kpToolText::handleTextTyped (QKeyEvent *e, const QList & /*textLines*/, int /*cursorRow*/, int /*cursorCol*/) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\ttext=" << e->text(); -#endif QString usableText; for (int i = 0; i < e->text ().length (); i++) { if (e->text ().at (i).isPrint ()) usableText += e->text ().at (i); } -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tusableText=" << usableText; -#endif if (usableText.isEmpty ()) { diff --git a/tools/selection/text/kpToolText_Move.cpp b/tools/selection/text/kpToolText_Move.cpp --- a/tools/selection/text/kpToolText_Move.cpp +++ b/tools/selection/text/kpToolText_Move.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "tools/selection/text/kpToolText.h" #include "kpToolTextPrivate.h" diff --git a/tools/selection/text/kpToolText_ResizeScale.cpp b/tools/selection/text/kpToolText_ResizeScale.cpp --- a/tools/selection/text/kpToolText_ResizeScale.cpp +++ b/tools/selection/text/kpToolText_ResizeScale.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "tools/selection/text/kpToolText.h" #include "kpToolTextPrivate.h" @@ -42,7 +39,6 @@ return i18n ("Left drag to resize text box."); } - // protected virtual [base kpAbstractSelectionTool] void kpToolText::setSelectionBorderForBeginDrawResizeScale () { diff --git a/tools/selection/text/kpToolText_SelectText.cpp b/tools/selection/text/kpToolText_SelectText.cpp --- a/tools/selection/text/kpToolText_SelectText.cpp +++ b/tools/selection/text/kpToolText_SelectText.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "tools/selection/text/kpToolText.h" #include "kpToolTextPrivate.h" @@ -66,9 +63,7 @@ // private void kpToolText::beginDrawSelectText () { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\t\tis select cursor pos"; -#endif kpTextSelection *textSel = document ()->textSelection (); Q_ASSERT (textSel); @@ -84,11 +79,9 @@ newRow = newCol = 0; } -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\t\t\told: row=" << viewManager ()->textCursorRow () << "col=" << viewManager ()->textCursorCol (); qCDebug(kpLogTools) << "\t\t\tnew: row=" << newRow << "col=" << newCol; -#endif viewManager ()->setTextCursorPosition (newRow, newCol); } diff --git a/tools/selection/text/kpToolText_TextStyle.cpp b/tools/selection/text/kpToolText_TextStyle.cpp --- a/tools/selection/text/kpToolText_TextStyle.cpp +++ b/tools/selection/text/kpToolText_TextStyle.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_TEXT 0 - - #include "tools/selection/text/kpToolText.h" #include "kpToolTextPrivate.h" #include "kpLogCategories.h" @@ -53,19 +50,14 @@ { if (environ ()->settingTextStyle ()) { - #if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\trecursion - abort setting text style: " - << environ ()->settingTextStyle () - << endl; - #endif + << environ ()->settingTextStyle (); return false; } if (!document ()->textSelection ()) { - #if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "\tno text selection - abort setting text style"; - #endif return false; } @@ -77,9 +69,7 @@ const kpTextStyle &newTextStyle, const kpTextStyle &oldTextStyle) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::changeTextStyle(" << name << ")"; -#endif if (hasBegunShape ()) endShape (currentPoint (), normalizedRect ()); @@ -96,9 +86,7 @@ // protected slot virtual [base kpAbstractSelectionTool] void kpToolText::slotIsOpaqueChanged (bool isOpaque) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::slotIsOpaqueChanged()"; -#endif if (!shouldChangeTextStyle ()) return; @@ -119,9 +107,7 @@ void kpToolText::slotColorsSwapped (const kpColor &newForegroundColor, const kpColor &newBackgroundColor) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::slotColorsSwapped()"; -#endif if (!shouldChangeTextStyle ()) return; @@ -140,9 +126,7 @@ // protected slot virtual [base kpTool] void kpToolText::slotForegroundColorChanged (const kpColor & /*color*/) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::slotForegroundColorChanged()"; -#endif if (!shouldChangeTextStyle ()) return; @@ -160,9 +144,7 @@ // protected slot virtual [base kpAbstractSelectionTool] void kpToolText::slotBackgroundColorChanged (const kpColor & /*color*/) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::slotBackgroundColorChanged()"; -#endif if (!shouldChangeTextStyle ()) return; @@ -189,15 +171,10 @@ void kpToolText::slotFontFamilyChanged (const QString &fontFamily, const QString &oldFontFamily) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::slotFontFamilyChanged() new=" << fontFamily << " old=" - << oldFontFamily - << endl; -#else - (void) fontFamily; -#endif + << oldFontFamily; if (!shouldChangeTextStyle ()) return; @@ -216,15 +193,10 @@ // public slot void kpToolText::slotFontSizeChanged (int fontSize, int oldFontSize) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::slotFontSizeChanged() new=" << fontSize << " old=" - << oldFontSize - << endl; -#else - (void) fontSize; -#endif + << oldFontSize; if (!shouldChangeTextStyle ()) return; @@ -244,9 +216,7 @@ // public slot void kpToolText::slotBoldChanged (bool isBold) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::slotBoldChanged(" << isBold << ")"; -#endif if (!shouldChangeTextStyle ()) return; @@ -265,9 +235,7 @@ // public slot void kpToolText::slotItalicChanged (bool isItalic) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::slotItalicChanged(" << isItalic << ")"; -#endif if (!shouldChangeTextStyle ()) return; @@ -286,9 +254,7 @@ // public slot void kpToolText::slotUnderlineChanged (bool isUnderline) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::slotUnderlineChanged(" << isUnderline << ")"; -#endif if (!shouldChangeTextStyle ()) return; @@ -307,9 +273,7 @@ // public slot void kpToolText::slotStrikeThruChanged (bool isStrikeThru) { -#if DEBUG_KP_TOOL_TEXT qCDebug(kpLogTools) << "kpToolText::slotStrikeThruChanged(" << isStrikeThru << ")"; -#endif if (!shouldChangeTextStyle ()) return; diff --git a/views/kpThumbnailView.cpp b/views/kpThumbnailView.cpp --- a/views/kpThumbnailView.cpp +++ b/views/kpThumbnailView.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_THUMBNAIL_VIEW 0 - - #include "views/kpThumbnailView.h" #include "kpLogCategories.h" diff --git a/views/kpUnzoomedThumbnailView.cpp b/views/kpUnzoomedThumbnailView.cpp --- a/views/kpUnzoomedThumbnailView.cpp +++ b/views/kpUnzoomedThumbnailView.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_UNZOOMED_THUMBNAIL_VIEW 0 - - #include "views/kpUnzoomedThumbnailView.h" #include "kpLogCategories.h" diff --git a/views/kpView.cpp b/views/kpView.cpp --- a/views/kpView.cpp +++ b/views/kpView.cpp @@ -27,11 +27,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_VIEW 0 -#define DEBUG_KP_VIEW_RENDERER ((DEBUG_KP_VIEW && 1) || 0) - - #include "kpView.h" #include "kpViewPrivate.h" diff --git a/views/kpView_Paint.cpp b/views/kpView_Paint.cpp --- a/views/kpView_Paint.cpp +++ b/views/kpView_Paint.cpp @@ -25,11 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_VIEW 0 -#define DEBUG_KP_VIEW_RENDERER ((DEBUG_KP_VIEW && 1) || 0) - - #include "views/kpView.h" #include "kpViewPrivate.h" @@ -82,9 +77,7 @@ if (doc) { docRect = docRect.intersected (doc->rect ()); - #if DEBUG_KP_VIEW_RENDERER && 1 qCDebug(kpLogViews) << "\tintersected with doc=" << docRect; - #endif } return docRect; diff --git a/views/kpZoomedView.cpp b/views/kpZoomedView.cpp --- a/views/kpZoomedView.cpp +++ b/views/kpZoomedView.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_ZOOMED_VIEW 0 - - #include "views/kpZoomedView.h" #include "kpLogCategories.h" diff --git a/views/manager/kpViewManager.cpp b/views/manager/kpViewManager.cpp --- a/views/manager/kpViewManager.cpp +++ b/views/manager/kpViewManager.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_VIEW_MANAGER 0 - - #include "views/manager/kpViewManager.h" #include "kpViewManagerPrivate.h" diff --git a/views/manager/kpViewManager_TextCursor.cpp b/views/manager/kpViewManager_TextCursor.cpp --- a/views/manager/kpViewManager_TextCursor.cpp +++ b/views/manager/kpViewManager_TextCursor.cpp @@ -43,10 +43,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_VIEW_MANAGER 0 - - #include "kpViewManager.h" #include "kpViewManagerPrivate.h" diff --git a/views/manager/kpViewManager_ViewUpdates.cpp b/views/manager/kpViewManager_ViewUpdates.cpp --- a/views/manager/kpViewManager_ViewUpdates.cpp +++ b/views/manager/kpViewManager_ViewUpdates.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_VIEW_MANAGER 0 - - #include "views/manager/kpViewManager.h" #include "kpViewManagerPrivate.h" diff --git a/widgets/colorSimilarity/kpColorSimilarityCubeRenderer.cpp b/widgets/colorSimilarity/kpColorSimilarityCubeRenderer.cpp --- a/widgets/colorSimilarity/kpColorSimilarityCubeRenderer.cpp +++ b/widgets/colorSimilarity/kpColorSimilarityCubeRenderer.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_COLOR_SIMILARITY_CUBE 0 - - #include "kpColorSimilarityCubeRenderer.h" #include diff --git a/widgets/colorSimilarity/kpColorSimilarityFrame.cpp b/widgets/colorSimilarity/kpColorSimilarityFrame.cpp --- a/widgets/colorSimilarity/kpColorSimilarityFrame.cpp +++ b/widgets/colorSimilarity/kpColorSimilarityFrame.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_COLOR_SIMILARITY_CUBE 0 - - #include "kpColorSimilarityFrame.h" #include "kpColorSimilarityCubeRenderer.h" diff --git a/widgets/colorSimilarity/kpColorSimilarityHolder.cpp b/widgets/colorSimilarity/kpColorSimilarityHolder.cpp --- a/widgets/colorSimilarity/kpColorSimilarityHolder.cpp +++ b/widgets/colorSimilarity/kpColorSimilarityHolder.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_COLOR_SIMILARITY_CUBE 0 - - #include "kpColorSimilarityHolder.h" #include "kpColorSimilarityCubeRenderer.h" @@ -173,9 +169,7 @@ // public virtual void kpColorSimilarityHolder::setColorSimilarity (double similarity) { -#if DEBUG_KP_COLOR_SIMILARITY_CUBE qCDebug(kpLogWidgets) << "kpColorSimilarityHolder::setColorSimilarity(" << similarity << ")"; -#endif if (m_colorSimilarity == similarity) return; diff --git a/widgets/imagelib/effects/kpEffectBalanceWidget.cpp b/widgets/imagelib/effects/kpEffectBalanceWidget.cpp --- a/widgets/imagelib/effects/kpEffectBalanceWidget.cpp +++ b/widgets/imagelib/effects/kpEffectBalanceWidget.cpp @@ -24,10 +24,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_BALANCE 0 - - #include "kpEffectBalanceWidget.h" #include "imagelib/effects/kpEffectBalance.h" @@ -46,11 +42,6 @@ #include #include -#if DEBUG_KP_EFFECT_BALANCE - #include -#endif - - kpEffectBalanceWidget::kpEffectBalanceWidget (bool actOnSelection, QWidget *parent) : kpEffectWidgetBase (actOnSelection, parent) diff --git a/widgets/imagelib/effects/kpEffectBlurSharpenWidget.cpp b/widgets/imagelib/effects/kpEffectBlurSharpenWidget.cpp --- a/widgets/imagelib/effects/kpEffectBlurSharpenWidget.cpp +++ b/widgets/imagelib/effects/kpEffectBlurSharpenWidget.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_BLUR_SHARPEN 0 - - #include "kpEffectBlurSharpenWidget.h" #include "commands/imagelib/effects/kpEffectBlurSharpenCommand.h" diff --git a/widgets/imagelib/effects/kpEffectEmbossWidget.cpp b/widgets/imagelib/effects/kpEffectEmbossWidget.cpp --- a/widgets/imagelib/effects/kpEffectEmbossWidget.cpp +++ b/widgets/imagelib/effects/kpEffectEmbossWidget.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_EMBOSS 0 - - #include "kpEffectEmbossWidget.h" #include diff --git a/widgets/imagelib/effects/kpEffectFlattenWidget.cpp b/widgets/imagelib/effects/kpEffectFlattenWidget.cpp --- a/widgets/imagelib/effects/kpEffectFlattenWidget.cpp +++ b/widgets/imagelib/effects/kpEffectFlattenWidget.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_FLATTEN 0 - - #include "kpEffectFlattenWidget.h" #include "kpDefs.h" diff --git a/widgets/imagelib/effects/kpEffectInvertWidget.cpp b/widgets/imagelib/effects/kpEffectInvertWidget.cpp --- a/widgets/imagelib/effects/kpEffectInvertWidget.cpp +++ b/widgets/imagelib/effects/kpEffectInvertWidget.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_INVERT 0 - - #include "kpEffectInvertWidget.h" #include "imagelib/effects/kpEffectInvert.h" diff --git a/widgets/imagelib/effects/kpEffectReduceColorsWidget.cpp b/widgets/imagelib/effects/kpEffectReduceColorsWidget.cpp --- a/widgets/imagelib/effects/kpEffectReduceColorsWidget.cpp +++ b/widgets/imagelib/effects/kpEffectReduceColorsWidget.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_EFFECT_REDUCE_COLORS 0 - - #include "kpEffectReduceColorsWidget.h" #include "imagelib/effects/kpEffectReduceColors.h" diff --git a/widgets/kpDualColorButton.cpp b/widgets/kpDualColorButton.cpp --- a/widgets/kpDualColorButton.cpp +++ b/widgets/kpDualColorButton.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_DUAL_COLOR_BUTTON 0 - - #include "kpDualColorButton.h" #include "views/kpView.h" diff --git a/widgets/kpPrintDialogPage.cpp b/widgets/kpPrintDialogPage.cpp --- a/widgets/kpPrintDialogPage.cpp +++ b/widgets/kpPrintDialogPage.cpp @@ -26,10 +26,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_PRINT_DIALOG_PAGE 0 - - #include "kpPrintDialogPage.h" #include diff --git a/widgets/kpTransparentColorCell.cpp b/widgets/kpTransparentColorCell.cpp --- a/widgets/kpTransparentColorCell.cpp +++ b/widgets/kpTransparentColorCell.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TRANSPARENT_COLOR_CELL 0 - - #include "kpTransparentColorCell.h" #include "imagelib/kpColor.h" diff --git a/widgets/toolbars/kpColorToolBar.cpp b/widgets/toolbars/kpColorToolBar.cpp --- a/widgets/toolbars/kpColorToolBar.cpp +++ b/widgets/toolbars/kpColorToolBar.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_COLOR_TOOL_BAR 0 - - #include "widgets/toolbars/kpColorToolBar.h" #include diff --git a/widgets/toolbars/kpToolToolBar.cpp b/widgets/toolbars/kpToolToolBar.cpp --- a/widgets/toolbars/kpToolToolBar.cpp +++ b/widgets/toolbars/kpToolToolBar.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_TOOL_BAR 0 - - #include "widgets/toolbars/kpToolToolBar.h" #include diff --git a/widgets/toolbars/options/kpToolWidgetBase.cpp b/widgets/toolbars/options/kpToolWidgetBase.cpp --- a/widgets/toolbars/options/kpToolWidgetBase.cpp +++ b/widgets/toolbars/options/kpToolWidgetBase.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_WIDGET_BASE 0 - - #include "kpToolWidgetBase.h" #include "kpDefs.h" @@ -96,13 +92,10 @@ // public void kpToolWidgetBase::finishConstruction (int fallBackRow, int fallBackCol) { -#if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "kpToolWidgetBase(" << objectName () << ")::kpToolWidgetBase(fallBack:row=" << fallBackRow << ",col=" << fallBackCol - << ")" - << endl; -#endif + << ")"; relayoutOptions (); @@ -209,12 +202,9 @@ col = cfg.readEntry (objectName () + QLatin1String (" Col"), -1); } -#if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "kpToolWidgetBase(" << objectName () << ")::defaultSelectedRowAndCol() returning row=" << row - << " col=" << col - << endl; -#endif + << " col=" << col; return qMakePair (row, col); } @@ -240,11 +230,9 @@ // public void kpToolWidgetBase::saveSelectedAsDefault () const { -#if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "kpToolWidgetBase(" << objectName () << ")::saveSelectedAsDefault() row=" << m_selectedRow - << " col=" << m_selectedCol << endl; -#endif + << " col=" << m_selectedCol; if (objectName ().isEmpty ()) return; @@ -261,27 +249,21 @@ // public void kpToolWidgetBase::relayoutOptions () { -#if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "kpToolWidgetBase::relayoutOptions() size=" << size (); -#endif while (!m_pixmaps.isEmpty () && m_pixmaps.last ().count () == 0) { - #if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\tkilling #" << m_pixmaps.count () - 1; - #endif m_pixmaps.removeLast (); m_pixmapRects.removeLast (); m_toolTips.removeLast (); } if (m_pixmaps.isEmpty ()) return; -#if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\tsurvived killing of empty rows"; qCDebug(kpLogWidgets) << "\tfinding heights of rows:"; -#endif QList maxHeightOfRow; for (int r = 0; r < m_pixmaps.count (); r++) @@ -294,39 +276,29 @@ if (c == 0 || m_pixmaps [r][c].height () > maxHeightOfRow [r]) maxHeightOfRow [r] = m_pixmaps [r][c].height (); } - #if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\t\t" << r << ": " << maxHeightOfRow [r]; - #endif } QList rowYOffset = spreadOutElements (maxHeightOfRow, height ()); -#if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\tspread out offsets of rows:"; for (int r = 0; r < (int) rowYOffset.count (); r++) qCDebug(kpLogWidgets) << "\t\t" << r << ": " << rowYOffset [r]; -#endif for (int r = 0; r < m_pixmaps.count (); r++) { - #if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\tlaying out row " << r << ":"; - #endif QList widths; for (int c = 0; c < m_pixmaps [r].count (); c++) widths.append (m_pixmaps [r][c].width ()); - #if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\t\twidths of cols:"; for (int c = 0; c < m_pixmaps [r].count (); c++) qCDebug(kpLogWidgets) << "\t\t\t" << c << ": " << widths [c]; - #endif QList colXOffset = spreadOutElements (widths, width ()); - #if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\t\tspread out offsets of cols:"; for (int c = 0; c < colXOffset.count (); c++) qCDebug(kpLogWidgets) << "\t\t\t" << c << ": " << colXOffset [c]; - #endif for (int c = 0; c < colXOffset.count (); c++) { @@ -408,12 +380,9 @@ // public bool kpToolWidgetBase::hasPreviousOption (int *row, int *col) const { -#if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "kpToolWidgetBase(" << objectName () << ")::hasPreviousOption() current row=" << m_selectedRow - << " col=" << m_selectedCol - << endl; -#endif + << " col=" << m_selectedCol; if (row) *row = -1; if (col) @@ -452,12 +421,9 @@ // public bool kpToolWidgetBase::hasNextOption (int *row, int *col) const { -#if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "kpToolWidgetBase(" << objectName () << ")::hasNextOption() current row=" << m_selectedRow - << " col=" << m_selectedCol - << endl; -#endif + << " col=" << m_selectedCol; if (row) *row = -1; @@ -498,28 +464,21 @@ // public slot virtual bool kpToolWidgetBase::setSelected (int row, int col, bool saveAsDefault) { -#if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "kpToolWidgetBase::setSelected(row=" << row << ",col=" << col << ",saveAsDefault=" << saveAsDefault - << ")" - << endl; -#endif + << ")"; if (row < 0 || col < 0 || row >= m_pixmapRects.count () || col >= m_pixmapRects [row].count ()) { - #if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\tout of range"; - #endif return false; } if (row == m_selectedRow && col == m_selectedCol) { - #if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\tNOP"; - #endif if (saveAsDefault) saveSelectedAsDefault (); @@ -542,9 +501,7 @@ // highlight new option update (m_pixmapRects [row][col]); -#if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\tOK"; -#endif if (saveAsDefault) saveSelectedAsDefault (); @@ -599,9 +556,7 @@ if (e->type () == QEvent::ToolTip) { QHelpEvent *he = dynamic_cast (e); - #if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "kpToolWidgetBase::event() QHelpEvent pos=" << he->pos (); - #endif bool showedText = false; for (int r = 0; r < m_pixmapRects.count (); r++) @@ -611,10 +566,8 @@ if (m_pixmapRects [r][c].contains (he->pos ())) { const QString tip = m_toolTips [r][c]; - #if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\tin option: r=" << r << "c=" << c << "tip='" << tip << "'" << endl; - #endif if (!tip.isEmpty ()) { QToolTip::showText (he->globalPos (), tip, this); @@ -630,9 +583,7 @@ exit_loops: if (!showedText) { - #if DEBUG_KP_TOOL_WIDGET_BASE qCDebug(kpLogWidgets) << "\thiding text"; - #endif QToolTip::hideText (); } @@ -673,43 +624,32 @@ // protected virtual [base QWidget] void kpToolWidgetBase::paintEvent (QPaintEvent *e) { -#if DEBUG_KP_TOOL_WIDGET_BASE && 1 qCDebug(kpLogWidgets) << "kpToolWidgetBase::paintEvent(): rect=" << contentsRect (); -#endif // Draw frame first. QFrame::paintEvent (e); QPainter painter (this); for (int i = 0; i < m_pixmaps.count (); i++) { - #if DEBUG_KP_TOOL_WIDGET_BASE && 1 qCDebug(kpLogWidgets) << "\tRow: " << i; - #endif for (int j = 0; j < m_pixmaps [i].count (); j++) { QRect rect = m_pixmapRects [i][j]; QPixmap pixmap = m_pixmaps [i][j]; - #if DEBUG_KP_TOOL_WIDGET_BASE && 1 qCDebug(kpLogWidgets) << "\t\tCol: " << j << " rect=" << rect; - #endif - if (i == m_selectedRow && j == m_selectedCol) { painter.fillRect(rect, palette().color(QPalette::Highlight).rgb()); } - #if DEBUG_KP_TOOL_WIDGET_BASE && 1 qCDebug(kpLogWidgets) << "\t\t\tdraw pixmap @ x=" << rect.x () + (rect.width () - pixmap.width ()) / 2 << " y=" - << rect.y () + (rect.height () - pixmap.height ()) / 2 - << endl; - - #endif + << rect.y () + (rect.height () - pixmap.height ()) / 2; painter.drawPixmap(QPoint(rect.x () + (rect.width () - pixmap.width ()) / 2, rect.y () + (rect.height () - pixmap.height ()) / 2), diff --git a/widgets/toolbars/options/kpToolWidgetBrush.cpp b/widgets/toolbars/options/kpToolWidgetBrush.cpp --- a/widgets/toolbars/options/kpToolWidgetBrush.cpp +++ b/widgets/toolbars/options/kpToolWidgetBrush.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_WIDGET_BRUSH 0 - - #include "widgets/toolbars/options/kpToolWidgetBrush.h" #include @@ -62,16 +58,11 @@ kpToolWidgetBrush::DrawPackage *pack = static_cast (userData); -#if DEBUG_KP_TOOL_WIDGET_BRUSH qCDebug(kpLogWidgets) << "kptoolwidgetbrush.cpp:Draw(destImage,topLeft=" << topLeft << " pack: row=" << pack->row << " col=" << pack->col - << " color=" << (int *) pack->color.toQRgb () - << endl; -#endif + << " color=" << (int *) pack->color.toQRgb (); const int size = ::BrushSizes [pack->row][pack->col]; -#if DEBUG_KP_TOOL_WIDGET_BRUSH qCDebug(kpLogWidgets) << "\tsize=" << size; -#endif QPainter painter(destImage); diff --git a/widgets/toolbars/options/kpToolWidgetEraserSize.cpp b/widgets/toolbars/options/kpToolWidgetEraserSize.cpp --- a/widgets/toolbars/options/kpToolWidgetEraserSize.cpp +++ b/widgets/toolbars/options/kpToolWidgetEraserSize.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_WIDGET_ERASER_SIZE 0 - - #include "kpToolWidgetEraserSize.h" #include "imagelib/kpColor.h" diff --git a/widgets/toolbars/options/kpToolWidgetFillStyle.cpp b/widgets/toolbars/options/kpToolWidgetFillStyle.cpp --- a/widgets/toolbars/options/kpToolWidgetFillStyle.cpp +++ b/widgets/toolbars/options/kpToolWidgetFillStyle.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_WIDGET_FILL_STYLE 0 - - #include "kpToolWidgetFillStyle.h" #include "imagelib/kpColor.h" @@ -135,11 +131,8 @@ // public kpToolWidgetFillStyle::FillStyle kpToolWidgetFillStyle::fillStyle () const { -#if DEBUG_KP_TOOL_WIDGET_FILL_STYLE qCDebug(kpLogWidgets) << "kpToolWidgetFillStyle::fillStyle() selected=" - << selectedRow () - << endl; -#endif + << selectedRow (); return static_cast (selectedRow ()); } diff --git a/widgets/toolbars/options/kpToolWidgetOpaqueOrTransparent.cpp b/widgets/toolbars/options/kpToolWidgetOpaqueOrTransparent.cpp --- a/widgets/toolbars/options/kpToolWidgetOpaqueOrTransparent.cpp +++ b/widgets/toolbars/options/kpToolWidgetOpaqueOrTransparent.cpp @@ -25,9 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define DEBUG_KP_TOOL_WIDGET_OPAQUE_OR_TRANSPARENT 0 - - #include "widgets/toolbars/options/kpToolWidgetOpaqueOrTransparent.h" #include "kpLogCategories.h" @@ -71,29 +68,23 @@ // public void kpToolWidgetOpaqueOrTransparent::setOpaque (bool yes) { -#if DEBUG_KP_TOOL_WIDGET_OPAQUE_OR_TRANSPARENT && 1 qCDebug(kpLogWidgets) << "kpToolWidgetOpaqueOrTransparent::setOpaque(" << yes << ")"; -#endif setSelected (yes ? 0 : 1, 0, false/*don't save*/); } // public void kpToolWidgetOpaqueOrTransparent::setTransparent (bool yes) { -#if DEBUG_KP_TOOL_WIDGET_OPAQUE_OR_TRANSPARENT && 1 qCDebug(kpLogWidgets) << "kpToolWidgetOpaqueOrTransparent::setTransparent(" << yes << ")"; -#endif setSelected (yes ? 1 : 0, 0, false/*don't save*/); } // protected slot virtual [base kpToolWidgetBase] bool kpToolWidgetOpaqueOrTransparent::setSelected (int row, int col, bool saveAsDefault) { -#if DEBUG_KP_TOOL_WIDGET_OPAQUE_OR_TRANSPARENT && 1 qCDebug(kpLogWidgets) << "kpToolWidgetOpaqueOrTransparent::setSelected(" - << row << "," << col << ")" << endl; -#endif + << row << "," << col << ")"; const bool ret = kpToolWidgetBase::setSelected (row, col, saveAsDefault); if (ret) emit isOpaqueChanged (isOpaque ()); diff --git a/widgets/toolbars/options/kpToolWidgetSpraycanSize.cpp b/widgets/toolbars/options/kpToolWidgetSpraycanSize.cpp --- a/widgets/toolbars/options/kpToolWidgetSpraycanSize.cpp +++ b/widgets/toolbars/options/kpToolWidgetSpraycanSize.cpp @@ -25,10 +25,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#define DEBUG_KP_TOOL_WIDGET_SPRAYCAN_SIZE 0 - - #include "kpToolWidgetSpraycanSize.h" #include "pixmapfx/kpPixmapFX.h" @@ -48,18 +44,14 @@ kpToolWidgetSpraycanSize::kpToolWidgetSpraycanSize (QWidget *parent, const QString &name) : kpToolWidgetBase (parent, name) { -#if DEBUG_KP_TOOL_WIDGET_SPRAYCAN_SIZE qCDebug(kpLogWidgets) << "kpToolWidgetSpraycanSize::kpToolWidgetSpraycanSize() CALLED!"; -#endif for (int i = 0; i < int (sizeof (spraycanSizes) / sizeof (spraycanSizes [0])); i++) { int s = spraycanSizes [i]; QString iconName = QString ("tool_spraycan_%1x%2").arg (s).arg(s); - #if DEBUG_KP_TOOL_WIDGET_SPRAYCAN_SIZE qCDebug(kpLogWidgets) << "\ticonName=" << iconName; - #endif QPixmap pixmap (s, s); pixmap.fill (Qt::white);