diff --git a/src/base/path.cpp b/src/base/path.cpp index 8f72c97ba..248fafb45 100644 --- a/src/base/path.cpp +++ b/src/base/path.cpp @@ -155,7 +155,9 @@ QString Path::extension() const bool Path::hasExtension(const QString &ext) const { - return (extension().compare(ext, Qt::CaseInsensitive) == 0); + Q_ASSERT(ext.startsWith(QLatin1Char('.'))); + + return m_pathStr.endsWith(ext, Qt::CaseInsensitive); } bool Path::hasAncestor(const Path &other) const diff --git a/src/gui/uithememanager.cpp b/src/gui/uithememanager.cpp index 295c92d97..4f033b63f 100644 --- a/src/gui/uithememanager.cpp +++ b/src/gui/uithememanager.cpp @@ -141,7 +141,7 @@ namespace if (themePath.filename() == CONFIG_FILE_NAME) return std::make_unique(themePath); - if ((themePath.extension() == QLatin1String(".qbtheme")) + if ((themePath.hasExtension(QLatin1String(".qbtheme"))) && QResource::registerResource(themePath.data(), QLatin1String("/uitheme"))) { return std::make_unique();