diff --git a/dialogs/imagelib/kpDocumentMetaInfoDialog.cpp b/dialogs/imagelib/kpDocumentMetaInfoDialog.cpp --- a/dialogs/imagelib/kpDocumentMetaInfoDialog.cpp +++ b/dialogs/imagelib/kpDocumentMetaInfoDialog.cpp @@ -688,23 +688,6 @@ fieldsAppendEmptyRow (); } } -// Deletes a row if it is emptied of text. -#if 0 - // At any normal row? - else - { // Emptied all the text? - if (key.isEmpty () && value.isEmpty ()) - { - // This crashes when the user tabs away after the text is deleted. - // We could use a single shot but that's asking for trouble depending - // on what happens between us and the single shot. - // - // In any case, disabling this makes us more consistent with - // "Add Row" which allows us to add empty rows. - //fieldsDeleteRow (r); - } - } -#endif } //--------------------------------------------------------------------- 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 @@ -333,12 +333,6 @@ scaleDimension (m_oldHeight, keepsAspectScale, 1, m_previewPixmapLabel->height ())); - #if 0 - m_shrunkenDocumentPixmap = kpPixmapFX::scale ( - m_actOnSelection ? doc->getSelectedPixmap () : *doc->pixmap (), - m_previewPixmapLabel->width (), - m_previewPixmapLabel->height ()); - #endif m_previewPixmapLabelSizeWhenUpdatedPixmap = m_previewPixmapLabel->size (); } diff --git a/imagelib/effects/kpEffectBalance.cpp b/imagelib/effects/kpEffectBalance.cpp --- a/imagelib/effects/kpEffectBalance.cpp +++ b/imagelib/effects/kpEffectBalance.cpp @@ -171,13 +171,6 @@ transformGreen [green], transformBlue [blue], alpha)); - - #if 0 - qimage.setPixel (x, y, - brightnessContrastGammaForRGB (qimage.pixel (x, y), - channels, - brightness, contrast, gamma)); - #endif } } } @@ -197,13 +190,6 @@ transformGreen [green], transformBlue [blue], alpha)); - - #if 0 - qimage.setColor (i, - brightnessContrastGammaForRGB (qimage.color (i), - channels, - brightness, contrast, gamma)); - #endif } } diff --git a/imagelib/effects/kpEffectBlurSharpen.cpp b/imagelib/effects/kpEffectBlurSharpen.cpp --- a/imagelib/effects/kpEffectBlurSharpen.cpp +++ b/imagelib/effects/kpEffectBlurSharpen.cpp @@ -123,25 +123,6 @@ (RepeatMax - RepeatMin) / (kpEffectBlurSharpen::MaxStrength - 1)); -// I guess these values are more proper as they use an auto-calculated -// radius but they cause sharpen() to be too slow. -#if 0 - const double radius = 0/*auto-calculate*/; - - const double SigmaMin = 0.6; - const double SigmaMax = 1.0; - const double sigma = SigmaMin + - (strength - 1) * - (SigmaMax - SigmaMin) / - (kpEffectBlurSharpen::MaxStrength - 1); - - const double RepeatMin = 1; - const double RepeatMax = 3; - const double repeat = qRound (RepeatMin + - (strength - 1) * - (RepeatMax - RepeatMin) / - (kpEffectBlurSharpen::MaxStrength - 1)); -#endif #if DEBUG_KP_EFFECT_BLUR_SHARPEN qCDebug(kpLogImagelib) << "kpEffectBlurSharpen.cpp:SharpenQImage(strength=" << strength << ")" diff --git a/imagelib/effects/kpEffectEmboss.cpp b/imagelib/effects/kpEffectEmboss.cpp --- a/imagelib/effects/kpEffectEmboss.cpp +++ b/imagelib/effects/kpEffectEmboss.cpp @@ -51,15 +51,6 @@ const double radius = 0; -#if 0 - const double SigmaMin = 1; - const double SigmaMax = 1.2; - - return SigmaMin + - (kpEffectEmboss::MaxStrength - strength) * - (SigmaMax - SigmaMin) / - (kpEffectEmboss::MaxStrength - 1); -#endif const double sigma = 1; const int repeat = 1; diff --git a/imagelib/effects/kpEffectInvert.cpp b/imagelib/effects/kpEffectInvert.cpp --- a/imagelib/effects/kpEffectInvert.cpp +++ b/imagelib/effects/kpEffectInvert.cpp @@ -54,10 +54,6 @@ if (destImagePtr->depth () > 8) { - #if 0 - // SYNC: TODO: Qt BUG - invertAlpha argument is inverted!!! - destImagePtr->invertPixels (true/*no invert alpha (Qt 3.2)*/); - #else // Above version works for Qt 3.2 at least. // But this version will always work (slower, though) and supports // inverting particular channels. @@ -68,7 +64,6 @@ destImagePtr->setPixel (x, y, destImagePtr->pixel (x, y) ^ mask); } } - #endif } else { diff --git a/imagelib/kpPainter.cpp b/imagelib/kpPainter.cpp --- a/imagelib/kpPainter.cpp +++ b/imagelib/kpPainter.cpp @@ -83,11 +83,6 @@ #define SHOULD_DRAW() (probabilityTimes1000 == 1000/*avoid ::RandomNumberFrom0to999() call*/ || \ ::RandomNumberFrom0to999 () < probabilityTimes1000) -#if 0 - qCDebug(kpLogImagelib) << "prob=" << probability - << " *1000=" << probabilityTimes1000; -#endif - // Derived from the zSprite2 Graphics Engine. // "MODIFIED" comment shows deviation from zSprite2 and Bresenham's line diff --git a/imagelib/transforms/kpTransformCrop_ImageSelection.cpp b/imagelib/transforms/kpTransformCrop_ImageSelection.cpp --- a/imagelib/transforms/kpTransformCrop_ImageSelection.cpp +++ b/imagelib/transforms/kpTransformCrop_ImageSelection.cpp @@ -169,12 +169,6 @@ #endif } -#if 0 - kpPixmapFX::paintMaskTransparentWithBrush (&newDocImage, - QPoint (0, 0), - m_fromSelectionPtr->shapeBitmap ()); -#endif - kpPixmapFX::paintPixmapAt (&newDocImage, QPoint (0, 0), setTransparentImage); diff --git a/mainWindow/kpMainWindow.cpp b/mainWindow/kpMainWindow.cpp --- a/mainWindow/kpMainWindow.cpp +++ b/mainWindow/kpMainWindow.cpp @@ -399,56 +399,6 @@ #endif configGroup.writeEntry (kpSessionSettingNotFromUrlDocumentSize, docSize); } - - - // Local session save i.e. queryClose() was not called beforehand - // (see QApplication::saveState())? - #if 0 - if (d->document->isModified ()) - { - // TODO: Implement by saving the current image to a persistent file. - // We do this instead of saving/mutating the backing image file - // as no one expects a file save on a session save without a - // "do you want to save" dialog first. - // - // I don't think any KDE application implements local session saving. - // - // --- The below code does not compile but shows you want to do --- - - // Create unique name for the document in this main window. - const QUrl tempURL = homeDir + - "kolourpaint session " + sessionID + - mainWindowPtrToString + ".png"; - // TODO: Use lossless PNG saving options. - kpDocumentSaveOptions pngSaveOptions; - - if (kpDocument::savePixmapToFile (d->document->pixmapWithSelection (), - tempURL, - pngSaveOptions, *d->document->metaInfo (), - false/*no overwrite prompt*/, - false/*no lossy prompt*/, - this)) - { - // readProperties() will still open kpSessionSettingDocumentUrl - // (as that's the expected URL) and will then add commands to: - // - // 1. Resize the document to the size of image at - // kpSessionSettingDocumentUnsavedContentsUrl, if the sizes - // differ. - // 2. Paste the kpSessionSettingDocumentUnsavedContentsUrl image - // (setting the main window's selection mode to opaque beforehand). - // - // It will then delete the file at - // kpSessionSettingDocumentUnsavedContentsUrl. - configGroup.writeEntry (kpSessionSettingDocumentUnsavedContentsUrl, - tempURL.url ()); - } - else - { - // Not much we can do - we aren't allowed to throw up a dialog. - } - } - #endif } } @@ -768,30 +718,6 @@ enableToolsDocumentActions (true); enableDocumentActions (true); - - // TODO: The thumbnail auto zoom doesn't work because it thinks its - // width == 1 when !this->isShown(). So for consistency, - // never create the thumbnail. - #if 0 - if (d->configThumbnailShown) - { - if (isShown ()) - { - #if DEBUG_KP_MAIN_WINDOW - qCDebug(kpLogMainWindow) << "\tcreating thumbnail immediately"; - #endif - slotCreateThumbnail (); - } - // this' geometry is weird ATM - else - { - #if DEBUG_KP_MAIN_WINDOW - qCDebug(kpLogMainWindow) << "\tcreating thumbnail LATER"; - #endif - QTimer::singleShot (0, this, SLOT (slotCreateThumbnail())); - } - } - #endif } #if DEBUG_KP_MAIN_WINDOW diff --git a/mainWindow/kpMainWindow_View_Zoom.cpp b/mainWindow/kpMainWindow_View_Zoom.cpp --- a/mainWindow/kpMainWindow_View_Zoom.cpp +++ b/mainWindow/kpMainWindow_View_Zoom.cpp @@ -184,24 +184,6 @@ zoomLevel = qBound (kpView::MinZoomLevel, zoomLevel, kpView::MaxZoomLevel); -// mute point since the thumbnail suffers from this too -#if 0 - else if (d->mainView && d->mainView->zoomLevelX () % 100 == 0 && zoomLevel % 100) - { - if (KMessageBox::warningContinueCancel (this, - i18n ("Setting the zoom level to a value that is not a multiple of 100% " - "results in imprecise editing and redraw glitches.\n" - "Do you really want to set to zoom level to %1%?", - zoomLevel), - QString()/*caption*/, - i18n ("Set Zoom Level to %1%", zoomLevel), - "DoNotAskAgain_ZoomLevelNotMultipleOf100") != KMessageBox::Continue) - { - zoomLevel = d->mainView->zoomLevelX (); - } - } -#endif - int index = 0; QList ::Iterator it = d->zoomList.begin (); diff --git a/pixmapfx/kpPixmapFX_Transforms.cpp b/pixmapfx/kpPixmapFX_Transforms.cpp --- a/pixmapfx/kpPixmapFX_Transforms.cpp +++ b/pixmapfx/kpPixmapFX_Transforms.cpp @@ -150,18 +150,6 @@ qCDebug(kpLogPixmapfx) << "(w-1,h-1) ->" << matrix.map (QPoint (w - 1, h - 1)); } -#if 0 - QMatrix trueMatrix = QPixmap::trueMatrix (matrix, w, h); - qCDebug(kpLogPixmapfx) << matrixName << "trueMatrix=" << trueMatrix; - if (w > 0 && h > 0) - { - qCDebug(kpLogPixmapfx) << "(0,0) ->" << trueMatrix.map (QPoint (0, 0)); - qCDebug(kpLogPixmapfx) << "(w-1,0) ->" << trueMatrix.map (QPoint (w - 1, 0)); - qCDebug(kpLogPixmapfx) << "(0,h-1) ->" << trueMatrix.map (QPoint (0, h - 1)); - qCDebug(kpLogPixmapfx) << "(w-1,h-1) ->" << trueMatrix.map (QPoint (w - 1, h - 1)); - } -#endif - #else Q_UNUSED (matrixName); 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 @@ -160,15 +160,6 @@ } restoreQueueUpdates (); restoreFastUpdates (); - -#if 0 // TODO port to Qt5? - if (d->viewUnderCursor) { - QInputContext *inputContext = d->viewUnderCursor->inputContext (); - if (inputContext) { - inputContext->update (); - } - } -#endif } 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 @@ -49,27 +49,6 @@ lay->setMargin (0); -#if 0 - QLabel *amountLabel = new QLabel (i18n ("&Amount:"), this); - m_amountInput = new kpIntNumInput (this); - m_amountInput->setRange (kpEffectEmboss::MinStrength, - kpEffectEmboss::MaxStrength, 1/*step*/, true/*slider*/); - m_amountInput->setSpecialValueText (i18n ("None")); - - - amountLabel->setBuddy (m_amountInput); - - - lay->addWidget (amountLabel, 0, 0); - lay->addWidget (m_amountInput, 0, 1); - - lay->setColumnStretch (1, 1); - - - connect (m_amountInput, &kpIntNumInput::valueChanged, - this, &kpEffectEmbossWidget::settingsChanged); -#endif - m_enableCheckBox = new QCheckBox (i18n ("E&nable"), this);