Added controlled conversions to char* instead of automatic ascii conversions.

The definition of -UTQT_NO_ASCII_CAST is no longer needed.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/2/head
Slávek Banko 2 years ago
parent eeae53f59d
commit 5e6c401557
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -66,7 +66,7 @@ include( ConfigureChecks.cmake )
###### global compiler settings ###### global compiler settings
add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST -UTQT_NO_STL ) add_definitions( -DHAVE_CONFIG_H -UTQT_NO_STL )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )

@ -168,7 +168,7 @@ bool GncObject::isDataElement (const TQString &elName, const TQXmlAttributes& el
TQString GncObject::var (int i) const { TQString GncObject::var (int i) const {
return (pMain->m_decoder == 0 return (pMain->m_decoder == 0
? *(m_v.at(i)) ? *(m_v.at(i))
: pMain->m_decoder->toUnicode (*(m_v.at(i)))); : pMain->m_decoder->toUnicode((m_v.at(i))->utf8()));
} }
void GncObject::adjustHideFactor () { void GncObject::adjustHideFactor () {

@ -194,7 +194,7 @@ bool WebPriceQuote::launchNative( const TQString& _symbol, const TQString& _id,
void WebPriceQuote::removeTempFile(const TQString& tmpFile) void WebPriceQuote::removeTempFile(const TQString& tmpFile)
{ {
if(tmpFile == m_tmpFile) { if(tmpFile == m_tmpFile) {
unlink(tmpFile); unlink(tmpFile.local8Bit());
m_tmpFile = TQString(); m_tmpFile = TQString();
} }
} }
@ -835,7 +835,7 @@ void FinanceQuoteProcess::slotProcessExited(TDEProcess*)
void FinanceQuoteProcess::launch (const TQString& scriptPath) { void FinanceQuoteProcess::launch (const TQString& scriptPath) {
clearArguments(); clearArguments();
arguments.append(TQCString("perl")); arguments.append(TQCString("perl"));
arguments.append (TQCString(scriptPath)); arguments.append (scriptPath.local8Bit());
arguments.append (TQCString("-l")); arguments.append (TQCString("-l"));
if (!start(TDEProcess::NotifyOnExit, TDEProcess::Stdout)) tqFatal ("Unable to start FQ script"); if (!start(TDEProcess::NotifyOnExit, TDEProcess::Stdout)) tqFatal ("Unable to start FQ script");
return; return;

@ -353,7 +353,7 @@ int InvestTransactionEditor::editSplits(const TQString& categoryWidgetName, cons
MyMoneyTransaction transaction; MyMoneyTransaction transaction;
transaction.setCommodity(m_currency.id()); transaction.setCommodity(m_currency.id());
if(splits.count() == 0 && category->selectedItem()) { if(splits.count() == 0 && !category->selectedItem().isEmpty()) {
MyMoneySplit s; MyMoneySplit s;
s.setAccountId(category->selectedItem()); s.setAccountId(category->selectedItem());
s.setShares(amount->value()); s.setShares(amount->value());

@ -137,7 +137,7 @@ void KEditLoanWizard::loadWidgets(const MyMoneyAccount& /* account */)
m_newInterestRateEdit->setPrecision(3); m_newInterestRateEdit->setPrecision(3);
m_interestRateLabel->setText(TQString(" ") + ir.formatMoney("", 3) + TQString("%")); m_interestRateLabel->setText(TQString(" ") + ir.formatMoney("", 3) + TQString("%"));
m_paymentFrequencyUnitEdit->setCurrentItem(i18n(m_schedule.occurenceToString())); m_paymentFrequencyUnitEdit->setCurrentItem(i18n(m_schedule.occurenceToString().utf8()));
updateTermWidgets(m_account.term()); updateTermWidgets(m_account.term());
// the base payment (amortization and interest) is determined // the base payment (amortization and interest) is determined

@ -112,7 +112,7 @@ void KImportDlg::slotBrowse()
KFileDialog dialog(TDEGlobalSettings::documentPath(), KFileDialog dialog(TDEGlobalSettings::documentPath(),
i18n("%1|Import files\n%2|All files (*.*)").arg(tmpprofile.filterFileType()).arg("*"), i18n("%1|Import files\n%2|All files (*.*)").arg(tmpprofile.filterFileType()).arg("*"),
this, i18n("Import File..."), true); this, i18n("Import File...").utf8(), true);
dialog.setMode(KFile::File | KFile::ExistingOnly); dialog.setMode(KFile::File | KFile::ExistingOnly);
if(dialog.exec() == TQDialog::Accepted) { if(dialog.exec() == TQDialog::Accepted) {

@ -358,7 +358,7 @@ KNewAccountDlg::KNewAccountDlg(const MyMoneyAccount& account, bool isEditing, bo
accountNameEdit->setFocus(); accountNameEdit->setFocus();
if (title) if (!title.isEmpty())
setCaption(title); setCaption(title);
// load button icons // load button icons

@ -114,7 +114,7 @@ KNewLoanWizard::KNewLoanWizard(TQWidget *parent, const char *name ) :
m_interestFrequencyAmountEdit->setValue(1); m_interestFrequencyAmountEdit->setValue(1);
m_interestFrequencyUnitEdit->setCurrentItem(static_cast<int>(MyMoneyAccountLoan::changeYearly)); m_interestFrequencyUnitEdit->setCurrentItem(static_cast<int>(MyMoneyAccountLoan::changeYearly));
m_paymentFrequencyUnitEdit->setCurrentItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY))); m_paymentFrequencyUnitEdit->setCurrentItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY).utf8()));
m_firstDueDateEdit->loadDate(TQDate(TQDate::currentDate().year(),TQDate::currentDate().month(),30)); m_firstDueDateEdit->loadDate(TQDate(TQDate::currentDate().year(),TQDate::currentDate().month(),30));
m_paymentAccountEdit->removeButtons(); m_paymentAccountEdit->removeButtons();
@ -619,21 +619,21 @@ void KNewLoanWizard::loadComboBoxes(void)
m_interestFrequencyUnitEdit->insertItem(i18n("Months"), static_cast<int>(MyMoneyAccountLoan::changeMonthly)); m_interestFrequencyUnitEdit->insertItem(i18n("Months"), static_cast<int>(MyMoneyAccountLoan::changeMonthly));
m_interestFrequencyUnitEdit->insertItem(i18n("Years"), static_cast<int>(MyMoneyAccountLoan::changeYearly)); m_interestFrequencyUnitEdit->insertItem(i18n("Years"), static_cast<int>(MyMoneyAccountLoan::changeYearly));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_DAILY))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_DAILY).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_WEEKLY))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_WEEKLY).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_FORTNIGHTLY))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_FORTNIGHTLY).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERWEEK))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERWEEK).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYHALFMONTH))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYHALFMONTH).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURWEEKS))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURWEEKS).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY).utf8()));
m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY))); m_paymentFrequencyUnitEdit->insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY).utf8()));
m_durationUnitEdit->insertItem(i18n("Months"), static_cast<int>(MyMoneySchedule::OCCUR_MONTHLY)); m_durationUnitEdit->insertItem(i18n("Months"), static_cast<int>(MyMoneySchedule::OCCUR_MONTHLY));
m_durationUnitEdit->insertItem(i18n("Years"), static_cast<int>(MyMoneySchedule::OCCUR_YEARLY)); m_durationUnitEdit->insertItem(i18n("Years"), static_cast<int>(MyMoneySchedule::OCCUR_YEARLY));

