2 Copyright (c) 2014-2015 Montel Laurent <montel@kde.org>
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #include "sieveserversettings.h"
25 class SieveServerSettingsPrivate
28 SieveServerSettingsPrivate()
29 : sieveServerSettings(new SieveServerSettings
)
33 ~SieveServerSettingsPrivate()
35 delete sieveServerSettings
;
38 SieveServerSettings
*sieveServerSettings
;
41 Q_GLOBAL_STATIC(SieveServerSettingsPrivate
, sInstance
)
43 SieveServerSettings::SieveServerSettings(QObject
*parent
)
49 SieveServerSettings::~SieveServerSettings()
54 SieveServerSettings
*SieveServerSettings::self()
56 return sInstance
->sieveServerSettings
; //will create it
59 KWallet::Wallet
*SieveServerSettings::wallet()
62 mWallet
= KWallet::Wallet::openWallet(KWallet::Wallet::LocalWallet(), 0);
64 connect(mWallet
, &KWallet::Wallet::walletClosed
, this, &SieveServerSettings::slotWalletClosed
);
70 void SieveServerSettings::closeWallet()
72 KWallet::Wallet::closeWallet(KWallet::Wallet::LocalWallet(), true);
75 void SieveServerSettings::slotWalletClosed()