Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix layer naming when dragging-and-dropping images to insert as new layer

Kisaragi Hiub0a12f9766e2
diff --git a/libs/ui/kis_import_catcher.cc b/libs/ui/kis_import_catcher.cc
index f199668bcb..2d52817acf 100644
--- a/libs/ui/kis_import_catcher.cc
+++ b/libs/ui/kis_import_catcher.cc
@@ -45,7 +45,11 @@ QString KisImportCatcher::Private::prettyLayerName(QString layerName) const
{
QString name = QFileInfo(path).fileName();
QString fileName = !name.isEmpty() ? name : path;
- return (layerName.isEmpty() || layerName == "Background") ? fileName : layerName;
+ // The "Background" name here being matched on is dependent on the current language and so needs to be passed
+ // through i18n.
+ return (layerName.isEmpty() || layerName == i18nc("Name for the bottom-most layer in the layerstack", "Background"))
+ ? fileName
+ : layerName;
}
void KisImportCatcher::Private::importAsPaintLayer(KisPaintDeviceSP device, QString layerName)