本文整理汇总了C++中Wallet::removeEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ Wallet::removeEntry方法的具体用法?C++ Wallet::removeEntry怎么用?C++ Wallet::removeEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wallet
的用法示例。
在下文中一共展示了Wallet::removeEntry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeConfig
void NetworkAccount::writeConfig(KConfig/*Base*/ & config) /*const*/
{
KMAccount::writeConfig(config);
config.writeEntry("login", login());
config.writeEntry("store-passwd", storePasswd());
if(storePasswd())
{
// write password to the wallet if possbile and necessary
bool passwdStored = false;
if(mPasswdDirty)
{
Wallet *wallet = kmkernel->wallet();
if(wallet && wallet->writePassword("account-" + QString::number(mId), passwd()) == 0)
{
passwdStored = true;
mPasswdDirty = false;
mStorePasswdInConfig = false;
}
}
else
{
passwdStored = !mStorePasswdInConfig; // already in the wallet
}
// if wallet is not available, write to config file, since the account
// manager deletes this group, we need to write it always
if(!passwdStored && (mStorePasswdInConfig || KMessageBox::warningYesNo(0,
i18n("KWallet is not available. It is strongly recommended to use "
"KWallet for managing your passwords.\n"
"However, KMail can store the password in its configuration "
"file instead. The password is stored in an obfuscated format, "
"but should not be considered secure from decryption efforts "
"if access to the configuration file is obtained.\n"
"Do you want to store the password for account '%1' in the "
"configuration file?").arg(name()),
i18n("KWallet Not Available"),
KGuiItem(i18n("Store Password")),
KGuiItem(i18n("Do Not Store Password")))
== KMessageBox::Yes))
{
config.writeEntry("pass", encryptStr(passwd()));
mStorePasswdInConfig = true;
}
}
// delete password from the wallet if password storage is disabled
if(!storePasswd() && !Wallet::keyDoesNotExist(
Wallet::NetworkWallet(), "kmail", "account-" + QString::number(mId)))
{
Wallet *wallet = kmkernel->wallet();
if(wallet)
wallet->removeEntry("account-" + QString::number(mId));
}
config.writeEntry("host", host());
config.writeEntry("port", static_cast<unsigned int>(port()));
config.writeEntry("auth", auth());
config.writeEntry("use-ssl", useSSL());
config.writeEntry("use-tls", useTLS());
mSieveConfig.writeConfig(config);
}