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

Commit a0996797 authored by Tusooa Zhu's avatar Tusooa Zhu 🔼

Fix assistant decorations not updated after switching snapshots

parent 3c7443df
......@@ -28,6 +28,7 @@
#include <kguiitem.h>
#include <ktoggleaction.h>
#include <kactioncollection.h>
#include <KisDocument.h>
KisDecorationsManager::KisDecorationsManager(KisViewManager* view)
......@@ -82,6 +83,7 @@ void KisDecorationsManager::setView(QPointer<KisView> imageView)
connect(m_toggleAssistant, SIGNAL(triggered()), assistantsDecoration(), SLOT(toggleAssistantVisible()));
connect(m_togglePreview, SIGNAL(triggered()), assistantsDecoration(), SLOT(toggleOutlineVisible()));
connect(assistantsDecoration(), SIGNAL(assistantChanged()), SLOT(updateAction()));
connect(m_imageView->document(), SIGNAL(sigAssistantsChanged), m_imageView->canvasBase(), SLOT(updateCanvas()));
}
if (m_imageView && referenceImagesDecoration()) {
......
......@@ -393,7 +393,7 @@ void KisDocument::Private::copyFrom(const Private &rhs, KisDocument *q)
firstMod = rhs.firstMod;
lastMod = rhs.lastMod;
// XXX: the display properties will be shared between different snapshots
assistants = KisPaintingAssistant::cloneAssistantList(rhs.assistants);
q->setAssistants(KisPaintingAssistant::cloneAssistantList(rhs.assistants));
globalAssistantsColor = rhs.globalAssistantsColor;
QList<KoColorSet *> newPaletteList;
......@@ -1986,7 +1986,10 @@ QList<KisPaintingAssistantSP> KisDocument::assistants() const
void KisDocument::setAssistants(const QList<KisPaintingAssistantSP> &value)
{
d->assistants = value;
if (d->assistants != value) {
d->assistants = value;
emit sigAssistantsChanged();
}
}
KisSharedPtr<KisReferenceImagesLayer> KisDocument::referenceImagesLayer() const
......
......@@ -473,6 +473,8 @@ Q_SIGNALS:
**/
void sigPaletteListChanged(const QList<KoColorSet *> &oldPaletteList, const QList<KoColorSet *> &newPaletteList);
void sigAssistantsChanged();
private Q_SLOTS:
void finishExportInBackground();
void slotChildCompletedSavingInBackground(KisImportExportErrorCode status, const QString &errorMessage);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment