[graphics/krita] libs/impex: Discount global selection masks in export warning

Carsten Hartenfels <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit fd2e3f54a613461079b0009e8fa5c94a515a0543 by Carsten Hartenfels.
Committed on 07/08/2026 at 21:08.
Pushed by hartenfels into branch 'master'.

Discount global selection masks in export warning

Since this is an ephemeral part of the image, so warning the user that
they are going to lose it is not sensible. The warning they receive also
doesn't make sense, since it talks about layers and rendered results,
which doesn't have an obvious connection to the selection unless you
know how Krita works internally.

M  +5    -2    libs/impex/NodeTypeCheck.h

https://invent.kde.org/graphics/krita/-/commit/fd2e3f54a613461079b0009e8fa5c94a515a0543

diff --git a/libs/impex/NodeTypeCheck.h b/libs/impex/NodeTypeCheck.h
index 46328b42302..b4c105b728d 100644
--- a/libs/impex/NodeTypeCheck.h
+++ b/libs/impex/NodeTypeCheck.h
@@ -33,8 +33,11 @@ public:
         KisCountVisitor v(nodetypes, props);
         image->rootLayer()->accept(v);
 
-        // There is always one group layer, the root layer.
-        if (m_nodeType == "KisGroupLayer") {
+        // There is always one group layer, the root layer. When checking
+        // selection masks, discount the global selection mask, since that's
+        // ephemeral and not worth warning about.
+        if (m_nodeType == QStringLiteral("KisGroupLayer")
+            || (m_nodeType == QStringLiteral("KisSelectionMask") && image->rootLayer()->selectionMask())) {
             return (v.count() > 1);
         }
         else {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.