Summary: | KNode is not a nice KWallet user | ||
---|---|---|---|
Product: | [Unmaintained] knode | Reporter: | Malte S. Stretz <mss> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 0.7.6 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Malte S. Stretz
2004-02-01 03:00:58 UTC
Subject: kdepim/knode CVS commit by vkrause: Save server password only if it has actually changed. This prevents unnecessary wallet openings when closing knode (see second part of #73937). CCMAIL: 73937@bugs.kde.org M +15 -4 knserverinfo.cpp 1.21 M +3 -2 knserverinfo.h 1.14 --- kdepim/knode/knserverinfo.cpp #1.20:1.21 @@ -28,5 +28,5 @@ using namespace KWallet; KNServerInfo::KNServerInfo() : t_ype(STnntp), i_d(-1), p_ort(119), h_old(300), - t_imeout(60), n_eedsLogon(false) + t_imeout(60), n_eedsLogon(false), p_assDirty(false) { } @@ -62,4 +62,5 @@ void KNServerInfo::readConf(KConfig *con u_ser=conf->readEntry("user"); p_ass = KNHelper::decryptStr(conf->readEntry("pass")); + if(Wallet::isEnabled()) conf->deleteEntry("pass"); //first time run, don't store it in the config file @@ -111,6 +112,6 @@ void KNServerInfo::saveConf(KConfig *con conf->writeEntry("needsLogon", n_eedsLogon); conf->writeEntry("user", u_ser); - //open wallet for storing only if the user actually does have the password - if (n_eedsLogon) { + // open wallet for storing only if the user actually changed the password + if (n_eedsLogon && p_assDirty) { Wallet* wallet = openWallet(); if (!wallet || wallet->writePassword(QString::number(i_d), p_ass)) { @@ -120,4 +121,5 @@ void KNServerInfo::saveConf(KConfig *con conf->writeEntry("pass", KNHelper::encryptStr(p_ass)); } + p_assDirty = false; } } @@ -137,2 +139,11 @@ bool KNServerInfo::operator==(const KNSe (p_ass==s.p_ass) ); } + + +void KNServerInfo::setPass(const QString &s) +{ + if (p_ass != s) { + p_ass = s; + p_assDirty = true; + } +} --- kdepim/knode/knserverinfo.h #1.13:1.14 @@ -53,5 +53,5 @@ class KNServerInfo { void setServer(const QString &s) { s_erver=s; } void setUser(const QString &s) { u_ser=s; } - void setPass(const QString &s) { p_ass=s; } + void setPass(const QString &s); void setPort(int p) { p_ort=p; } void setHold(int h) { h_old=h; } @@ -74,5 +74,6 @@ class KNServerInfo { t_imeout; - bool n_eedsLogon; + bool n_eedsLogon, + p_assDirty; }; Could this please be backported to the BRANCH? CVS commit by vkrause: Improved KWallet handling: - Keep one static wallet instead of one wallet per account (fixes a memory leak). - Load passwords on-demand or if the wallet is already open. CCMAIL: 73937-done@bugs.kde.org M +11 -1 knaccountmanager.cpp 1.38 M +6 -1 knaccountmanager.h 1.19 M +8 -4 knnetaccess.cpp 1.35 M +68 -36 knserverinfo.cpp 1.22 M +12 -3 knserverinfo.h 1.15 |