Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/converter/mymoneytemplate.cpp
Context not available. | |||||
297 | setFlags(acc, account.firstChild()); | 297 | setFlags(acc, account.firstChild()); | ||
---|---|---|---|---|---|
298 | try { | 298 | try { | ||
299 | MyMoneyFile::instance()->addAccount(acc, parent); | 299 | MyMoneyFile::instance()->addAccount(acc, parent); | ||
300 | } catch (const MyMoneyException &) { | 300 | } catch (const std::exception &) { | ||
301 | } | 301 | } | ||
302 | } | 302 | } | ||
303 | createAccounts(acc, account.firstChild()); | 303 | createAccounts(acc, account.firstChild()); | ||
Context not available. | |||||
465 | if (qfile.open(QIODevice::WriteOnly)) { | 465 | if (qfile.open(QIODevice::WriteOnly)) { | ||
466 | saveToLocalFile(&qfile); | 466 | saveToLocalFile(&qfile); | ||
467 | if (!qfile.commit()) { | 467 | if (!qfile.commit()) { | ||
468 | throw MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'", filename)); | 468 | throw MYMONEYEXCEPTION(QString::fromLatin1("Unable to write changes to '%1'").arg(filename)); | ||
469 | } | 469 | } | ||
470 | } else { | 470 | } else { | ||
471 | throw MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'", filename)); | 471 | throw MYMONEYEXCEPTION(QString::fromLatin1("Unable to write changes to '%1'").arg(filename)); | ||
472 | } | 472 | } | ||
473 | } else { | 473 | } else { | ||
474 | QTemporaryFile tmpfile; | 474 | QTemporaryFile tmpfile; | ||
Context not available. | |||||
477 | if (qfile.open(QIODevice::WriteOnly)) { | 477 | if (qfile.open(QIODevice::WriteOnly)) { | ||
478 | saveToLocalFile(&qfile); | 478 | saveToLocalFile(&qfile); | ||
479 | if (!qfile.commit()) { | 479 | if (!qfile.commit()) { | ||
480 | throw MYMONEYEXCEPTION(i18n("Unable to upload to '%1'", url.toDisplayString())); | 480 | throw MYMONEYEXCEPTION(QString::fromLatin1("Unable to upload to '%1'").arg(url.toDisplayString())); | ||
481 | } | 481 | } | ||
482 | } else { | 482 | } else { | ||
483 | throw MYMONEYEXCEPTION(i18n("Unable to upload to '%1'", url.toDisplayString())); | 483 | throw MYMONEYEXCEPTION(QString::fromLatin1("Unable to upload to '%1'").arg(url.toDisplayString())); | ||
484 | } | 484 | } | ||
485 | int permission = -1; | 485 | int permission = -1; | ||
486 | QFile file(tmpfile.fileName()); | 486 | QFile file(tmpfile.fileName()); | ||
487 | file.open(QIODevice::ReadOnly); | 487 | file.open(QIODevice::ReadOnly); | ||
488 | KIO::StoredTransferJob *putjob = KIO::storedPut(file.readAll(), url, permission, KIO::JobFlag::Overwrite); | 488 | KIO::StoredTransferJob *putjob = KIO::storedPut(file.readAll(), url, permission, KIO::JobFlag::Overwrite); | ||
489 | if (!putjob->exec()) { | 489 | if (!putjob->exec()) { | ||
490 | throw MYMONEYEXCEPTION(i18n("Unable to upload to '%1'.<br />%2", url.toDisplayString(), putjob->errorString())); | 490 | throw MYMONEYEXCEPTION(QString::fromLatin1("Unable to upload to '%1'.<br />%2").arg(url.toDisplayString(), putjob->errorString())); | ||
491 | } | 491 | } | ||
492 | file.close(); | 492 | file.close(); | ||
493 | } | 493 | } | ||
Context not available. |