Bug 353880

Summary: KActionMenu(const QIcon &icon, const QString &text, QObject *parent) failed to i18nc
Product: [Frameworks and Libraries] frameworks-ki18n Reporter: Leslie Zhai <zhaixiang>
Component: generalAssignee: Chusslove Illich <caslav.ilic>
Status: RESOLVED FIXED    
Severity: normal CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Leslie Zhai 2015-10-14 03:45:09 UTC
KActionMenu(const QIcon &icon, const QString &text, QObject *parent) failed to i18nc for Konsole https://twitter.com/xiangzhai/status/654138729271918592 when clicked the File menu on the top of Konsole, the New Tab failed to i18nc.

KActionMenu https://projects.kde.org/projects/frameworks/kwidgetsaddons/repository/revisions/master/entry/src/kactionmenu.cpp#L66 looks ok! is Qt5 bug?

KF5 Version: 5.15.0
Qt5 Version: 5.5.0

workaround patch for Konsole, but ... it is the huge work to change each KActionMenu:

diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index cbfec0c..b9936d5 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -291,6 +291,7 @@ void MainWindow::setupActions()
 
     // File Menu
     _newTabMenuAction = new KActionMenu(QIcon::fromTheme(QStringLiteral("tab-new")), i18nc("@action:inmenu", "&New Tab"), collection);
+    _newTabMenuAction->setText(i18nc("@action:inmenu", "&New Tab"));
     collection->setDefaultShortcut(_newTabMenuAction, Qt::CTRL + Qt::SHIFT + Qt::Key_T);
     collection->setShortcutsConfigurable(_newTabMenuAction, true);
     _newTabMenuAction->setAutoRepeat(false);

Reproducible: Always
Comment 1 Christoph Feck 2015-10-19 21:40:20 UTC
Odd workaround, because the constructor in kactionmenu.cpp also calls "setText()" with the given string.
Comment 2 Leslie Zhai 2016-08-10 02:50:42 UTC
kf5.24.0 fixed