@ -80,9 +80,9 @@ void KConfirmManualEnterDlg::loadTransactions(const MyMoneyTransaction& to, cons
try try
{ {
TQString po, pn; TQString po, pn;
if(to.splits()[0].payeeId()) if(!to.splits()[0].payeeId().isEmpty())
po = file->payee(to.splits()[0].payeeId()).name(); po = file->payee(to.splits()[0].payeeId()).name();
if(tn.splits()[0].payeeId()) if(!tn.splits()[0].payeeId().isEmpty())
pn = file->payee(tn.splits()[0].payeeId()).name(); pn = file->payee(tn.splits()[0].payeeId()).name();
if (po != pn) { if (po != pn) {

@ -503,7 +503,7 @@ void KMyMoney2App::dumpActions(void) const
TDEActionPtrList list = actionCollection()->actions(); TDEActionPtrList list = actionCollection()->actions();
TDEActionPtrList::const_iterator it; TDEActionPtrList::const_iterator it;
for(it = list.begin(); it != list.end(); ++it) { for(it = list.begin(); it != list.end(); ++it) {
std::cout << (*it)->name() << ": " << (*it)->text() << std::endl; std::cout << (*it)->name() << ": " << (*it)->text().local8Bit() << std::endl;
} }
} }
@ -855,7 +855,7 @@ KURL KMyMoney2App::selectFile(const TQString& title, const TQString& _path, cons
if(path.isEmpty()) if(path.isEmpty())
path = TDEGlobalSettings::documentPath(); path = TDEGlobalSettings::documentPath();
KFileDialog* dialog = new KFileDialog(path, mask, this, title, true); KFileDialog* dialog = new KFileDialog(path, mask, this, title.utf8(), true);
dialog->setMode(mode); dialog->setMode(mode);
if(dialog->exec() == TQDialog::Accepted) { if(dialog->exec() == TQDialog::Accepted) {
@ -873,7 +873,7 @@ void KMyMoney2App::slotFileOpen(void)
KFileDialog* dialog = new KFileDialog(TDEGlobalSettings::documentPath(), KFileDialog* dialog = new KFileDialog(TDEGlobalSettings::documentPath(),
i18n("%1|KMyMoney files\n%2|All files (*.*)").arg("*.kmy *.xml").arg("*"), i18n("%1|KMyMoney files\n%2|All files (*.*)").arg("*.kmy *.xml").arg("*"),
this, i18n("Open File..."), true); this, i18n("Open File...").utf8(), true);
dialog->setMode(KFile::File | KFile::ExistingOnly); dialog->setMode(KFile::File | KFile::ExistingOnly);
if(dialog->exec() == TQDialog::Accepted) { if(dialog->exec() == TQDialog::Accepted) {
@ -1621,7 +1621,7 @@ void KMyMoney2App::slotGncImport(void)
KFileDialog* dialog = new KFileDialog(TDEGlobalSettings::documentPath(), KFileDialog* dialog = new KFileDialog(TDEGlobalSettings::documentPath(),
i18n("%1|Gnucash files\n%2|All files (*.*)").arg("*").arg("*"), i18n("%1|Gnucash files\n%2|All files (*.*)").arg("*").arg("*"),
this, i18n("Import Gnucash file..."), true); this, i18n("Import Gnucash file...").utf8(), true);
dialog->setMode(KFile::File | KFile::ExistingOnly); dialog->setMode(KFile::File | KFile::ExistingOnly);
if(dialog->exec() == TQDialog::Accepted) { if(dialog->exec() == TQDialog::Accepted) {
@ -1664,7 +1664,7 @@ void KMyMoney2App::slotStatementImport(void)
KFileDialog* dialog = new KFileDialog(TDEGlobalSettings::documentPath(), KFileDialog* dialog = new KFileDialog(TDEGlobalSettings::documentPath(),
i18n("%1|XML files\n%2|All files (*.*)").arg("*.xml").arg("*.*"), i18n("%1|XML files\n%2|All files (*.*)").arg("*.xml").arg("*.*"),
this, i18n("Import XML Statement..."), true); this, i18n("Import XML Statement...").utf8(), true);
dialog->setMode(KFile::File | KFile::ExistingOnly); dialog->setMode(KFile::File | KFile::ExistingOnly);
if(dialog->exec() == TQDialog::Accepted) if(dialog->exec() == TQDialog::Accepted)

@ -84,7 +84,7 @@ class MyProgressListener : public CppUnit::TextTestProgressListener
if(m_name != name) { if(m_name != name) {
if(m_name != "") if(m_name != "")
std::cout << std::endl; std::cout << std::endl;
std::cout << "Running: " << name << std::endl; std::cout << "Running: " << name.local8Bit() << std::endl;
m_name = name; m_name = name;
} }
} }

@ -120,27 +120,27 @@ MyMoneySecurity::eSECURITYTYPE KMyMoneyUtils::stringToSecurity(const TQString& t
const TQString KMyMoneyUtils::securityTypeToString(const MyMoneySecurity::eSECURITYTYPE securityType) const TQString KMyMoneyUtils::securityTypeToString(const MyMoneySecurity::eSECURITYTYPE securityType)
{ {
return i18n(MyMoneySecurity::securityTypeToString(securityType)); return i18n(MyMoneySecurity::securityTypeToString(securityType).utf8());
} }
const TQString KMyMoneyUtils::occurenceToString(const MyMoneySchedule::occurenceE occurence) const TQString KMyMoneyUtils::occurenceToString(const MyMoneySchedule::occurenceE occurence)
{ {
return i18n(MyMoneySchedule::occurenceToString(occurence)); return i18n(MyMoneySchedule::occurenceToString(occurence).utf8());
} }
const TQString KMyMoneyUtils::paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType) const TQString KMyMoneyUtils::paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType)
{ {
return i18n(MyMoneySchedule::paymentMethodToString(paymentType)); return i18n(MyMoneySchedule::paymentMethodToString(paymentType).utf8());
} }
const TQString KMyMoneyUtils::weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption) const TQString KMyMoneyUtils::weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption)
{ {
return i18n(MyMoneySchedule::weekendOptionToString(weekendOption)); return i18n(MyMoneySchedule::weekendOptionToString(weekendOption).utf8());
} }
const TQString KMyMoneyUtils::scheduleTypeToString(MyMoneySchedule::typeE type) const TQString KMyMoneyUtils::scheduleTypeToString(MyMoneySchedule::typeE type)
{ {
return i18n(MyMoneySchedule::scheduleTypeToString(type)); return i18n(MyMoneySchedule::scheduleTypeToString(type).utf8());
} }
KGuiItem KMyMoneyUtils::scheduleNewGuiItem(void) KGuiItem KMyMoneyUtils::scheduleNewGuiItem(void)

@ -97,7 +97,7 @@ int main(int argc, char *argv[])
TDEAboutData aboutData( "kmymoney2", I18N_NOOP("KMyMoney"), TDEAboutData aboutData( "kmymoney2", I18N_NOOP("KMyMoney"),
VERSION, description, TDEAboutData::License_GPL, VERSION, description, TDEAboutData::License_GPL,
"(c) 2000-2009 The KMyMoney development team", feature, "(c) 2000-2009 The KMyMoney development team", feature.utf8(),
"http://kmymoney2.sourceforge.net/", "http://kmymoney2.sourceforge.net/",
"kmymoney2-developer@lists.sourceforge.net"); "kmymoney2-developer@lists.sourceforge.net");

@ -305,7 +305,7 @@ const MyMoneyMoney MyMoneyAccountLoan::interestRate(const TQDate& date) const
for(it = pairs().begin(); it != pairs().end(); ++it) { for(it = pairs().begin(); it != pairs().end(); ++it) {
if(regExp.search(it.key()) > -1) { if(regExp.search(it.key()) > -1) {
if(qstrcmp(it.key(),key) <= 0) if(it.key() <= key)
val = *it; val = *it;
else else
break; break;

@ -759,7 +759,7 @@ const MyMoneyAccount MyMoneyFile::openingBalanceAccount_internal(const MyMoneySe
throw new MYMONEYEXCEPTION("Opening balance for non currencies not supported"); throw new MYMONEYEXCEPTION("Opening balance for non currencies not supported");
MyMoneyAccount acc; MyMoneyAccount acc;
TQRegExp match(TQString("^%1").arg(i18n(MyMoneyFile::OpeningBalancesPrefix))); TQRegExp match(TQString("^%1").arg(i18n(MyMoneyFile::OpeningBalancesPrefix.utf8())));
TQValueList<MyMoneyAccount> accounts; TQValueList<MyMoneyAccount> accounts;
TQValueList<MyMoneyAccount>::Iterator it; TQValueList<MyMoneyAccount>::Iterator it;
@ -787,7 +787,7 @@ const MyMoneyAccount MyMoneyFile::createOpeningBalanceAccount(const MyMoneySecur
checkTransaction(__PRETTY_FUNCTION__); checkTransaction(__PRETTY_FUNCTION__);
MyMoneyAccount acc; MyMoneyAccount acc;
TQString name(i18n(MyMoneyFile::OpeningBalancesPrefix)); TQString name(i18n(MyMoneyFile::OpeningBalancesPrefix.utf8()));
if(security.id() != baseCurrency().id()) { if(security.id() != baseCurrency().id()) {
name += TQString(" (%1)").arg(security.id()); name += TQString(" (%1)").arg(security.id());
} }

@ -185,7 +185,7 @@ MyMoneyMoney::MyMoneyMoney(const TQString& pszAmount)
} }
// tqDebug("4: '%s'", res.data()); // tqDebug("4: '%s'", res.data());
if(res.length() > 0) if(res.length() > 0)
m_num = atoll( res ); m_num = res.toLongLong();
if(isNegative) if(isNegative)
m_num = -m_num; m_num = -m_num;

@ -1372,26 +1372,26 @@ void MyMoneyScheduleTest::testStringToOccurence()
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Yearly")) == MyMoneySchedule::OCCUR_YEARLY ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Yearly")) == MyMoneySchedule::OCCUR_YEARLY );
CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every other year")) == MyMoneySchedule::OCCUR_EVERYOTHERYEAR ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every other year")) == MyMoneySchedule::OCCUR_EVERYOTHERYEAR );
// test occurence == stringToOccurence(i18n(occurenceToString(occurence))) // test occurence == stringToOccurence(i18n(occurenceToString(occurence)))
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_ONCE == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_ONCE))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_ONCE == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_ONCE).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_DAILY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_DAILY))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_DAILY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_DAILY).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_WEEKLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_WEEKLY))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_WEEKLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_WEEKLY).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERWEEK == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERWEEK))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERWEEK == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERWEEK).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_FORTNIGHTLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_FORTNIGHTLY))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_FORTNIGHTLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_FORTNIGHTLY).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYHALFMONTH == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYHALFMONTH))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYHALFMONTH == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYHALFMONTH).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYFOURWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURWEEKS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYFOURWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURWEEKS).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_MONTHLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_MONTHLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERMONTH == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERMONTH == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_QUARTERLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_QUARTERLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYFOURMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYFOURMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_TWICEYEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_TWICEYEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_YEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_YEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY).utf8())) );
CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERYEAR == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERYEAR == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR).utf8())) );
} }
void MyMoneyScheduleTest::testEventsPerYear() void MyMoneyScheduleTest::testEventsPerYear()
{ {

@ -143,7 +143,7 @@ bool MyMoneyStatement::read(const TQDomElement& _e)
m_dateEnd = TQDate::fromString(_e.attribute("enddate"),Qt::ISODate); m_dateEnd = TQDate::fromString(_e.attribute("enddate"),Qt::ISODate);
m_closingBalance = MyMoneyMoney(_e.attribute("closingbalance")); m_closingBalance = MyMoneyMoney(_e.attribute("closingbalance"));
m_accountId = _e.attribute("accountid"); m_accountId = _e.attribute("accountid");
m_skipCategoryMatching = _e.attribute("skipCategoryMatching"); m_skipCategoryMatching = !(_e.attribute("skipCategoryMatching").isEmpty());
int i = kAccountTypeTxt.findIndex(_e.attribute("type",kAccountTypeTxt[1])); int i = kAccountTypeTxt.findIndex(_e.attribute("type",kAccountTypeTxt[1]));
if ( i != -1 ) if ( i != -1 )

@ -99,7 +99,7 @@ void MyMoneyTransactionFilter::addAccount(const TQStringList& ids)
void MyMoneyTransactionFilter::addAccount(const TQString& id) void MyMoneyTransactionFilter::addAccount(const TQString& id)
{ {
if(!m_accounts.isEmpty() && !id.isEmpty()) { if(!m_accounts.isEmpty() && !id.isEmpty()) {
if(m_accounts.find(id) != 0) if(m_accounts.find(id.utf8()) != 0)
return; return;
} }
if(m_accounts.count() >= m_accounts.size()*2) { if(m_accounts.count() >= m_accounts.size()*2) {
@ -107,7 +107,7 @@ void MyMoneyTransactionFilter::addAccount(const TQString& id)
} }
m_filterSet.singleFilter.accountFilter = 1; m_filterSet.singleFilter.accountFilter = 1;
if(!id.isEmpty()) if(!id.isEmpty())
m_accounts.insert(id, ""); m_accounts.insert(id.utf8(), "");
} }
void MyMoneyTransactionFilter::addCategory(const TQStringList& ids) void MyMoneyTransactionFilter::addCategory(const TQStringList& ids)
@ -122,7 +122,7 @@ void MyMoneyTransactionFilter::addCategory(const TQStringList& ids)
void MyMoneyTransactionFilter::addCategory(const TQString& id) void MyMoneyTransactionFilter::addCategory(const TQString& id)
{ {
if(!m_categories.isEmpty() && !id.isEmpty()) { if(!m_categories.isEmpty() && !id.isEmpty()) {
if(m_categories.find(id) != 0) if(m_categories.find(id.utf8()) != 0)
return; return;
} }
if(m_categories.count() >= m_categories.size()*2) { if(m_categories.count() >= m_categories.size()*2) {
@ -130,7 +130,7 @@ void MyMoneyTransactionFilter::addCategory(const TQString& id)
} }
m_filterSet.singleFilter.categoryFilter = 1; m_filterSet.singleFilter.categoryFilter = 1;
if(!id.isEmpty()) if(!id.isEmpty())
m_categories.insert(id, ""); m_categories.insert(id.utf8(), "");
} }
void MyMoneyTransactionFilter::setDateFilter(const TQDate& from, const TQDate& to) void MyMoneyTransactionFilter::setDateFilter(const TQDate& from, const TQDate& to)
@ -157,7 +157,7 @@ void MyMoneyTransactionFilter::setAmountFilter(const MyMoneyMoney& from, const M
void MyMoneyTransactionFilter::addPayee(const TQString& id) void MyMoneyTransactionFilter::addPayee(const TQString& id)
{ {
if(!m_payees.isEmpty() && !id.isEmpty()) { if(!m_payees.isEmpty() && !id.isEmpty()) {
if(m_payees.find(id) != 0) if(m_payees.find(id.utf8()) != 0)
return; return;
} }
if(m_payees.count() >= m_payees.size()*2) { if(m_payees.count() >= m_payees.size()*2) {
@ -165,7 +165,7 @@ void MyMoneyTransactionFilter::addPayee(const TQString& id)
} }
m_filterSet.singleFilter.payeeFilter = 1; m_filterSet.singleFilter.payeeFilter = 1;
if(!id.isEmpty()) if(!id.isEmpty())
m_payees.insert(id, ""); m_payees.insert(id.utf8(), "");
} }
void MyMoneyTransactionFilter::addType(const int type) void MyMoneyTransactionFilter::addType(const int type)
@ -336,7 +336,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
// check if the split references one of the categories in the list // check if the split references one of the categories in the list
if(m_filterSet.singleFilter.categoryFilter) { if(m_filterSet.singleFilter.categoryFilter) {
if(m_categories.count() > 0) { if(m_categories.count() > 0) {
if(m_categories.find(sp->accountId())) { if(m_categories.find(sp->accountId().utf8())) {
categoryMatched = true; categoryMatched = true;
removeSplit = 0; removeSplit = 0;
} }
@ -351,7 +351,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
// check if the split references one of the accounts in the list // check if the split references one of the accounts in the list
if(m_filterSet.singleFilter.accountFilter) { if(m_filterSet.singleFilter.accountFilter) {
if(m_accounts.count() > 0) { if(m_accounts.count() > 0) {
if(m_accounts.find(sp->accountId())) { if(m_accounts.find(sp->accountId().utf8())) {
accountMatched = true; accountMatched = true;
removeSplit = 0; removeSplit = 0;
} }
@ -365,7 +365,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
} else { } else {
if(m_filterSet.singleFilter.accountFilter) { if(m_filterSet.singleFilter.accountFilter) {
if(m_accounts.count() > 0) { if(m_accounts.count() > 0) {
if(m_accounts.find(sp->accountId())) { if(m_accounts.find(sp->accountId().utf8())) {
accountMatched = true; accountMatched = true;
removeSplit = 0; removeSplit = 0;
} }
@ -424,7 +424,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction)
// check the payee list // check the payee list
if(!removeSplit && m_filterSet.singleFilter.payeeFilter) { if(!removeSplit && m_filterSet.singleFilter.payeeFilter) {
if(m_payees.count() > 0) { if(m_payees.count() > 0) {
if(sp->payeeId().isEmpty() || !m_payees.find(sp->payeeId())) if(sp->payeeId().isEmpty() || !m_payees.find(sp->payeeId().utf8()))
removeSplit = sp; removeSplit = sp;
} else if(!sp->payeeId().isEmpty()) } else if(!sp->payeeId().isEmpty())
removeSplit = sp; removeSplit = sp;
@ -548,17 +548,17 @@ MyMoneyTransactionFilter::validityOptionE MyMoneyTransactionFilter::validTransac
bool MyMoneyTransactionFilter::includesCategory( const TQString& cat ) const bool MyMoneyTransactionFilter::includesCategory( const TQString& cat ) const
{ {
return (! m_filterSet.singleFilter.categoryFilter) || m_categories.find( cat ); return (! m_filterSet.singleFilter.categoryFilter) || m_categories.find( cat.utf8() );
} }
bool MyMoneyTransactionFilter::includesAccount( const TQString& acc ) const bool MyMoneyTransactionFilter::includesAccount( const TQString& acc ) const
{ {
return (! m_filterSet.singleFilter.accountFilter) || m_accounts.find( acc ); return (! m_filterSet.singleFilter.accountFilter) || m_accounts.find( acc.utf8() );
} }
bool MyMoneyTransactionFilter::includesPayee( const TQString& pye ) const bool MyMoneyTransactionFilter::includesPayee( const TQString& pye ) const
{ {
return (! m_filterSet.singleFilter.payeeFilter) || m_payees.find( pye ); return (! m_filterSet.singleFilter.payeeFilter) || m_payees.find( pye.utf8() );
} }
bool MyMoneyTransactionFilter::dateFilter( TQDate& from, TQDate& to ) const bool MyMoneyTransactionFilter::dateFilter( TQDate& from, TQDate& to ) const
@ -848,14 +848,14 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start,
void MyMoneyTransactionFilter::removeReference(const TQString& id) void MyMoneyTransactionFilter::removeReference(const TQString& id)
{ {
if(m_accounts.find(id)) { if(m_accounts.find(id.utf8())) {
tqDebug(TQString("Remove account '%1' from report").arg(id)); tqDebug(TQString("Remove account '%1' from report").arg(id));
m_accounts.remove(id); m_accounts.remove(id.utf8());
} else if(m_categories.find(id)) { } else if(m_categories.find(id.utf8())) {
tqDebug(TQString("Remove category '%1' from report").arg(id)); tqDebug(TQString("Remove category '%1' from report").arg(id));
m_categories.remove(id); m_categories.remove(id.utf8());
} else if(m_payees.find(id)) { } else if(m_payees.find(id.utf8())) {
tqDebug(TQString("Remove payee '%1' from report").arg(id)); tqDebug(TQString("Remove payee '%1' from report").arg(id));
m_payees.remove(id); m_payees.remove(id.utf8());
} }
} }

@ -337,7 +337,7 @@ unsigned long extractId(const TQString& txt)
pos = txt.find(TQRegExp("\\d+"), 0); pos = txt.find(TQRegExp("\\d+"), 0);
if(pos != -1) { if(pos != -1) {
rc = atol(txt.mid(pos)); rc = txt.mid(pos).toLong();
} }
return rc; return rc;
} }

@ -566,7 +566,7 @@ void MyMoneyDatabaseMgrTest::testReparentAccount() {
CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2);
CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id()); CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id());
} catch (MyMoneyException *e) { } catch (MyMoneyException *e) {
std::cout << std::endl << e->what() << std::endl; std::cout << std::endl << e->what().local8Bit() << std::endl;
delete e; delete e;
CPPUNIT_FAIL("Unexpected exception"); CPPUNIT_FAIL("Unexpected exception");
} }
@ -763,7 +763,7 @@ void MyMoneyDatabaseMgrTest::testCopyBudget() {
CPPUNIT_ASSERT(testBudget.budgetStart() == newBudget.budgetStart()); CPPUNIT_ASSERT(testBudget.budgetStart() == newBudget.budgetStart());
CPPUNIT_ASSERT(testBudget.name() == newBudget.name()); CPPUNIT_ASSERT(testBudget.name() == newBudget.name());
} catch (TQString& s) { } catch (TQString& s) {
std::cout << "Error in testCopyBudget(): " << s << std::endl; std::cout << "Error in testCopyBudget(): " << s.local8Bit() << std::endl;
CPPUNIT_ASSERT(false); CPPUNIT_ASSERT(false);
} }
} }

@ -1025,7 +1025,7 @@ void MyMoneySeqAccessMgr::loadAccounts(const TQMap<TQString, MyMoneyAccount>& ma
int pos = lastId.find(TQRegExp("\\d+"), 0); int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) { if(pos != -1) {
m_nextAccountID = atol(lastId.mid(pos)); m_nextAccountID = lastId.mid(pos).toLong();
} }
} }
@ -1048,7 +1048,7 @@ void MyMoneySeqAccessMgr::loadTransactions(const TQMap<TQString, MyMoneyTransact
int pos = lastId.find(TQRegExp("\\d+"), 0); int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) { if(pos != -1) {
m_nextTransactionID = atol(lastId.mid(pos)); m_nextTransactionID = lastId.mid(pos).toLong();
} }
} }
@ -1066,7 +1066,7 @@ void MyMoneySeqAccessMgr::loadInstitutions(const TQMap<TQString, MyMoneyInstitut
int pos = lastId.find(TQRegExp("\\d+"), 0); int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) { if(pos != -1) {
m_nextInstitutionID = atol(lastId.mid(pos)); m_nextInstitutionID = lastId.mid(pos).toLong();
} }
} }
@ -1087,7 +1087,7 @@ void MyMoneySeqAccessMgr::loadPayees(const TQMap<TQString, MyMoneyPayee>& map)
int pos = lastId.find(TQRegExp("\\d+"), 0); int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) { if(pos != -1) {
m_nextPayeeID = atol(lastId.mid(pos)); m_nextPayeeID = lastId.mid(pos).toLong();
} }
} }
@ -1105,7 +1105,7 @@ void MyMoneySeqAccessMgr::loadSecurities(const TQMap<TQString, MyMoneySecurity>&
int pos = lastId.find(TQRegExp("\\d+"), 0); int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) { if(pos != -1) {
m_nextSecurityID = atol(lastId.mid(pos)); m_nextSecurityID = lastId.mid(pos).toLong();
} }
} }
@ -1329,7 +1329,7 @@ void MyMoneySeqAccessMgr::loadSchedules(const TQMap<TQString, MyMoneySchedule>&
int pos = lastId.find(TQRegExp("\\d+"), 0); int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) { if(pos != -1) {
m_nextScheduleID = atol(lastId.mid(pos)); m_nextScheduleID = lastId.mid(pos).toLong();
} }
} }
@ -1531,7 +1531,7 @@ void MyMoneySeqAccessMgr::loadReports(const TQMap<TQString, MyMoneyReport>& map)
int pos = lastId.find(TQRegExp("\\d+"), 0); int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) { if(pos != -1) {
m_nextReportID = atol(lastId.mid(pos)); m_nextReportID = lastId.mid(pos).toLong();
} }
} }
@ -1605,7 +1605,7 @@ void MyMoneySeqAccessMgr::loadBudgets(const TQMap<TQString, MyMoneyBudget>& map)
int pos = lastId.find(TQRegExp("\\d+"), 0); int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) { if(pos != -1) {
m_nextBudgetID = atol(lastId.mid(pos)); m_nextBudgetID = lastId.mid(pos).toLong();
} }
} }

