soc.2008.masterpassword: c004b046: Add a QCoreApplication to process events...
qulogic at pidgin.im
qulogic at pidgin.im
Sun Nov 20 04:36:04 EST 2011
----------------------------------------------------------------------
Revision: c004b0461d0ff27dbddf51d7a43033badb271920
Parent: ff3938ecddd48f838889d612e40f8b94e2843b1d
Author: qulogic at pidgin.im
Date: 11/20/11 04:21:36
Branch: im.pidgin.soc.2008.masterpassword
URL: http://d.pidgin.im/viewmtn/revision/info/c004b0461d0ff27dbddf51d7a43033badb271920
Changelog:
Add a QCoreApplication to process events, which is a bit lighter
than the KApplication that was there before (and doesn't require
the UI bits.) I don't think it will always be tied to the GLib
mainloop, but I assume that processing events in ExecuteRequests
will be enough (and it seems to work so far).
Changes against parent ff3938ecddd48f838889d612e40f8b94e2843b1d
patched libpurple/plugins/keyrings/kwallet.cpp
-------------- next part --------------
============================================================
--- libpurple/plugins/keyrings/kwallet.cpp 8ce517d5fbb123563ce5a8dd21fc8b2cc7ce0ebe
+++ libpurple/plugins/keyrings/kwallet.cpp 5bacbc8a02d80f8ecb939962b3c5dd01e1300a45
@@ -36,6 +36,7 @@
#include "version.h"
#include <QQueue>
+#include <QCoreApplication>
#include <kwallet.h>
#define KWALLET_NAME N_("KWallet")
@@ -76,11 +77,11 @@ class engine : private QObject, private
void walletOpened(bool opened);
private:
+ QCoreApplication *app;
bool connected;
KWallet::Wallet *wallet;
static engine *pinstance;
-/* KApplication *app; */
void ExecuteRequests();
};
@@ -118,9 +119,8 @@ KWalletPlugin::engine::engine()
KWalletPlugin::engine::engine()
{
-/* KAboutData aboutData("libpurple_plugin", N_("LibPurple KWallet Plugin"), "", "", KAboutData::License_GPL, "");
- KCmdLineArgs::init( &aboutData );
- app = new KApplication(false, false); */
+ int argc = 0;
+ app = new QCoreApplication(argc, NULL);
connected = FALSE;
wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), 0, KWallet::Wallet::Asynchronous);
@@ -137,6 +137,7 @@ KWalletPlugin::engine::~engine()
KWallet::Wallet::closeWallet(KWallet::Wallet::NetworkWallet(), TRUE);
delete wallet;
+ delete app;
pinstance = NULL;
}
@@ -175,6 +176,7 @@ KWalletPlugin::engine::ExecuteRequests()
void
KWalletPlugin::engine::ExecuteRequests()
{
+ app->processEvents();
if (connected) {
while (!isEmpty()) {
request *req = dequeue();
More information about the Commits
mailing list