Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/dialogs/kmymoneyfileinfodlg.cpp
Context not available. | |||||
4 | begin : Sun Oct 9 2005 | 4 | begin : Sun Oct 9 2005 | ||
---|---|---|---|---|---|
5 | copyright : (C) 2005 by Thomas Baumgart | 5 | copyright : (C) 2005 by Thomas Baumgart | ||
6 | email : Thomas Baumgart <ipwizard@users.sourceforge.net> | 6 | email : Thomas Baumgart <ipwizard@users.sourceforge.net> | ||
7 | (C) 2017 by Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | ||||
7 | ***************************************************************************/ | 8 | ***************************************************************************/ | ||
8 | 9 | | |||
9 | /*************************************************************************** | 10 | /*************************************************************************** | ||
Context not available. | |||||
29 | // ---------------------------------------------------------------------------- | 30 | // ---------------------------------------------------------------------------- | ||
30 | // Project Includes | 31 | // Project Includes | ||
31 | 32 | | |||
33 | #include "ui_kmymoneyfileinfodlg.h" | ||||
34 | | ||||
32 | #include <imymoneystorage.h> | 35 | #include <imymoneystorage.h> | ||
33 | #include "mymoneyfile.h" | 36 | #include "mymoneyfile.h" | ||
34 | #include "mymoneyinstitution.h" | 37 | #include "mymoneyinstitution.h" | ||
35 | #include "mymoneyaccount.h" | 38 | #include "mymoneyaccount.h" | ||
36 | #include "mymoneyprice.h" | | |||
37 | #include "mymoneypayee.h" | 39 | #include "mymoneypayee.h" | ||
40 | #include "mymoneyprice.h" | ||||
38 | #include "mymoneyschedule.h" | 41 | #include "mymoneyschedule.h" | ||
39 | #include "mymoneytransaction.h" | 42 | #include "mymoneytransaction.h" | ||
40 | #include "mymoneytransactionfilter.h" | 43 | #include "mymoneytransactionfilter.h" | ||
41 | #include "mymoneyenums.h" | 44 | #include "mymoneyenums.h" | ||
42 | 45 | | |||
43 | KMyMoneyFileInfoDlg::KMyMoneyFileInfoDlg(QWidget *parent) | 46 | KMyMoneyFileInfoDlg::KMyMoneyFileInfoDlg(QWidget *parent) : | ||
44 | : KMyMoneyFileInfoDlgDecl(parent) | 47 | QDialog(parent), | ||
48 | ui(new Ui::KMyMoneyFileInfoDlg) | ||||
45 | { | 49 | { | ||
50 | ui->setupUi(this); | ||||
46 | // Now fill the fields with data | 51 | // Now fill the fields with data | ||
47 | IMyMoneyStorage* storage = MyMoneyFile::instance()->storage(); | 52 | auto storage = MyMoneyFile::instance()->storage(); | ||
48 | 53 | | |||
49 | m_creationDate->setText(storage->creationDate().toString(Qt::ISODate)); | 54 | ui->m_creationDate->setText(storage->creationDate().toString(Qt::ISODate)); | ||
50 | m_lastModificationDate->setText(storage->lastModificationDate().toString(Qt::ISODate)); | 55 | ui->m_lastModificationDate->setText(storage->lastModificationDate().toString(Qt::ISODate)); | ||
51 | m_baseCurrency->setText(storage->value("kmm-baseCurrency")); | 56 | ui->m_baseCurrency->setText(storage->value("kmm-baseCurrency")); | ||
52 | 57 | | |||
53 | m_payeeCount->setText(QString("%1").arg(storage->payeeList().count())); | 58 | ui->m_payeeCount->setText(QString::fromLatin1("%1").arg(storage->payeeList().count())); | ||
54 | m_institutionCount->setText(QString("%1").arg(storage->institutionList().count())); | 59 | ui->m_institutionCount->setText(QString::fromLatin1("%1").arg(storage->institutionList().count())); | ||
55 | 60 | | |||
56 | QList<MyMoneyAccount> a_list; | 61 | QList<MyMoneyAccount> a_list; | ||
57 | storage->accountList(a_list); | 62 | storage->accountList(a_list); | ||
58 | m_accountCount->setText(QString("%1").arg(a_list.count())); | 63 | ui->m_accountCount->setText(QString::fromLatin1("%1").arg(a_list.count())); | ||
59 | 64 | | |||
60 | QMap<eMyMoney::Account, int> accountMap; | 65 | QMap<eMyMoney::Account, int> accountMap; | ||
61 | QMap<eMyMoney::Account, int> accountMapClosed; | 66 | QMap<eMyMoney::Account, int> accountMapClosed; | ||
Context not available. | |||||
71 | for (it_m = accountMap.constBegin(); it_m != accountMap.constEnd(); ++it_m) { | 76 | for (it_m = accountMap.constBegin(); it_m != accountMap.constEnd(); ++it_m) { | ||
72 | QTreeWidgetItem *item = new QTreeWidgetItem(); | 77 | QTreeWidgetItem *item = new QTreeWidgetItem(); | ||
73 | item->setText(0, MyMoneyAccount::accountTypeToString(it_m.key())); | 78 | item->setText(0, MyMoneyAccount::accountTypeToString(it_m.key())); | ||
74 | item->setText(1, QString("%1").arg(*it_m)); | 79 | item->setText(1, QString::fromLatin1("%1").arg(*it_m)); | ||
75 | item->setText(2, QString("%1").arg(accountMapClosed[it_m.key()])); | 80 | item->setText(2, QString::fromLatin1("%1").arg(accountMapClosed[it_m.key()])); | ||
76 | m_accountView->invisibleRootItem()->addChild(item); | 81 | ui->m_accountView->invisibleRootItem()->addChild(item); | ||
77 | } | 82 | } | ||
78 | 83 | | |||
79 | MyMoneyTransactionFilter filter; | 84 | MyMoneyTransactionFilter filter; | ||
80 | filter.setReportAllSplits(false); | 85 | filter.setReportAllSplits(false); | ||
81 | m_transactionCount->setText(QString("%1").arg(storage->transactionList(filter).count())); | 86 | ui->m_transactionCount->setText(QString::fromLatin1("%1").arg(storage->transactionList(filter).count())); | ||
82 | filter.setReportAllSplits(true); | 87 | filter.setReportAllSplits(true); | ||
83 | m_splitCount->setText(QString("%1").arg(storage->transactionList(filter).count())); | 88 | ui->m_splitCount->setText(QString::fromLatin1("%1").arg(storage->transactionList(filter).count())); | ||
84 | m_scheduleCount->setText(QString("%1").arg(storage->scheduleList().count())); | 89 | ui->m_scheduleCount->setText(QString::fromLatin1("%1").arg(storage->scheduleList().count())); | ||
85 | MyMoneyPriceList list = storage->priceList(); | 90 | MyMoneyPriceList list = storage->priceList(); | ||
86 | MyMoneyPriceList::const_iterator it_p; | 91 | MyMoneyPriceList::const_iterator it_p; | ||
87 | int pCount = 0; | 92 | int pCount = 0; | ||
88 | for (it_p = list.constBegin(); it_p != list.constEnd(); ++it_p) | 93 | for (it_p = list.constBegin(); it_p != list.constEnd(); ++it_p) | ||
89 | pCount += (*it_p).count(); | 94 | pCount += (*it_p).count(); | ||
90 | m_priceCount->setText(QString("%1").arg(pCount)); | 95 | ui->m_priceCount->setText(QString::fromLatin1("%1").arg(pCount)); | ||
91 | } | 96 | } | ||
92 | 97 | | |||
93 | KMyMoneyFileInfoDlg::~KMyMoneyFileInfoDlg() | 98 | KMyMoneyFileInfoDlg::~KMyMoneyFileInfoDlg() | ||
94 | { | 99 | { | ||
100 | delete ui; | ||||
95 | } | 101 | } | ||
Context not available. |