File indexing completed on 2025-01-05 04:53:58
0001 /* 0002 This file is part of KMail. 0003 0004 SPDX-FileCopyrightText: 2005 David Faure <faure@kde.org> 0005 0006 SPDX-License-Identifier: GPL-2.0-only 0007 */ 0008 0009 #pragma once 0010 0011 #include "globalsettings_kmail.h" 0012 0013 class QTimer; 0014 0015 class KMailSettings : public GlobalSettingsBase 0016 { 0017 Q_OBJECT 0018 public: 0019 static KMailSettings *self(); 0020 0021 /** Call this slot instead of directly KConfig::sync() to 0022 minimize the overall config writes. Calling this slot will 0023 schedule a sync of the application config file using a timer, so 0024 that many consecutive calls can be condensed into a single 0025 sync, which is more efficient. */ 0026 void requestSync(); 0027 0028 private Q_SLOTS: 0029 void slotSyncNow(); 0030 0031 private: 0032 KMailSettings(); 0033 ~KMailSettings() override; 0034 static KMailSettings *mSelf; 0035 0036 QTimer *const mConfigSyncTimer; 0037 };