@ -486,7 +486,7 @@ void MyMoneySeqAccessMgrTest::testReparentAccount() {
CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2);
CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id()); CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id());
} catch (MyMoneyException *e) { } catch (MyMoneyException *e) {
std::cout << std::endl << e->what() << std::endl; std::cout << std::endl << e->what().local8Bit() << std::endl;
delete e; delete e;
CPPUNIT_FAIL("Unexpected exception"); CPPUNIT_FAIL("Unexpected exception");
} }

@ -64,10 +64,10 @@ MyMoneySqlQuery::MyMoneySqlQuery (MyMoneyStorageSql* db)
} }
bool MyMoneySqlQuery::exec () { bool MyMoneySqlQuery::exec () {
TRACE(TQString("start sql - %1").arg(lastQuery())); TRACE(TQString("start sql - %1").arg(lastQuery()).local8Bit());
bool rc = TQSqlQuery::exec(); bool rc = TQSqlQuery::exec();
TQString msg("end sql\n%1\n***Query returned %2, row count %3"); TQString msg("end sql\n%1\n***Query returned %2, row count %3");
TRACE (msg.arg(TQSqlQuery::executedQuery()).arg(rc).arg(numRowsAffected())); TRACE(msg.arg(TQSqlQuery::executedQuery()).arg(rc).arg(numRowsAffected()).local8Bit());
//DBG (TQString("%1\n***Query returned %2, row count %3").arg(TQSqlQuery::executedQuery()).arg(rc).arg(size())); //DBG (TQString("%1\n***Query returned %2, row count %3").arg(TQSqlQuery::executedQuery()).arg(rc).arg(size()));
return (rc); return (rc);
} }

