Commit 3033e8b5 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Don't set KMKernel::xmlGuiInstanceName() by default

This is a porting regression - KMKernel by default should have an
invalid xmlGuiInstance, which implies that KMail is not running as
a component. When xmlGuiInstance is set, like from KMail::Part, then
we know we are running inside Kontact or similar. Before this change
xmlGuiInstance was always set by the Kernel, so code that was using
this to check if it's running inside Kontact or not did not work.

Together with a porting typo fix, this fixes the ambiguous Ctrl+N
shortcut in KMail inside Kontact.

BUG: 362281
FIXED-IN: 5.6.1
parent c3bd6935
...@@ -157,7 +157,6 @@ KMKernel::KMKernel(QObject *parent) ...@@ -157,7 +157,6 @@ KMKernel::KMKernel(QObject *parent)
KMailSettings::self(); KMailSettings::self();
mJobScheduler = new JobScheduler(this); mJobScheduler = new JobScheduler(this);
mXmlGuiInstance = QStringLiteral("kmail2");
mAutoCorrection = new PimCommon::AutoCorrection(); mAutoCorrection = new PimCommon::AutoCorrection();
KMime::setUseOutlookAttachmentEncoding(MessageComposer::MessageComposerSettings::self()->outlookCompatibleAttachments()); KMime::setUseOutlookAttachmentEncoding(MessageComposer::MessageComposerSettings::self()->outlookCompatibleAttachments());
......
...@@ -3084,7 +3084,7 @@ void KMMainWidget::setupActions() ...@@ -3084,7 +3084,7 @@ void KMMainWidget::setupActions()
action->setIconText(i18nc("@action:intoolbar New Empty Message", "New")); action->setIconText(i18nc("@action:intoolbar New Empty Message", "New"));
connect(action, &QAction::triggered, this, &KMMainWidget::slotCompose); connect(action, &QAction::triggered, this, &KMMainWidget::slotCompose);
// do not set a New shortcut if kmail is a component // do not set a New shortcut if kmail is a component
if (!kmkernel->xmlGuiInstanceName().isEmpty()) { if (kmkernel->xmlGuiInstanceName().isEmpty()) {
actionCollection()->setDefaultShortcut(action, KStandardShortcut::openNew().first()); actionCollection()->setDefaultShortcut(action, KStandardShortcut::openNew().first());
} }
} }
......
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