Commit eb442402 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

BUG: 447872
FIXED_IN: 21.12.0
parent 3a4a940d
Pipeline #117680 passed with stage
in 1 minute and 51 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