@ -260,7 +260,7 @@ bool KOnlineBankingSetupWizard::finishLoginPage(void)
ofx_set_account_cb(ctx, ofxAccountCallback, this); ofx_set_account_cb(ctx, ofxAccountCallback, this);
ofx_set_status_cb(ctx, ofxStatusCallback, this); ofx_set_status_cb(ctx, ofxStatusCallback, this);
// Add resulting accounts to the account list // Add resulting accounts to the account list
libofx_proc_file(ctx, filename.path(), AUTODETECT); libofx_proc_file(ctx, filename.path().local8Bit(), AUTODETECT);
libofx_free_context(ctx); libofx_free_context(ctx);
++m_it_info; ++m_it_info;

@ -360,7 +360,7 @@ void OfxHttpsRequest::slotOfxFinished(TDEIO::Job* /* e */)
int error = m_job->error(); int error = m_job->error();
if ( error ) { if ( error ) {
m_job->showErrorDialog(); m_job->showErrorDialog();
unlink(m_dst.path()); unlink(m_dst.path().local8Bit());
} else if ( m_job->isErrorPage() ) { } else if ( m_job->isErrorPage() ) {
TQString details; TQString details;
@ -374,7 +374,7 @@ void OfxHttpsRequest::slotOfxFinished(TDEIO::Job* /* e */)
f.close(); f.close();
} }
KMessageBox::detailedSorry( 0, i18n("The HTTP request failed."), details, i18n("Failed") ); KMessageBox::detailedSorry( 0, i18n("The HTTP request failed."), details, i18n("Failed") );
unlink(m_dst.path()); unlink(m_dst.path().local8Bit());
} }
tqApp->exit_loop(); tqApp->exit_loop();
@ -414,7 +414,7 @@ OfxHttpRequest::OfxHttpRequest(const TQString& type, const KURL &url, const TQBy
if(m_error != TQHttp::NoError) { if(m_error != TQHttp::NoError) {
KMessageBox::error(0, errorMsg, i18n("OFX setup error")); KMessageBox::error(0, errorMsg, i18n("OFX setup error"));
unlink(dst.path()); unlink(dst.path().local8Bit());
} }
} }

