Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/converter/mymoneystatementreader.cpp
Context not available. | |||||
258 | break; | 258 | break; | ||
---|---|---|---|---|---|
259 | } | 259 | } | ||
260 | } | 260 | } | ||
261 | } catch (const MyMoneyException &) { | 261 | } catch (const std::exception &) { | ||
262 | } | 262 | } | ||
263 | 263 | | |||
264 | } | 264 | } | ||
Context not available. | |||||
439 | if (!s.m_accountId.isEmpty()) { | 439 | if (!s.m_accountId.isEmpty()) { | ||
440 | try { | 440 | try { | ||
441 | d->m_account = MyMoneyFile::instance()->account(s.m_accountId); | 441 | d->m_account = MyMoneyFile::instance()->account(s.m_accountId); | ||
442 | } catch (const MyMoneyException &) { | 442 | } catch (const std::exception &) { | ||
443 | qDebug("Received reference '%s' to unknown account in statement", qPrintable(s.m_accountId)); | 443 | qDebug("Received reference '%s' to unknown account in statement", qPrintable(s.m_accountId)); | ||
444 | } | 444 | } | ||
445 | } | 445 | } | ||
Context not available. | |||||
487 | 487 | | |||
488 | try { | 488 | try { | ||
489 | MyMoneyFile::instance()->modifyAccount(d->m_account); | 489 | MyMoneyFile::instance()->modifyAccount(d->m_account); | ||
490 | } catch (const MyMoneyException &) { | 490 | } catch (const std::exception &) { | ||
491 | qDebug("Updating account in MyMoneyStatementReader::startImport failed"); | 491 | qDebug("Updating account in MyMoneyStatementReader::startImport failed"); | ||
492 | } | 492 | } | ||
493 | } | 493 | } | ||
Context not available. | |||||
530 | } | 530 | } | ||
531 | qDebug("Processing transactions done (%s)", qPrintable(d->m_account.name())); | 531 | qDebug("Processing transactions done (%s)", qPrintable(d->m_account.name())); | ||
532 | 532 | | |||
533 | } catch (const MyMoneyException &e) { | 533 | } catch (const std::exception &e) { | ||
534 | if (e.what() == "USERABORT") | 534 | if (QString::fromLatin1(e.what()).contains("USERABORT")) | ||
535 | m_userAbort = true; | 535 | m_userAbort = true; | ||
536 | else | 536 | else | ||
537 | qDebug("Caught exception from processTransactionEntry() not caused by USERABORT: %s", qPrintable(e.what())); | 537 | qDebug("Caught exception from processTransactionEntry() not caused by USERABORT: %s", qPrintable(e.what())); | ||
Context not available. | |||||
546 | try { | 546 | try { | ||
547 | signalProgress(0, s.m_listPrices.count(), "Importing Statement ..."); | 547 | signalProgress(0, s.m_listPrices.count(), "Importing Statement ..."); | ||
548 | KMyMoneyUtils::processPriceList(s); | 548 | KMyMoneyUtils::processPriceList(s); | ||
549 | } catch (const MyMoneyException &e) { | 549 | } catch (const std::exception &e) { | ||
550 | if (e.what() == "USERABORT") | 550 | if (QString::fromLatin1(e.what()).contains("USERABORT")) | ||
551 | m_userAbort = true; | 551 | m_userAbort = true; | ||
552 | else | 552 | else | ||
553 | qDebug("Caught exception from processPriceEntry() not caused by USERABORT: %s", qPrintable(e.what())); | 553 | qDebug("Caught exception from processPriceEntry() not caused by USERABORT: %s", qPrintable(e.what())); | ||
Context not available. | |||||
564 | try { | 564 | try { | ||
565 | MyMoneyFile::instance()->removePayee(*it_p); | 565 | MyMoneyFile::instance()->removePayee(*it_p); | ||
566 | --payeeCount; | 566 | --payeeCount; | ||
567 | } catch (const MyMoneyException &) { | 567 | } catch (const std::exception &) { | ||
568 | // if we can't delete it, it must be in use which is ok for us | 568 | // if we can't delete it, it must be in use which is ok for us | ||
569 | } | 569 | } | ||
570 | } | 570 | } | ||
Context not available. | |||||
642 | file->addSecurity(security); | 642 | file->addSecurity(security); | ||
643 | ft.commit(); | 643 | ft.commit(); | ||
644 | qDebug() << "Created " << security.name() << " with id " << security.id(); | 644 | qDebug() << "Created " << security.name() << " with id " << security.id(); | ||
645 | } catch (const MyMoneyException &e) { | 645 | } catch (const std::exception &e) { | ||
646 | KMessageBox::error(0, i18n("Error creating security record: %1", e.what()), i18n("Error")); | 646 | KMessageBox::error(0, i18n("Error creating security record: %1", e.what()), i18n("Error")); | ||
647 | } | 647 | } | ||
648 | } else { | 648 | } else { | ||
Context not available. | |||||
998 | 998 | | |||
999 | // if we did not find a matching payee, we throw an exception and try to create it | 999 | // if we did not find a matching payee, we throw an exception and try to create it | ||
1000 | if (payeeid.isEmpty()) | 1000 | if (payeeid.isEmpty()) | ||
1001 | throw MYMONEYEXCEPTION("payee not matched"); | 1001 | throw MYMONEYEXCEPTION_CSTRING("payee not matched"); | ||
1002 | 1002 | | |||
1003 | s1.setPayeeId(payeeid); | 1003 | s1.setPayeeId(payeeid); | ||
1004 | } catch (const MyMoneyException &) { | 1004 | } catch (const std::exception &) { | ||
1005 | MyMoneyPayee payee; | 1005 | MyMoneyPayee payee; | ||
1006 | int rc = KMessageBox::Yes; | 1006 | int rc = KMessageBox::Yes; | ||
1007 | 1007 | | |||
Context not available. | |||||
1085 | payee.setDefaultAccountId(accountId); | 1085 | payee.setDefaultAccountId(accountId); | ||
1086 | } else if (result != QDialog::Rejected) { | 1086 | } else if (result != QDialog::Rejected) { | ||
1087 | //add cancel button? and throw exception like below | 1087 | //add cancel button? and throw exception like below | ||
1088 | throw MYMONEYEXCEPTION("USERABORT"); | 1088 | throw MYMONEYEXCEPTION_CSTRING("USERABORT"); | ||
1089 | } | 1089 | } | ||
1090 | } | 1090 | } | ||
1091 | 1091 | | |||
Context not available. | |||||
1096 | payeeid = payee.id(); | 1096 | payeeid = payee.id(); | ||
1097 | s1.setPayeeId(payeeid); | 1097 | s1.setPayeeId(payeeid); | ||
1098 | 1098 | | |||
1099 | } catch (const MyMoneyException &e) { | 1099 | } catch (const std::exception &e) { | ||
1100 | KMessageBox::detailedSorry(0, i18n("Unable to add payee/receiver"), | 1100 | KMessageBox::detailedSorry(nullptr, i18n("Unable to add payee/receiver"), e.what()); | ||
1101 | i18n("%1 thrown in %2:%3", e.what(), e.file(), e.line())); | | |||
1102 | 1101 | | |||
1103 | } | 1102 | } | ||
1104 | 1103 | | |||
Context not available. | |||||
1106 | s1.setPayeeId(QString()); | 1105 | s1.setPayeeId(QString()); | ||
1107 | 1106 | | |||
1108 | } else { | 1107 | } else { | ||
1109 | throw MYMONEYEXCEPTION("USERABORT"); | 1108 | throw MYMONEYEXCEPTION_CSTRING("USERABORT"); | ||
1110 | 1109 | | |||
1111 | } | 1110 | } | ||
1112 | } | 1111 | } | ||
Context not available. | |||||
1294 | return; | 1293 | return; | ||
1295 | } | 1294 | } | ||
1296 | 1295 | | |||
1297 | } catch (const MyMoneyException &e) { | 1296 | } catch (const std::exception &e) { | ||
1298 | QString message(i18n("Problem adding or matching imported transaction with id '%1': %2", statementTransactionUnderImport.m_strBankID, e.what())); | 1297 | QString message(i18n("Problem adding or matching imported transaction with id '%1': %2", statementTransactionUnderImport.m_strBankID, e.what())); | ||
1299 | qDebug("%s", qPrintable(message)); | 1298 | qDebug("%s", qPrintable(message)); | ||
1300 | 1299 | | |||
1301 | int result = KMessageBox::warningContinueCancel(0, message); | 1300 | int result = KMessageBox::warningContinueCancel(0, message); | ||
1302 | if (result == KMessageBox::Cancel) | 1301 | if (result == KMessageBox::Cancel) | ||
1303 | throw MYMONEYEXCEPTION("USERABORT"); | 1302 | throw MYMONEYEXCEPTION_CSTRING("USERABORT"); | ||
1304 | } | 1303 | } | ||
1305 | } | 1304 | } | ||
1306 | 1305 | | |||
Context not available. | |||||
1406 | MyMoneyFile::instance()->modifyAccount(account); | 1405 | MyMoneyFile::instance()->modifyAccount(account); | ||
1407 | ft.commit(); | 1406 | ft.commit(); | ||
1408 | accname = account.name(); | 1407 | accname = account.name(); | ||
1409 | } catch (const MyMoneyException &) { | 1408 | } catch (const std::exception &) { | ||
1410 | qDebug("Updating account in MyMoneyStatementReader::selectOrCreateAccount failed"); | 1409 | qDebug("Updating account in MyMoneyStatementReader::selectOrCreateAccount failed"); | ||
1411 | } | 1410 | } | ||
1412 | } | 1411 | } | ||
1413 | } else { | 1412 | } else { | ||
1414 | if (accountSelect->aborted()) | 1413 | if (accountSelect->aborted()) | ||
1415 | //throw MYMONEYEXCEPTION("USERABORT"); | 1414 | //throw MYMONEYEXCEPTION_CSTRING("USERABORT"); | ||
1416 | done = true; | 1415 | done = true; | ||
1417 | else | 1416 | else | ||
1418 | KMessageBox::error(0, QLatin1String("<html>") + i18n("You must select an account, create a new one, or press the <b>Abort</b> button.") + QLatin1String("</html>")); | 1417 | KMessageBox::error(0, QLatin1String("<html>") + i18n("You must select an account, create a new one, or press the <b>Abort</b> button.") + QLatin1String("</html>")); | ||
Context not available. | |||||
1519 | matcher.match(torig, matchedSplit, importedTransaction, importedSplit); | 1518 | matcher.match(torig, matchedSplit, importedTransaction, importedSplit); | ||
1520 | d->transactionsMatched++; | 1519 | d->transactionsMatched++; | ||
1521 | 1520 | | |||
1522 | } catch (const MyMoneyException &e) { | 1521 | } catch (const std::exception &e) { | ||
1523 | // make sure we get rid of the editor before | 1522 | // make sure we get rid of the editor before | ||
1524 | // the KEnterScheduleDlg is destroyed | 1523 | // the KEnterScheduleDlg is destroyed | ||
1525 | delete editor; | 1524 | delete editor; | ||
Context not available. |