Commit 0922a95a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix Bug 426596 - Application: "akonadi_archivemail_agent" crashed after...

Fix Bug 426596 - Application: "akonadi_archivemail_agent" crashed after closing "Configure automatic archving..."-Dialog

BUG: 426596
BUG: 425786
BUG: 424232
parent 1d0b0023
Pipeline #34492 failed with stage
in 14 minutes and 54 seconds
......@@ -50,6 +50,12 @@ ArchiveMailKernel::ArchiveMailKernel(QObject *parent)
mJobScheduler = new MailCommon::JobScheduler(this);
}
ArchiveMailKernel *ArchiveMailKernel::self()
{
static ArchiveMailKernel s_self;
return &s_self;
}
KIdentityManagement::IdentityManager *ArchiveMailKernel::identityManager()
{
return mIdentityManager;
......
......@@ -38,6 +38,8 @@ class ArchiveMailKernel : public QObject, public MailCommon::IKernel, public Mai
public:
explicit ArchiveMailKernel(QObject *parent = nullptr);
static ArchiveMailKernel *self();
KIdentityManagement::IdentityManager *identityManager() override;
MessageComposer::MessageSender *msgSender() override;
......
......@@ -37,7 +37,7 @@
ArchiveMailManager::ArchiveMailManager(QObject *parent)
: QObject(parent)
{
mArchiveMailKernel = new ArchiveMailKernel(this);
mArchiveMailKernel = ArchiveMailKernel::self();
CommonKernel->registerKernelIf(mArchiveMailKernel); //register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(mArchiveMailKernel); //SettingsIf is used in FolderTreeWidget
mConfig = KSharedConfig::openConfig();
......
......@@ -69,9 +69,8 @@ ArchiveMailInfo *ArchiveMailItem::info() const
ArchiveMailWidget::ArchiveMailWidget(const KSharedConfigPtr &config, QWidget *parent, const QVariantList &args)
: Akonadi::AgentConfigurationBase(config, parent, args)
, mChanged(false)
{
ArchiveMailKernel *archiveMailKernel = new ArchiveMailKernel(this);
ArchiveMailKernel *archiveMailKernel = ArchiveMailKernel::self();
CommonKernel->registerKernelIf(archiveMailKernel); //register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(archiveMailKernel); //SettingsIf is used in FolderTreeWidget
......
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