Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-apps/konsole/, kde-apps/konsole/files/
Date: Thu, 28 May 2020 20:21:04
Message-Id: 1590697249.ce8934eff28bbe9ccbfd987735944c8f18f893ce.asturm@gentoo
1 commit: ce8934eff28bbe9ccbfd987735944c8f18f893ce
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 28 20:19:01 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Thu May 28 20:20:49 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce8934ef
7
8 kde-apps/konsole: Fix crash on 'Set Encoding' context menu w/ Qt 5.15
9
10 KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=419526
11 Package-Manager: Portage-2.3.100, Repoman-2.3.22
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 ...e-20.04.1-qt-5.15-set-text-encoding-crash.patch | 109 +++++++++++++++++++++
15 kde-apps/konsole/konsole-20.04.1-r1.ebuild | 5 +-
16 2 files changed, 113 insertions(+), 1 deletion(-)
17
18 diff --git a/kde-apps/konsole/files/konsole-20.04.1-qt-5.15-set-text-encoding-crash.patch b/kde-apps/konsole/files/konsole-20.04.1-qt-5.15-set-text-encoding-crash.patch
19 new file mode 100644
20 index 00000000000..78e5559d047
21 --- /dev/null
22 +++ b/kde-apps/konsole/files/konsole-20.04.1-qt-5.15-set-text-encoding-crash.patch
23 @@ -0,0 +1,109 @@
24 +From 72e76de072aa4c7960396856e72681a00c4f67d9 Mon Sep 17 00:00:00 2001
25 +From: Ahmad Samir <a.samirh78@×××××.com>
26 +Date: Thu, 28 May 2020 21:40:29 +0200
27 +Subject: [PATCH] [SessionController] Fix crash caused by text encoding menu
28 +
29 +QMenu since 5.15 is hidden when an action is triggered, this caused a
30 +crash in Konsole when trying to access the text encoding menu.
31 +
32 +Now Session emits a signal when the text encoding is changed, the
33 +SessionController can connect to that singal to set the current codec in
34 +the KCodecAction object.
35 +
36 +Also fix the EditProfileDialog so that when the KCodecAction menu is
37 +shown the currently set codec is selected.
38 +
39 +BUG: 419526
40 +
41 +FIXED-IN: 20.08
42 +---
43 + src/EditProfileDialog.cpp | 1 +
44 + src/Session.cpp | 2 ++
45 + src/Session.h | 5 +++++
46 + src/SessionController.cpp | 7 ++++---
47 + src/SessionController.h | 2 +-
48 + 5 files changed, 13 insertions(+), 4 deletions(-)
49 +
50 +diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp
51 +index a64136934..f93e9e166 100644
52 +--- a/src/EditProfileDialog.cpp
53 ++++ b/src/EditProfileDialog.cpp
54 +@@ -1725,6 +1725,7 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr &profile)
55 +
56 + // encoding options
57 + auto codecAction = new KCodecAction(this);
58 ++ codecAction->setCurrentCodec(profile->defaultEncoding());
59 + _advancedUi->selectEncodingButton->setMenu(codecAction->menu());
60 + connect(codecAction,
61 + QOverload<QTextCodec *>::of(&KCodecAction::triggered), this,
62 +diff --git a/src/Session.cpp b/src/Session.cpp
63 +index 1103f6e1b..483d8fd6a 100644
64 +--- a/src/Session.cpp
65 ++++ b/src/Session.cpp
66 +@@ -252,6 +252,8 @@ void Session::setCodec(QTextCodec* codec)
67 + }
68 +
69 + emulation()->setCodec(codec);
70 ++
71 ++ emit sessionCodecChanged(codec);
72 + }
73 +
74 + bool Session::setCodec(const QByteArray& name)
75 +diff --git a/src/Session.h b/src/Session.h
76 +index 1b7da1b3b..c1af3c05d 100644
77 +--- a/src/Session.h
78 ++++ b/src/Session.h
79 +@@ -661,6 +661,11 @@ Q_SIGNALS:
80 + */
81 + void currentDirectoryChanged(const QString &dir);
82 +
83 ++ /**
84 ++ * Emitted when the session text encoding changes.
85 ++ */
86 ++ void sessionCodecChanged(QTextCodec *codec);
87 ++
88 + /** Emitted when a bell event occurs in the session. */
89 + void bellRequest(const QString &message);
90 +
91 +diff --git a/src/SessionController.cpp b/src/SessionController.cpp
92 +index e72f342c4..f74969f85 100644
93 +--- a/src/SessionController.cpp
94 ++++ b/src/SessionController.cpp
95 +@@ -691,7 +691,8 @@ void SessionController::setupCommonActions()
96 + _codecAction = new KCodecAction(i18n("Set &Encoding"), this);
97 + _codecAction->setIcon(QIcon::fromTheme(QStringLiteral("character-set")));
98 + collection->addAction(QStringLiteral("set-encoding"), _codecAction);
99 +- connect(_codecAction->menu(), &QMenu::aboutToShow, this, &Konsole::SessionController::updateCodecAction);
100 ++ _codecAction->setCurrentCodec(QString::fromUtf8(_session->codec()));
101 ++ connect(_session.data(), &Konsole::Session::sessionCodecChanged, this, &Konsole::SessionController::updateCodecAction);
102 + connect(_codecAction,
103 + QOverload<QTextCodec*>::of(&KCodecAction::triggered), this,
104 + &Konsole::SessionController::changeCodec);
105 +@@ -846,9 +847,9 @@ void SessionController::prepareSwitchProfileMenu()
106 + _switchProfileMenu->menu()->clear();
107 + _switchProfileMenu->menu()->addActions(_profileList->actions());
108 + }
109 +-void SessionController::updateCodecAction()
110 ++void SessionController::updateCodecAction(QTextCodec *codec)
111 + {
112 +- _codecAction->setCurrentCodec(QString::fromUtf8(_session->codec()));
113 ++ _codecAction->setCurrentCodec(codec);
114 + }
115 +
116 + void SessionController::changeCodec(QTextCodec* codec)
117 +diff --git a/src/SessionController.h b/src/SessionController.h
118 +index 057a31446..5062833b7 100644
119 +--- a/src/SessionController.h
120 ++++ b/src/SessionController.h
121 +@@ -260,7 +260,7 @@ private Q_SLOTS:
122 + // other
123 + void setupSearchBar();
124 + void prepareSwitchProfileMenu();
125 +- void updateCodecAction();
126 ++ void updateCodecAction(QTextCodec *codec);
127 + void showDisplayContextMenu(const QPoint &position);
128 + void movementKeyFromSearchBarReceived(QKeyEvent *event);
129 + void sessionNotificationsChanged(Session::Notification notification, bool enabled);
130 +--
131 +2.26.2
132 +
133
134 diff --git a/kde-apps/konsole/konsole-20.04.1-r1.ebuild b/kde-apps/konsole/konsole-20.04.1-r1.ebuild
135 index f6870330550..a60f18304f2 100644
136 --- a/kde-apps/konsole/konsole-20.04.1-r1.ebuild
137 +++ b/kde-apps/konsole/konsole-20.04.1-r1.ebuild
138 @@ -53,7 +53,10 @@ DEPEND="
139 "
140 RDEPEND="${DEPEND}"
141
142 -PATCHES=( "${FILESDIR}/${P}-crash-on-close.patch" ) # bug 723214
143 +PATCHES=(
144 + "${FILESDIR}/${P}-crash-on-close.patch" # bug 723214, in 20.04.2
145 + "${FILESDIR}/${P}-qt-5.15-set-text-encoding-crash.patch" # KDE-Bug 419526; pending
146 +)
147
148 src_configure() {
149 local mycmakeargs=(