libpurple/plugins/keyrings/kwallet.cpp

branch
soc.2008.masterpassword
changeset 34127
51c1bce7f52f
parent 34126
a479dca0f05b
child 34129
52b91b4b8314
equal deleted inserted replaced
34126:a479dca0f05b 34127:51c1bce7f52f
197 } 197 }
198 198
199 KWalletPlugin::engine::~engine() 199 KWalletPlugin::engine::~engine()
200 { 200 {
201 closing = true; 201 closing = true;
202 int abortedCount = 0;
202 203
203 while (!isEmpty()) { 204 while (!isEmpty()) {
204 request *req = dequeue(); 205 request *req = dequeue();
205 req->abort(); 206 req->abort();
206 delete req; 207 delete req;
208 abortedCount++;
209 }
210
211 if (abortedCount > 0) {
212 purple_debug_info("keyring-kwallet", "aborted requests: %d\n",
213 abortedCount);
207 } 214 }
208 215
209 delete wallet; 216 delete wallet;
210 217
211 if (pinstance == this) 218 if (pinstance == this)
240 KWalletPlugin::engine::walletOpened(bool opened) 247 KWalletPlugin::engine::walletOpened(bool opened)
241 { 248 {
242 connected = opened; 249 connected = opened;
243 250
244 if (!opened) { 251 if (!opened) {
245 while (!isEmpty()) { 252 purple_debug_warning("keyring-kwallet",
246 request *req = dequeue(); 253 "failed to open a wallet\n");
247 req->abort();
248 delete req;
249 }
250 delete this; 254 delete this;
251 return; 255 return;
252 } 256 }
253 257
254 if (!wallet->hasFolder(KWALLET_FOLDER_NAME)) { 258 if (!wallet->hasFolder(KWALLET_FOLDER_NAME)) {
376 if (result != 0) { 380 if (result != 0) {
377 purple_debug_warning("keyring-kwallet", 381 purple_debug_warning("keyring-kwallet",
378 "failed to read password, result was %d\n", result); 382 "failed to read password, result was %d\n", result);
379 abort(); 383 abort();
380 } 384 }
381 else if (callback != NULL) 385 else if (callback != NULL) {
386 purple_debug_misc("keyring-kwallet",
387 "Got password for account %s (%s).\n",
388 purple_account_get_username(account),
389 purple_account_get_protocol_id(account));
382 callback(account, password.toUtf8().constData(), NULL, data); 390 callback(account, password.toUtf8().constData(), NULL, data);
391 }
383 } 392 }
384 393
385 void 394 void
386 KWalletPlugin::save_request::execute(KWallet::Wallet *wallet) 395 KWalletPlugin::save_request::execute(KWallet::Wallet *wallet)
387 { 396 {
398 407
399 if (result != 0) { 408 if (result != 0) {
400 purple_debug_warning("keyring-kwallet", 409 purple_debug_warning("keyring-kwallet",
401 "failed to write password, result was %d\n", result); 410 "failed to write password, result was %d\n", result);
402 abort(); 411 abort();
403 } else if (callback != NULL) 412 } else if (callback != NULL) {
413 purple_debug_misc("keyring-kwallet",
414 "Password %s for account %s (%s).\n",
415 (noPassword ? "removed" : "saved"),
416 purple_account_get_username(account),
417 purple_account_get_protocol_id(account));
404 callback(account, NULL, data); 418 callback(account, NULL, data);
419 }
405 } 420 }
406 421
407 extern "C" 422 extern "C"
408 { 423 {
409 424

mercurial