@ -172,7 +172,7 @@ void ObjectInfoTable::constructScheduleTable ( void )
scheduleRow["name"] = schedule.name(); scheduleRow["name"] = schedule.name();
scheduleRow["nextduedate"] = schedule.nextDueDate().toString ( Qt::ISODate ); scheduleRow["nextduedate"] = schedule.nextDueDate().toString ( Qt::ISODate );
scheduleRow["type"] = KMyMoneyUtils::scheduleTypeToString ( schedule.type() ); scheduleRow["type"] = KMyMoneyUtils::scheduleTypeToString ( schedule.type() );
scheduleRow["occurence"] = i18n( schedule.occurenceToString() ); scheduleRow["occurence"] = i18n(schedule.occurenceToString().utf8());
scheduleRow["paymenttype"] = KMyMoneyUtils::paymentMethodToString ( schedule.paymentType() ); scheduleRow["paymenttype"] = KMyMoneyUtils::paymentMethodToString ( schedule.paymentType() );
//scheduleRow["category"] = account.name(); //scheduleRow["category"] = account.name();

@ -1636,7 +1636,7 @@ TQString PivotTable::renderHTML( void ) const
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
result += TQString("<td%2>%1</td>") result += TQString("<td%2>%1</td>")
.arg(i18n( m_columnTypeHeaderList[i] )) .arg(i18n(m_columnTypeHeaderList[i].utf8()))
.arg(i == 0 ? lb : TQString() ); .arg(i == 0 ? lb : TQString() );
} }
column++; column++;
@ -1644,7 +1644,7 @@ TQString PivotTable::renderHTML( void ) const
if ( m_config_f.isShowingRowTotals() ) { if ( m_config_f.isShowingRowTotals() ) {
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) { for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
result += TQString("<td%2>%1</td>") result += TQString("<td%2>%1</td>")
.arg(i18n( m_columnTypeHeaderList[i] )) .arg(i18n(m_columnTypeHeaderList[i].utf8()))
.arg(i == 0 ? leftborder : TQString() ); .arg(i == 0 ? leftborder : TQString() );
} }
} }

@ -636,7 +636,7 @@ void KHomeView::showPaymentEntry(const MyMoneySchedule& sched, int cnt)
try { try {
MyMoneyAccount acc = sched.account(); MyMoneyAccount acc = sched.account();
if(acc.id()) { if(!acc.id().isEmpty()) {
MyMoneyTransaction t = sched.transaction(); MyMoneyTransaction t = sched.transaction();
// only show the entry, if it is still active // only show the entry, if it is still active
// FIXME clean old code // FIXME clean old code
@ -1177,7 +1177,7 @@ void KHomeView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args */)
} else if(view == "action") { } else if(view == "action") {
TDEMainWindow* mw = dynamic_cast<TDEMainWindow*>(tqApp->mainWidget()); TDEMainWindow* mw = dynamic_cast<TDEMainWindow*>(tqApp->mainWidget());
TQ_CHECK_PTR(mw); TQ_CHECK_PTR(mw);
TQTimer::singleShot(0, mw->actionCollection()->action( id ), TQT_SLOT(activate())); TQTimer::singleShot(0, mw->actionCollection()->action(id.utf8()), TQT_SLOT(activate()));
} else if(view == VIEW_HOME) { } else if(view == VIEW_HOME) {
TQValueList<MyMoneyAccount> list; TQValueList<MyMoneyAccount> list;
@ -1653,7 +1653,7 @@ void KHomeView::showCashFlowSummary()
} }
MyMoneyAccount acc = (*sched_it).account(); MyMoneyAccount acc = (*sched_it).account();
if(acc.id()) { if(!acc.id().isEmpty()) {
MyMoneyTransaction transaction = (*sched_it).transaction(); MyMoneyTransaction transaction = (*sched_it).transaction();
// only show the entry, if it is still active // only show the entry, if it is still active

@ -1150,7 +1150,7 @@ bool KMyMoneyView::saveFile(const KURL& url, const TQString& keyList)
throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").arg(filename)); throw new MYMONEYEXCEPTION(i18n("Unable to write changes to '%1'").arg(filename));
} }
} }
chown(filename, static_cast<uid_t>(-1), gid); chown(filename.local8Bit(), static_cast<uid_t>(-1), gid);
} else { } else {
KTempFile tmpfile; KTempFile tmpfile;
saveToLocalFile(tmpfile.file(), pWriter, plaintext, keyList); saveToLocalFile(tmpfile.file(), pWriter, plaintext, keyList);

@ -549,10 +549,10 @@ void KReportsView::slotOpenURL(const KURL &url, const KParts::URLArgs& /* args *
else if ( command == "delete" ) else if ( command == "delete" )
slotDelete(); slotDelete();
else else
tqDebug("Unknown command '%s' in KReportsView::slotOpenURL()", static_cast<const char*>(command)); tqDebug(TQString("Unknown command '%1' in KReportsView::slotOpenURL()").arg(command));
} else { } else {
tqDebug("Unknown view '%s' in KReportsView::slotOpenURL()", view.latin1()); tqDebug(TQString("Unknown view '%1' in KReportsView::slotOpenURL()").arg(view));
} }
} }

@ -143,7 +143,7 @@ KScheduledListItem::KScheduledListItem(KScheduledListItem *parent, const MyMoney
else else
setText(4, TDEGlobal::locale()->formatDate(schedule.adjustedNextDueDate(), true)); setText(4, TDEGlobal::locale()->formatDate(schedule.adjustedNextDueDate(), true));
setText(5, i18n(schedule.occurenceToString())); setText(5, i18n(schedule.occurenceToString().utf8()));
setText(6, KMyMoneyUtils::paymentMethodToString(schedule.paymentType())); setText(6, KMyMoneyUtils::paymentMethodToString(schedule.paymentType()));
} }
catch (MyMoneyException *e) catch (MyMoneyException *e)

@ -114,12 +114,12 @@ void KMyMoneyBriefSchedule::loadSchedule()
.arg(TDEGlobal::locale()->formatDate(m_date, true)) .arg(TDEGlobal::locale()->formatDate(m_date, true))
.arg(amount.formatMoney(sched.account().fraction())) .arg(amount.formatMoney(sched.account().fraction()))
.arg(TQString::number(transactions)) .arg(TQString::number(transactions))
.arg(i18n(sched.occurenceToString())); .arg(i18n(sched.occurenceToString().utf8()));
} else { } else {
text = i18n("Payment on %1 for %2 occuring %4.") text = i18n("Payment on %1 for %2 occuring %4.")
.arg(TDEGlobal::locale()->formatDate(m_date, true)) .arg(TDEGlobal::locale()->formatDate(m_date, true))
.arg(amount.formatMoney(sched.account().fraction())) .arg(amount.formatMoney(sched.account().fraction()))
.arg(i18n(sched.occurenceToString())); .arg(i18n(sched.occurenceToString().utf8()));
} }
if (m_date < TQDate::currentDate()) if (m_date < TQDate::currentDate())

@ -741,33 +741,33 @@ MyMoneySchedule::occurenceE KMyMoneyOccurenceCombo::currentItem(void) const
KMyMoneyOccurencePeriodCombo::KMyMoneyOccurencePeriodCombo(TQWidget* parent, const char* name) : KMyMoneyOccurencePeriodCombo::KMyMoneyOccurencePeriodCombo(TQWidget* parent, const char* name) :
KMyMoneyOccurenceCombo(parent, name) KMyMoneyOccurenceCombo(parent, name)
{ {
insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_ONCE)), MyMoneySchedule::OCCUR_ONCE); insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_ONCE).utf8()), MyMoneySchedule::OCCUR_ONCE);
insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_DAILY)), MyMoneySchedule::OCCUR_DAILY); insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_DAILY).utf8()), MyMoneySchedule::OCCUR_DAILY);
insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_WEEKLY)), MyMoneySchedule::OCCUR_WEEKLY); insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_WEEKLY).utf8()), MyMoneySchedule::OCCUR_WEEKLY);
insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYHALFMONTH)), MyMoneySchedule::OCCUR_EVERYHALFMONTH); insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYHALFMONTH).utf8()), MyMoneySchedule::OCCUR_EVERYHALFMONTH);
insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_MONTHLY)), MyMoneySchedule::OCCUR_MONTHLY); insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_MONTHLY).utf8()), MyMoneySchedule::OCCUR_MONTHLY);
insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_YEARLY)), MyMoneySchedule::OCCUR_YEARLY); insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_YEARLY).utf8()), MyMoneySchedule::OCCUR_YEARLY);
} }
KMyMoneyFrequencyCombo::KMyMoneyFrequencyCombo(TQWidget* parent, const char* name) : KMyMoneyFrequencyCombo::KMyMoneyFrequencyCombo(TQWidget* parent, const char* name) :
KMyMoneyOccurenceCombo(parent, name) KMyMoneyOccurenceCombo(parent, name)
{ {
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_ONCE)), MyMoneySchedule::OCCUR_ONCE); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_ONCE).utf8()), MyMoneySchedule::OCCUR_ONCE);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_DAILY)), MyMoneySchedule::OCCUR_DAILY); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_DAILY).utf8()), MyMoneySchedule::OCCUR_DAILY);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_WEEKLY)), MyMoneySchedule::OCCUR_WEEKLY); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_WEEKLY).utf8()), MyMoneySchedule::OCCUR_WEEKLY);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERWEEK)), MyMoneySchedule::OCCUR_EVERYOTHERWEEK); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERWEEK).utf8()), MyMoneySchedule::OCCUR_EVERYOTHERWEEK);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYHALFMONTH)), MyMoneySchedule::OCCUR_EVERYHALFMONTH); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYHALFMONTH).utf8()), MyMoneySchedule::OCCUR_EVERYHALFMONTH);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS)), MyMoneySchedule::OCCUR_EVERYTHREEWEEKS); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS).utf8()), MyMoneySchedule::OCCUR_EVERYTHREEWEEKS);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS)), MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS).utf8()), MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURWEEKS)), MyMoneySchedule::OCCUR_EVERYFOURWEEKS); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURWEEKS).utf8()), MyMoneySchedule::OCCUR_EVERYFOURWEEKS);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY)), MyMoneySchedule::OCCUR_MONTHLY); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_MONTHLY).utf8()), MyMoneySchedule::OCCUR_MONTHLY);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS)), MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS).utf8()), MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH)), MyMoneySchedule::OCCUR_EVERYOTHERMONTH); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH).utf8()), MyMoneySchedule::OCCUR_EVERYOTHERMONTH);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS)), MyMoneySchedule::OCCUR_EVERYTHREEMONTHS); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS).utf8()), MyMoneySchedule::OCCUR_EVERYTHREEMONTHS);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS)), MyMoneySchedule::OCCUR_EVERYFOURMONTHS); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS).utf8()), MyMoneySchedule::OCCUR_EVERYFOURMONTHS);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY)), MyMoneySchedule::OCCUR_TWICEYEARLY); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY).utf8()), MyMoneySchedule::OCCUR_TWICEYEARLY);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY)), MyMoneySchedule::OCCUR_YEARLY); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY).utf8()), MyMoneySchedule::OCCUR_YEARLY);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR)), MyMoneySchedule::OCCUR_EVERYOTHERYEAR); insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR).utf8()), MyMoneySchedule::OCCUR_EVERYOTHERYEAR);
} }
int KMyMoneyFrequencyCombo::daysBetweenEvents(void) const int KMyMoneyFrequencyCombo::daysBetweenEvents(void) const

@ -188,7 +188,7 @@ bool ItemPtrVector::item_cmp(RegisterItem* i1, RegisterItem* i2)
break; break;
case EntryOrderSort: case EntryOrderSort:
rc = qstrcmp(i1->sortEntryOrder(), i2->sortEntryOrder()); rc = TQString::compare(i1->sortEntryOrder(), i2->sortEntryOrder());
break; break;
case TypeSort: case TypeSort:
@ -218,7 +218,7 @@ bool ItemPtrVector::item_cmp(RegisterItem* i1, RegisterItem* i2)
} }
if(rc == 0) { if(rc == 0) {
rc = qstrcmp(i1->sortEntryOrder(), i2->sortEntryOrder()); rc = TQString::compare(i1->sortEntryOrder(), i2->sortEntryOrder());
} }
return rc < 0; return rc < 0;
@ -1853,7 +1853,7 @@ void Register::slotEnsureItemVisible(void)
TransactionSortField KMyMoneyRegister::textToSortOrder(const TQString& text) TransactionSortField KMyMoneyRegister::textToSortOrder(const TQString& text)
{ {
for(int idx = 1; idx < static_cast<int>(MaxSortFields); ++idx) { for(int idx = 1; idx < static_cast<int>(MaxSortFields); ++idx) {
if(text == i18n(sortOrderText[idx])) { if(text == i18n(sortOrderText[idx].utf8())) {
return static_cast<TransactionSortField>(idx); return static_cast<TransactionSortField>(idx);
} }
} }
@ -1864,7 +1864,7 @@ const TQString KMyMoneyRegister::sortOrderToText(TransactionSortField idx)
{ {
if(idx < PostDateSort || idx >= MaxSortFields) if(idx < PostDateSort || idx >= MaxSortFields)
idx = UnknownSort; idx = UnknownSort;
return i18n(sortOrderText[idx]); return i18n(sortOrderText[idx].utf8());
} }
TQString Register::text(int /*row*/, int /*col*/) const TQString Register::text(int /*row*/, int /*col*/) const

Loading…
Cancel
Save