MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / decryptText

Method decryptText

gui/nwebview.cpp:299–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297
298
299void NWebView::decryptText(QString id, QString text, QString hint) {
300 /* Suppress unused */
301 Q_UNUSED(id);
302 Q_UNUSED(text);
303 Q_UNUSED(hint);
304
305
306// EnCrypt crypt;
307// QString plainText;
308/*
309// // First, try to decrypt with any keys we already have
310 for (int i=0; i<global.passwordRemember.size(); i++) {
311 QString key = global.passwordRemember[i].second;
312 bool retVal = crypt.decrypt(text, plainText, key);
313 if (retVal && plainText != "") {
314 //slot = new String(Long.toString(l));
315 //Global.passwordSafe.put(slot, Global.passwordRemember.get(i));
316 //removeEncryption(id, plainText, false, slot);
317 return;
318 }
319 }
320
321
322 EnDecryptDialog dialog;
323 dialog.hint.setText(hint);
324 bool goodReturn = true;
325 while (goodReturn && (plainText == "" || !dialog.okPressed)) {
326 dialog.exec();
327 if (!dialog.okPressed) {
328 return;
329 }
330 QString pswd = dialog.password.text().trimmed();
331 crypt.decrypt(text, plainText, pswd);
332 if (plainText == "") {
333 QMessageBox mb;
334 mb.warning(this, tr("Incorrect Password"), tr("The password entered is not correct"));
335 }
336 }
337// Pair<String,String> passwordPair = new Pair<String,String>();
338// passwordPair.setFirst(dialog.getPassword());
339// passwordPair.setSecond(dialog.getHint());
340// Global.passwordSafe.put(slot, passwordPair);
341// removeEncryption(id, plainText, dialog.permanentlyDecrypt(), slot);
342// if (dialog.rememberPassword()) {
343// Pair<String, String> pair = new Pair<String,String>();
344// pair.setFirst(dialog.getPassword());
345// pair.setSecond(dialog.getHint());
346// Global.passwordRemember.add(pair);
347// }
348*/
349}
350
351
352

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected