soc.2008.masterpassword: 1e6c42a9: Use a QQueue instead of a STL list.
qulogic at pidgin.im
qulogic at pidgin.im
Sun Nov 20 04:35:48 EST 2011
----------------------------------------------------------------------
Revision: 1e6c42a903ec724cb6e184e06c8ce51fb977cc43
Parent: 76975938e503f0d6b8cdbf6da2867e768925ffac
Author: qulogic at pidgin.im
Date: 11/19/11 21:33:07
Branch: im.pidgin.soc.2008.masterpassword
URL: http://d.pidgin.im/viewmtn/revision/info/1e6c42a903ec724cb6e184e06c8ce51fb977cc43
Changelog:
Use a QQueue instead of a STL list.
Changes against parent 76975938e503f0d6b8cdbf6da2867e768925ffac
patched libpurple/plugins/keyrings/Makefile.am
patched libpurple/plugins/keyrings/kwallet.cpp
-------------- next part --------------
============================================================
--- libpurple/plugins/keyrings/Makefile.am ecabd4868ebbe5e03e27eb25d644bad8fa33cf73
+++ libpurple/plugins/keyrings/Makefile.am c9e4485e741e784c5e49e7a84806e3ab1a0a2e42
@@ -19,7 +19,7 @@ if ENABLE_KWALLET
if ENABLE_KWALLET
-kwallet_la_CXXFLAGS = $(KWALLET_CXXFLAGS)
+kwallet_la_CXXFLAGS = $(KWALLET_CXXFLAGS) $(QT4_CFLAGS)
kwallet_la_LDFLAGS = -module -avoid-version
kwallet_la_SOURCES = kwallet.cpp
kwallet_la_LIBADD = $(GLIB_LIBS) $(KWALLET_LIBS) $(QT4_LIBS)
============================================================
--- libpurple/plugins/keyrings/kwallet.cpp 681c4359e2ce83a824b3681d9db41c648792b560
+++ libpurple/plugins/keyrings/kwallet.cpp 3467b4559b8b86cc1c39026a4857c99ed7d4fb6b
@@ -35,6 +35,7 @@
#include "plugin.h"
#include "version.h"
+#include <QQueue>
#include <kwallet.h>
#define KWALLET_NAME N_("KWallet")
@@ -61,7 +62,7 @@ class request
QString password;
};
-class engine : QObject
+class engine : private QObject, private QQueue<request*>
{
public:
engine();
@@ -75,7 +76,6 @@ class engine : QObject
private:
bool connected;
KWallet::Wallet *wallet;
- std::list<request*> requests;
static engine *pinstance;
/* KApplication *app; */
@@ -125,10 +125,9 @@ KWalletPlugin::engine::~engine()
KWalletPlugin::engine::~engine()
{
- while (!requests.empty()) {
- request *req = requests.front();
+ while (!isEmpty()) {
+ request *req = dequeue();
req->abort();
- requests.pop_front();
delete req;
}
@@ -153,10 +152,9 @@ KWalletPlugin::engine::walletOpened(bool
if (opened) {
ExecuteRequests();
} else {
- while (!requests.empty()) {
- request *req = requests.front();
+ while (!isEmpty()) {
+ request *req = dequeue();
req->abort();
- requests.pop_front();
delete req;
}
delete this;
@@ -166,7 +164,7 @@ KWalletPlugin::engine::queue(request *re
void
KWalletPlugin::engine::queue(request *req)
{
- requests.push_back(req);
+ enqueue(req);
ExecuteRequests();
}
@@ -174,10 +172,9 @@ KWalletPlugin::engine::ExecuteRequests()
KWalletPlugin::engine::ExecuteRequests()
{
if (connected) {
- while (!requests.empty()) {
- request *req = requests.front();
+ while (!isEmpty()) {
+ request *req = dequeue();
req->execute(wallet);
- requests.pop_front();
delete req;
}
}
More information about the Commits
mailing list