Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a7c3bda7 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Use QFileInfo::completeBaseName() instead of baseName()

This fixes some infinite loops and other issues when file names have
multiple dots in their file name.

Patch by ahmadsamir

BUG: 343071
Differential Revision: https://phabricator.kde.org/D10439
parent e5472079
......@@ -124,7 +124,7 @@ QString BookmarkHandler::titleForView(ViewProperties *view) const
QString path = url.path();
path = KShell::tildeExpand(path);
path = QFileInfo(path).baseName();
path = QFileInfo(path).completeBaseName();
return path;
} else if (!url.host().isEmpty()) {
......
......@@ -93,7 +93,7 @@ bool ColorSchemeManager::loadColorScheme(const QString &filePath)
KConfig config(filePath, KConfig::NoGlobals);
auto scheme = new ColorScheme();
scheme->setName(info.baseName());
scheme->setName(info.completeBaseName());
scheme->read(config);
if (scheme->name().isEmpty()) {
......@@ -103,7 +103,7 @@ bool ColorSchemeManager::loadColorScheme(const QString &filePath)
return false;
}
if (!_colorSchemes.contains(info.baseName())) {
if (!_colorSchemes.contains(info.completeBaseName())) {
_colorSchemes.insert(scheme->name(), scheme);
} else {
//qDebug() << "color scheme with name" << scheme->name() << "has already been" <<
......
......@@ -100,7 +100,7 @@ void KeyboardTranslatorManager::findTranslators()
// the name with a null pointer to indicate that the translator
// has not yet been loaded from disk
foreach (const QString &translatorPath, list) {
QString name = QFileInfo(translatorPath).baseName();
QString name = QFileInfo(translatorPath).completeBaseName();
if (!_translators.contains(name)) {
_translators.insert(name, nullptr);
......
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