summaryrefslogtreecommitdiffstats
path: root/source/kde/kde/patch/konsole/eb44240235fa61e662e9a521f72e8be9213bb536.patch
blob: b34efb01f7993aa0004530e256e2d4894e020258 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From eb44240235fa61e662e9a521f72e8be9213bb536 Mon Sep 17 00:00:00 2001
From: Ahmad Samir <a.samirh78@gmail.com>
Date: Mon, 3 Jan 2022 14:19:22 +0200
Subject: [PATCH] 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
---
 src/profile/ProfileManager.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/profile/ProfileManager.cpp b/src/profile/ProfileManager.cpp
index b19847074..18bc1dda8 100644
--- a/src/profile/ProfileManager.cpp
+++ b/src/profile/ProfileManager.cpp
@@ -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;
         }
     }
-- 
GitLab