[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdepimlibs/KDE/4.10] mailtransport: Load passwords async on startup, rather than sync
From:       David Faure <faure () kde ! org>
Date:       2012-12-28 9:57:58
Message-ID: 20121228095758.47D23A6091 () git ! kde ! org
[Download RAW message or body]

Git commit f40a4973e8c00875c351c8cc3d30bd481ef5c68b by David Faure.
Committed on 23/12/2012 at 16:13.
Pushed by dfaure into branch 'KDE/4.10'.

Load passwords async on startup, rather than sync

(which was giving 4 nested event loops, with 4 transports, on kmail startup)
This fixes the password dialog appearing when sending the first email.

BUG: 293271
FIXED-IN: 4.10

M  +0    -9    mailtransport/transport.cpp
M  +1    -0    mailtransport/transportmanager.cpp

http://commits.kde.org/kdepimlibs/f40a4973e8c00875c351c8cc3d30bd481ef5c68b

diff --git a/mailtransport/transport.cpp b/mailtransport/transport.cpp
index 45bd69d..17a511d 100644
--- a/mailtransport/transport.cpp
+++ b/mailtransport/transport.cpp
@@ -226,15 +226,6 @@ void Transport::usrReadConfig()
     } else {
       d->storePasswordInFile = true;
     }
-  } else {
-    // read password if wallet is open, defer otherwise
-    if ( Wallet::isOpen( Wallet::NetworkWallet() ) ) {
-      // Don't read the password right away because this can lead
-      // to reentrancy problems in KDBusServiceStarter when an application
-      // run in Kontact creates the transports (due to a QEventLoop in the
-      // synchronous KWallet openWallet call).
-      QTimer::singleShot( 0, this, SLOT(readPassword()) );
-    }
   }
 }
 
diff --git a/mailtransport/transportmanager.cpp b/mailtransport/transportmanager.cpp
index 9bac654..76749c1 100644
--- a/mailtransport/transportmanager.cpp
+++ b/mailtransport/transportmanager.cpp
@@ -488,6 +488,7 @@ void TransportManagerPrivate::readConfig()
   }
   validateDefault();
   migrateToWallet();
+  q->loadPasswordsAsync();
 }
 
 void TransportManagerPrivate::writeConfig()
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic