SVN commit 510459 by cgilles:
digikam from trunk : bug fix : handle undo manager with a named action if DImgInterface::putImageSelection() is called (for example with red eyes correction tool) CCMAIL: [hidden email] M +1 -1 imageplugins/imageeffect_redeye.cpp M +7 -7 utilities/imageeditor/canvas/dimginterface.cpp M +23 -20 utilities/imageeditor/canvas/dimginterface.h M +2 -2 utilities/imageeditor/editor/imageiface.cpp M +2 -2 utilities/imageeditor/editor/imageiface.h --- trunk/extragear/graphics/digikam/imageplugins/imageeffect_redeye.cpp #510458:510459 @@ -221,7 +221,7 @@ selection.bitBlend_RGBA2RGB(newSelection, 0, 0, w, h); - iface.putImageSelection(selection.bits()); + iface.putImageSelection(i18n("Red Eyes Correction"), selection.bits()); parent->setCursor( KCursor::arrowCursor() ); } --- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/dimginterface.cpp #510458:510459 @@ -4,7 +4,8 @@ * Date : 2003-01-15 * Description : * - * Copyright 2003-2006 by Renchi Raju, Gilles Caulier + * Copyright 2004-2005 by Renchi Raju, Gilles Caulier + * Copyright 2006 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -82,9 +83,9 @@ selH = 0; zoom = 1.0; - exifOrient = false; - valid = false; - rotatedOrFlipped = false; + exifOrient = false; + valid = false; + rotatedOrFlipped = false; } bool valid; @@ -919,13 +920,12 @@ return 0; } -void DImgInterface::putImageSelection(uchar* data, bool saveUndo) +void DImgInterface::putImageSelection(const QString &caller, uchar* data) { if (!data || d->image.isNull()) return; - if (saveUndo) - d->undoMan->addAction(new UndoActionIrreversible(this)); + d->undoMan->addAction(new UndoActionIrreversible(this, caller)); d->image.bitBltImage(data, 0, 0, d->selW, d->selH, d->selX, d->selY, d->selW, d->selH, d->image.bytesDepth()); --- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/dimginterface.h #510458:510459 @@ -4,7 +4,8 @@ * Date : 2003-01-15 * Description : * - * Copyright 2003-2006 by Renchi Raju, Gilles Caulier + * Copyright 2004-2005 by Renchi Raju, Gilles Caulier + * Copyright 2006 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General @@ -58,13 +59,15 @@ void load(const QString& filename, ICCSettingsContainer *cmSettings, IOFileSettingsContainer* iofileSettings); + void setExifOrient(bool exifOrient); void undo(); void redo(); void restore(); - //void save(const QString& file, IOFileSettingsContainer *iofileSettings); + void saveAs(const QString& file, IOFileSettingsContainer *iofileSettings, const QString& mimeType=0); + void switchToLastSaved(const QString& newFilename); void setModified(); void clearUndoManager(); @@ -122,23 +125,15 @@ uchar* getImage(); void putImage(uchar* data, int w, int h); + void putImage(uchar* data, int w, int h, bool sixteenBit); void putImage(const QString &caller, uchar* data, int w, int h); - - void putImage(uchar* data, int w, int h, bool sixteenBit); void putImage(const QString &caller, uchar* data, int w, int h, bool sixteenBit); uchar* getImageSelection(); - void putImageSelection(uchar* data, bool saveUndo=true); + void putImageSelection(const QString &caller, uchar* data); QByteArray getEmbeddedICC(); - // FIXME : remove these methods when all image plugins will be ported to DImg. - uint* getData(); - void putData(uint* data, int w, int h); - void putData(const QString &caller, uint* data, int w, int h); - uint* getSelectedData(); - void putSelectedData(uint* data, bool saveUndo=true); - protected slots: void slotImageLoaded(const QString&, const DImg& img); @@ -148,18 +143,16 @@ signals: - void signalModified(); - void signalUndoStateChanged(bool moreUndo, bool moreRedo, bool canSave); + void signalModified(); + void signalUndoStateChanged(bool moreUndo, bool moreRedo, bool canSave); - void signalLoadingProgress(const QString& filePath, float progress); - void signalImageLoaded(const QString& filePath, bool success); - void signalSavingProgress(const QString& filePath, float progress); - void signalImageSaved(const QString& filePath, bool success); + void signalLoadingProgress(const QString& filePath, float progress); + void signalImageLoaded(const QString& filePath, bool success); + void signalSavingProgress(const QString& filePath, float progress); + void signalImageSaved(const QString& filePath, bool success); private: - //void saveAction(const QString& fileName, IOFileSettingsContainer *iofileSettings, - // const QString& mimeType); void exifRotate(const QString& filename); DImgInterface(); @@ -170,6 +163,16 @@ DImgInterfacePrivate *d; +// ----------------------------------------------------------------------------- +// FIXME : remove these methods when all image plugins will be ported to DImg. + +public: + uint* getData(); + void putData(uint* data, int w, int h); + void putData(const QString &caller, uint* data, int w, int h); + uint* getSelectedData(); + void putSelectedData(uint* data, bool saveUndo=true); + }; } // namespace Digikam --- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imageiface.cpp #510458:510459 @@ -227,12 +227,12 @@ DImgInterface::instance()->putImage(caller, data, w, h); } -void ImageIface::putImageSelection(uchar* data) +void ImageIface::putImageSelection(const QString &caller, uchar* data) { if (!data) return; - DImgInterface::instance()->putImageSelection(data); + DImgInterface::instance()->putImageSelection(caller, data); } int ImageIface::previewWidth() --- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imageiface.h #510458:510459 @@ -57,12 +57,12 @@ ~ImageIface(); uchar* getPreviewImage(); + uchar* getImageSelection(); uchar* getOriginalImage(); - uchar* getImageSelection(); void putOriginalImage(const QString &caller, uchar* data, int w=-1, int h=-1); + void putImageSelection(const QString &caller, uchar* data); void putPreviewImage(uchar* data); - void putImageSelection(uchar* data); /** Color point information method.*/ _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |