Commit 10c30600 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Use tighter matching when finding the default profile file name

The code was checking if the path ended with a specific file name, which
meant that if you have two profiles "Root Shell.profile" and
"Shell.profile", the matching is messed up because the former ends with
the latter. Instead since we're using the path, add a '/', this way we're
matching the whole file name which is the last component in the path after
the last '/'.

Thanks to the bug reporter for git bisect'ing the repo to find the culprit
commit.

BUG: 447872
FIXED_IN: 21.12.0
parent a1f993a1
Pipeline #117678 passed with stage
in 1 minute and 56 seconds
......@@ -206,7 +206,7 @@ void ProfileManager::loadAllProfiles(const QString &defaultProfileFileName)
const QStringList &paths = availableProfilePaths();
for (const QString &path : paths) {
Profile::Ptr profile = loadProfile(path);
if (profile && !defaultProfileFileName.isEmpty() && path.endsWith(defaultProfileFileName)) {
if (profile && !defaultProfileFileName.isEmpty() && path.endsWith(QLatin1Char('/') + defaultProfileFileName)) {
_defaultProfile = profile;
}
}
......
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