soc.2008.masterpassword: 25ac71e7: Evidently, processing results just in Ex...

qulogic at pidgin.im qulogic at pidgin.im
Thu Dec 22 04:41:09 EST 2011


----------------------------------------------------------------------
Revision: 25ac71e7fe4fb520b7193ce0d80874cbec07d1f3
Parent:   6a6ff80eb9717e773b178bb27c1d2c021d526244
Author:   qulogic at pidgin.im
Date:     12/16/11 02:38:59
Branch:   im.pidgin.soc.2008.masterpassword
URL: http://d.pidgin.im/viewmtn/revision/info/25ac71e7fe4fb520b7193ce0d80874cbec07d1f3

Changelog: 

Evidently, processing results just in ExecuteRequests is not enough,
since the KWallet unlock dialog shows up when the second account is
activated, and not at the first point it's required. Add an idle
processor that will run the Qt loop periodically.

Changes against parent 6a6ff80eb9717e773b178bb27c1d2c021d526244

  patched  libpurple/plugins/keyrings/kwallet.cpp

-------------- next part --------------
============================================================
--- libpurple/plugins/keyrings/kwallet.cpp	03fe303b6707030b4d08e29ba1349ca0f430ddf3
+++ libpurple/plugins/keyrings/kwallet.cpp	591ec90b58dcfe4f1513435d11703916ae719fde
@@ -82,6 +82,8 @@ class engine : private QObject, private 
 		bool connected;
 		KWallet::Wallet *wallet;
 		static engine *pinstance;
+		gint idle_handle;
+		static bool idle_cb(engine *me);
 
 		void ExecuteRequests();
 };
@@ -132,6 +134,9 @@ KWalletPlugin::engine::~engine()
 {
 	closing = true;
 
+	if (idle_handle)
+		g_source_remove(idle_handle);
+
 	while (!isEmpty()) {
 		request *req = dequeue();
 		req->abort();
@@ -176,10 +181,19 @@ KWalletPlugin::engine::queue(request *re
 	ExecuteRequests();
 }
 
+bool
+KWalletPlugin::engine::idle_cb(KWalletPlugin::engine *me)
+{
+	me->app->processEvents();
+	return true;
+}
+
 void
 KWalletPlugin::engine::ExecuteRequests()
 {
-	app->processEvents();
+	if (idle_handle == 0)
+		idle_handle = g_idle_add((GSourceFunc)idle_cb, this);
+
 	if (connected) {
 		while (!isEmpty()) {
 			request *req = dequeue();


More information about the Commits mailing list