Messagelib

messagecomposersettings.cpp
1/*
2 This file is part of KMail.
3
4 SPDX-FileCopyrightText: 2005 David Faure <faure@kde.org>
5
6 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
7*/
8
9#include "messagecomposersettings.h"
10#include <QTimer>
11
12using namespace MessageComposer;
13
14MessageComposerSettings *MessageComposerSettings::mSelf = nullptr;
15
16MessageComposerSettings *MessageComposerSettings::self()
17{
18 if (!mSelf) {
19 mSelf = new MessageComposerSettings();
20 mSelf->load();
21 }
22
23 return mSelf;
24}
25
26MessageComposerSettings::MessageComposerSettings()
27{
28 mConfigSyncTimer = new QTimer(this);
29 mConfigSyncTimer->setSingleShot(true);
30 connect(mConfigSyncTimer, &QTimer::timeout, this, &MessageComposerSettings::slotSyncNow);
31}
32
34{
35 if (!mConfigSyncTimer->isActive()) {
36 mConfigSyncTimer->start(0);
37 }
38}
39
40void MessageComposerSettings::slotSyncNow()
41{
42 config()->sync();
43}
44
45MessageComposerSettings::~MessageComposerSettings() = default;
46
47#include "moc_messagecomposersettings.cpp"
void requestSync()
Call this slot instead of directly KConfig::sync() to minimize the overall config writes.
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
bool isActive() const const
void setSingleShot(bool singleShot)
void start(int msec)
void timeout()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:37:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.