Commit 3e9957a6 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Fix D&D of group layers on windows

BUG:294195
parent 2f7cc77d
......@@ -36,15 +36,13 @@
#include <QDomElement>
#include <QTemporaryFile>
KisMimeData::KisMimeData() :
QMimeData()
KisMimeData::KisMimeData(KisNodeSP node)
: QMimeData()
, m_node(node)
{
Q_ASSERT(m_node);
}
void KisMimeData::setNode(KisNodeSP node)
{
m_node = node;
}
KisNodeSP KisMimeData::node() const
{
......@@ -63,9 +61,10 @@ QStringList KisMimeData::formats () const
QVariant KisMimeData::retrieveData(const QString &mimetype, QVariant::Type preferredType) const
{
Q_ASSERT(m_node);
if (mimetype == "application/x-qt-image") {
KisConfig cfg;
return m_node->paintDevice()->convertToQImage(cfg.displayProfile());
return m_node->projection()->convertToQImage(cfg.displayProfile());
}
else if (mimetype == "application/x-krita-node"
|| mimetype == "application/zip") {
......
......@@ -33,12 +33,7 @@ class KRITAUI_EXPORT KisMimeData : public QMimeData
{
Q_OBJECT
public:
KisMimeData();
/**
* Set the node this KisMimeData instance contains. There can be only one node.
*/
void setNode(KisNodeSP node);
KisMimeData(KisNodeSP node);
/// return the node set on this mimedata object -- for internal use
KisNodeSP node() const;
......
......@@ -426,8 +426,8 @@ QMimeData * KisNodeModel::mimeData(const QModelIndexList &indexes) const
Q_ASSERT(indexes.count() == 1); // we only allow one node at a time to be stored as mimedata
KisNodeSP node = nodeFromIndex(indexes.first());
KisMimeData* data = new KisMimeData();
data->setNode(node);
KisMimeData* data = new KisMimeData(node);
return data;
}
......
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