View | Details | Raw Unified | Return to bug 132468
Collapse All | Expand All

(-)kmail/networkaccount.cpp (-2 / +4 lines)
Lines 156-163 Link Here
156
156
157
      if ( !encpasswd.isEmpty() ) {
157
      if ( !encpasswd.isEmpty() ) {
158
        setPasswd( decryptStr( encpasswd ), true );
158
        setPasswd( decryptStr( encpasswd ), true );
159
        mStorePasswdInConfig = config.readBoolEntry( "store-passwd-in-config", false );
159
        // migrate to KWallet if available
160
        // migrate to KWallet if available
160
        if ( Wallet::isEnabled() ) {
161
        if ( Wallet::isEnabled() && (!mStorePasswdInConfig)) {
161
          config.deleteEntry( "pass" );
162
          config.deleteEntry( "pass" );
162
          config.deleteEntry( "passwd" );
163
          config.deleteEntry( "passwd" );
163
          mPasswdDirty = true;
164
          mPasswdDirty = true;
Lines 198-204 Link Here
198
    if ( storePasswd() ) {
199
    if ( storePasswd() ) {
199
      // write password to the wallet if possbile and necessary
200
      // write password to the wallet if possbile and necessary
200
      bool passwdStored = false;
201
      bool passwdStored = false;
201
      if ( mPasswdDirty ) {
202
      if (( mPasswdDirty ) && ( !mStorePasswdInConfig )) {
202
        Wallet *wallet = kmkernel->wallet();
203
        Wallet *wallet = kmkernel->wallet();
203
        if ( wallet && wallet->writePassword( "account-" + QString::number(mId), passwd() ) == 0 ) {
204
        if ( wallet && wallet->writePassword( "account-" + QString::number(mId), passwd() ) == 0 ) {
204
          passwdStored = true;
205
          passwdStored = true;
Lines 225-230 Link Here
225
           == KMessageBox::Yes ) ) {
226
           == KMessageBox::Yes ) ) {
226
        config.writeEntry( "pass", encryptStr( passwd() ) );
227
        config.writeEntry( "pass", encryptStr( passwd() ) );
227
        mStorePasswdInConfig = true;
228
        mStorePasswdInConfig = true;
229
        config.writeEntry( "store-passwd-in-config", mStorePasswdInConfig );
228
      }
230
      }
229
    }
231
    }
230
232
(-)kmail/kmtransport.cpp (-2 / +4 lines)
Lines 80-85 Link Here
80
  authType = config->readEntry("authtype");
80
  authType = config->readEntry("authtype");
81
  auth = config->readBoolEntry("auth");
81
  auth = config->readBoolEntry("auth");
82
  mStorePasswd = config->readBoolEntry("storepass");
82
  mStorePasswd = config->readBoolEntry("storepass");
83
  mStorePasswdInConfig = config->readBoolEntry("storepassinconfig",false);
83
  specifyHostname = config->readBoolEntry("specifyHostname", false);
84
  specifyHostname = config->readBoolEntry("specifyHostname", false);
84
  localHostname = config->readEntry("localHostname");
85
  localHostname = config->readEntry("localHostname");
85
86
Lines 88-94 Link Here
88
89
89
  if ( !mPasswd.isEmpty() ) {
90
  if ( !mPasswd.isEmpty() ) {
90
    // migration to kwallet if available
91
    // migration to kwallet if available
91
    if ( Wallet::isEnabled() ) {
92
    if (( Wallet::isEnabled() )&&(!mStorePasswdInConfig)) {
92
      config->deleteEntry( "pass" );
93
      config->deleteEntry( "pass" );
93
      mPasswdDirty = true;
94
      mPasswdDirty = true;
94
      mStorePasswdInConfig = false;
95
      mStorePasswdInConfig = false;
Lines 126-132 Link Here
126
  if ( storePasswd() ) {
127
  if ( storePasswd() ) {
127
    // write password into the wallet if possible and necessary
128
    // write password into the wallet if possible and necessary
128
    bool passwdStored = false;
129
    bool passwdStored = false;
129
    if ( mPasswdDirty ) {
130
    if (( mPasswdDirty ) && ( !mStorePasswdInConfig )) {
130
      Wallet *wallet = kmkernel->wallet();
131
      Wallet *wallet = kmkernel->wallet();
131
      if ( wallet && wallet->writePassword( "transport-" + QString::number(mId), passwd() ) == 0 ) {
132
      if ( wallet && wallet->writePassword( "transport-" + QString::number(mId), passwd() ) == 0 ) {
132
        passwdStored = true;
133
        passwdStored = true;
Lines 152-157 Link Here
152
         == KMessageBox::Yes ) ) {
153
         == KMessageBox::Yes ) ) {
153
      config->writeEntry( "pass", KMAccount::encryptStr( passwd() ) );
154
      config->writeEntry( "pass", KMAccount::encryptStr( passwd() ) );
154
      mStorePasswdInConfig = true;
155
      mStorePasswdInConfig = true;
156
      config->writeEntry("storepassinconfig", mStorePasswdInConfig);
155
    }
157
    }
156
  }
158
  }
157
159

Return to bug 132468