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++

Use QFileInfo::baseName() instead of manual path parsing

Dmitry Kazakov17470387bcfb
diff --git a/libs/pigment/resources/KoColorSet.cpp b/libs/pigment/resources/KoColorSet.cpp
index bf0f90ab5d..b36aec5e5b 100644
--- a/libs/pigment/resources/KoColorSet.cpp
+++ b/libs/pigment/resources/KoColorSet.cpp
@@ -1402,7 +1402,7 @@ bool KoColorSet::Private::loadGpl()
index += 1;
}
else {
- colorSet->setName(colorSet->filename().split("/").last().split(".")[0]);
+ colorSet->setName(QFileInfo(colorSet->filename()).baseName());
}
// If the palette isn't version 1, load and set the column count if it's defined