r21509 - gnucash/trunk/src - [glibmm] Unify naming convention of member methods: Always use underscore naming.
Christian Stimming
cstim at code.gnucash.org
Sat Oct 29 15:39:51 EDT 2011
Author: cstim
Date: 2011-10-29 15:39:50 -0400 (Sat, 29 Oct 2011)
New Revision: 21509
Trac: http://svn.gnucash.org/trac/changeset/21509
Modified:
gnucash/trunk/src/gnc/AccountItemModel.cpp
gnucash/trunk/src/gnc/AccountItemModel.hpp
gnucash/trunk/src/gnc/AccountSelectionDelegate.cpp
gnucash/trunk/src/gnc/Cmd.cpp
gnucash/trunk/src/gnc/SplitListModel.cpp
gnucash/trunk/src/gnc/fpo/ViewletModel.cpp
gnucash/trunk/src/gnc/mainwindow.cpp
gnucash/trunk/src/optional/gtkmm/gncmm/Account.cpp
gnucash/trunk/src/optional/gtkmm/gncmm/Account.hpp
gnucash/trunk/src/optional/gtkmm/gncmm/GncInstance.cpp
gnucash/trunk/src/optional/gtkmm/gncmm/GncInstance.hpp
gnucash/trunk/src/optional/gtkmm/gncmm/Numeric.hpp
gnucash/trunk/src/optional/gtkmm/gncmm/Split.cpp
gnucash/trunk/src/optional/gtkmm/gncmm/Split.hpp
gnucash/trunk/src/optional/gtkmm/gncmm/Transaction.cpp
gnucash/trunk/src/optional/gtkmm/gncmm/Transaction.hpp
Log:
[glibmm] Unify naming convention of member methods: Always use underscore naming.
No more CamelCase in engine C++ wrappers, hopefully.
Modified: gnucash/trunk/src/gnc/AccountItemModel.cpp
===================================================================
--- gnucash/trunk/src/gnc/AccountItemModel.cpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/gnc/AccountItemModel.cpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -49,7 +49,7 @@
else
parentItem = Glib::wrap(static_cast< ::Account*>(parent.internalPointer()));
- Glib::RefPtr<Account> childItem = parentItem->nth_child(row);
+ Glib::RefPtr<Account> childItem = parentItem->get_nth_child(row);
if (childItem)
{
//qDebug() << "returning" << childItem.getName();
@@ -89,7 +89,7 @@
parentItem = Glib::wrap(static_cast< ::Account*>(parent.internalPointer()));
//qDebug() << "Returning " << parentItem.n_children();
- return parentItem->n_children();
+ return parentItem->get_num_children();
}
int AccountTreeModel::columnCount(const QModelIndex& parent) const
@@ -113,11 +113,11 @@
switch (index.column())
{
case 0:
- return g2q(account->getName());
+ return g2q(account->get_name());
case 1:
- return g2q(account->getCode());
+ return g2q(account->get_code());
case 2:
- return g2q(account->getDescription());
+ return g2q(account->get_description());
case 3:
{
Numeric balance = gnc_ui_account_get_balance(account->gobj(), false);
@@ -236,7 +236,7 @@
switch (role)
{
case Qt::DisplayRole:
- return g2q(account->getFullName());
+ return g2q(account->get_full_name());
default:
return QVariant();
}
Modified: gnucash/trunk/src/gnc/AccountItemModel.hpp
===================================================================
--- gnucash/trunk/src/gnc/AccountItemModel.hpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/gnc/AccountItemModel.hpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -69,7 +69,7 @@
typedef QList< ::Account*> AccountQList;
inline AccountQList accountFromGList(GList *glist)
{
- return fromGList<AccountQList>(glist);
+ return from_glist<AccountQList>(glist);
}
/** Specialization of the account tree model for when all accounts
Modified: gnucash/trunk/src/gnc/AccountSelectionDelegate.cpp
===================================================================
--- gnucash/trunk/src/gnc/AccountSelectionDelegate.cpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/gnc/AccountSelectionDelegate.cpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -43,7 +43,7 @@
{
Glib::RefPtr<Account> acc = Glib::wrap(value.value< ::Account*>());
if (acc)
- return g2q(acc->getFullName());
+ return g2q(acc->get_full_name());
else
return QString();
}
@@ -65,7 +65,7 @@
{
Glib::RefPtr<Account> modelAccount = smodel->getAccount();
Q_ASSERT(modelAccount);
- Glib::RefPtr<Book> book = modelAccount->getBook();
+ Glib::RefPtr<Book> book = modelAccount->get_book();
Q_ASSERT(book);
Glib::RefPtr<Account> rootaccount = book->get_root_account();
Q_ASSERT(rootaccount);
Modified: gnucash/trunk/src/gnc/Cmd.cpp
===================================================================
--- gnucash/trunk/src/gnc/Cmd.cpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/gnc/Cmd.cpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -41,51 +41,51 @@
QUndoCommand* setSplitMemo(Glib::RefPtr<Split> t, const QString& newValue)
{
return new Cmd<Split, Glib::ustring>(QObject::tr("Edit Split Memo"),
- t, &Split::setMemo,
- t->getMemo(), q2g(newValue));
+ t, &Split::set_memo,
+ t->get_memo(), q2g(newValue));
}
QUndoCommand* setSplitAction(Glib::RefPtr<Split> t, const QString& newValue)
{
return new Cmd<Split, Glib::ustring>(QObject::tr("Edit Split Action"),
- t, &Split::setAction,
- t->getAction(), q2g(newValue));
+ t, &Split::set_action,
+ t->get_action(), q2g(newValue));
}
QUndoCommand* setSplitReconcile(Glib::RefPtr<Split> t, char newValue)
{
- if (newValue == t->getReconcile())
+ if (newValue == t->get_reconcile())
return NULL;
// Special third argument: The setter function takes a value
// directly, instead of a const-reference, so the template type
// must be given explicitly.
return new Cmd<Split, char, void (Split::*)(char)>(QObject::tr("Edit Split Reconcile"),
- t, &Split::setReconcile,
- t->getReconcile(), newValue);
+ t, &Split::set_reconcile,
+ t->get_reconcile(), newValue);
}
QUndoCommand* setSplitAccount(Glib::RefPtr<Split> t, Glib::RefPtr<Account> newValue)
{
// Temporary function pointer "tmp" to resolve the ambiguous
// overload "setAccount()".
- void (Split::*tmp)(Glib::RefPtr<Account>) = &Split::setAccount;
+ void (Split::*tmp)(Glib::RefPtr<Account>) = &Split::set_account;
return new Cmd<Split, Glib::RefPtr<Account>, void (Split::*)(Glib::RefPtr<Account>)>(QObject::tr("Edit Split Account"),
t, tmp,
- t->getAccount(), newValue);
+ t->get_account(), newValue);
}
QUndoCommand* setSplitAmount(Glib::RefPtr<Split> t, const Numeric& newValue)
{
return new Cmd<Split, Numeric>(QObject::tr("Edit Split Amount"),
- t, &Split::setAmount,
- t->getAmount(), newValue);
+ t, &Split::set_amount,
+ t->get_amount(), newValue);
}
QUndoCommand* setSplitValue(Glib::RefPtr<Split> t, const Numeric& newValue)
{
return new Cmd<Split, Numeric>(QObject::tr("Edit Split Value"),
- t, &Split::setValue,
- t->getValue(), newValue);
+ t, &Split::set_value,
+ t->get_value(), newValue);
}
// ////////////////////////////////////////////////////////////
@@ -124,25 +124,25 @@
private:
void set(const value_type& value)
{
- Glib::RefPtr<Transaction> trans = m_target->getParent();
- if (!trans || trans->countSplits() != 2)
+ Glib::RefPtr<Transaction> trans = m_target->get_parent();
+ if (!trans || trans->get_num_splits() != 2)
return;
- Glib::RefPtr<Split> other = m_target->getOtherSplit();
+ Glib::RefPtr<Split> other = m_target->get_other_split();
Q_ASSERT(other);
- Glib::RefPtr<Commodity> originCommodity = m_target->getAccount()->getCommodity();
- Glib::RefPtr<Commodity> transCommodity = trans->getCurrency();
- Glib::RefPtr<Commodity> otherCommodity = other->getAccount()->getCommodity();
+ Glib::RefPtr<Commodity> originCommodity = m_target->get_account()->get_commodity();
+ Glib::RefPtr<Commodity> transCommodity = trans->get_currency();
+ Glib::RefPtr<Commodity> otherCommodity = other->get_account()->get_commodity();
if (originCommodity != transCommodity
|| transCommodity != otherCommodity)
return;
- trans->beginEdit();
- m_target->setValue(value);
- m_target->setAmount(value);
+ trans->begin_edit();
+ m_target->set_value(value);
+ m_target->set_amount(value);
Numeric valueNeg = value.neg();
- other->setAmount(valueNeg);
- other->setValue(valueNeg);
- trans->commitEdit();
+ other->set_amount(valueNeg);
+ other->set_value(valueNeg);
+ trans->commit_edit();
}
protected:
@@ -155,43 +155,43 @@
QUndoCommand* setSplitValueAndAmount(Glib::RefPtr<Split> t, const Numeric& newValue)
{
return new SplitValueAndAmountCmd(QObject::tr("Edit Transaction Value"),
- t, t->getValue(), newValue);
+ t, t->get_value(), newValue);
}
// ////////////////////////////////////////////////////////////
QUndoCommand* setTransactionNum(Glib::RefPtr<Transaction> t, const QString& newValue)
{
- if (newValue == g2q(t->getNum()))
+ if (newValue == g2q(t->get_num()))
return NULL;
return new Cmd<Transaction, Glib::ustring>(QObject::tr("Edit Transaction Number"),
- t, &Transaction::setNum,
- t->getNum(), q2g(newValue));
+ t, &Transaction::set_num,
+ t->get_num(), q2g(newValue));
}
QUndoCommand* setTransactionDescription(Glib::RefPtr<Transaction> t, const QString& newValue)
{
- if (newValue == g2q(t->getDescription()))
+ if (newValue == g2q(t->get_description()))
return NULL;
return new Cmd<Transaction, Glib::ustring>(QObject::tr("Edit Transaction Description"),
- t, &Transaction::setDescription,
- t->getDescription(), q2g(newValue));
+ t, &Transaction::set_description,
+ t->get_description(), q2g(newValue));
}
QUndoCommand* setTransactionNotes(Glib::RefPtr<Transaction> t, const QString& newValue)
{
return new Cmd<Transaction, Glib::ustring>(QObject::tr("Edit Transaction Notes"),
- t, &Transaction::setNotes,
- t->getNotes(), q2g(newValue));
+ t, &Transaction::set_notes,
+ t->get_notes(), q2g(newValue));
}
QUndoCommand* setTransactionDate(Glib::RefPtr<Transaction> t, const QDate& newValue)
{
- if (newValue == g2q(t->getDatePosted()))
+ if (newValue == g2q(t->get_date_posted()))
return NULL;
return new Cmd<Transaction, Glib::Date>(QObject::tr("Edit Transaction Date"),
- t, &Transaction::setDatePosted,
- t->getDatePosted(), q2g(newValue));
+ t, &Transaction::set_date_posted,
+ t->get_date_posted(), q2g(newValue));
}
// ////////////////////////////////////////////////////////////
@@ -210,7 +210,7 @@
: base_class(text, parent)
, m_target(targetPtr)
, m_previousValue(*targetPtr.operator->())
- , m_book(m_target->getBook())
+ , m_book(m_target->get_book())
{
Q_ASSERT(m_target);
}
@@ -223,10 +223,10 @@
virtual void undo()
{
- m_target = Glib::wrap(Transaction::newInstance(m_book));
- m_target->beginEdit();
- m_previousValue.copyTo(m_target);
- m_target->commitEdit();
+ m_target = Glib::wrap(Transaction::new_instance(m_book));
+ m_target->begin_edit();
+ m_previousValue.copy_to(m_target);
+ m_target->commit_edit();
// Could also use m_previousValue.createAsReal()
}
@@ -325,8 +325,8 @@
QUndoCommand* setSplitAccount(TmpSplit& t, Glib::RefPtr<Account> newValue)
{
return new CmdRef<TmpSplit, ::Account*, void(TmpSplit::*)(::Account*)>(QObject::tr("Edit Split Account"),
- t, &TmpSplit::setAccount,
- t.getAccount(), newValue->gobj());
+ t, &TmpSplit::set_account,
+ t.get_account(), newValue->gobj());
}
QUndoCommand* setSplitReconcile(TmpSplit& t, char newValue)
{
@@ -334,26 +334,26 @@
// directly, instead of a const-reference, so the template type
// must be given explicitly.
return new CmdRef<TmpSplit, char, void (TmpSplit::*)(char)>(QObject::tr("Edit Split Reconcile"),
- t, &TmpSplit::setReconcile,
- t.getReconcile(), newValue);
+ t, &TmpSplit::set_reconcile,
+ t.get_reconcile(), newValue);
}
QUndoCommand* setTransactionNum(TmpTransaction& t, const QString& newValue)
{
return new CmdRef<TmpTransaction, Glib::ustring>(QObject::tr("Edit Transaction Number"),
- t, &TmpTransaction::setNum,
- t.getNum(), q2g(newValue));
+ t, &TmpTransaction::set_num,
+ t.get_num(), q2g(newValue));
}
QUndoCommand* setTransactionDescription(TmpTransaction& t, const QString& newValue)
{
return new CmdRef<TmpTransaction, Glib::ustring>(QObject::tr("Edit Transaction Description"),
- t, &TmpTransaction::setDescription,
- t.getDescription(), q2g(newValue));
+ t, &TmpTransaction::set_description,
+ t.get_description(), q2g(newValue));
}
QUndoCommand* setTransactionDate(TmpTransaction& t, const QDate& newValue)
{
return new CmdRef<TmpTransaction, Glib::Date>(QObject::tr("Edit Transaction Date"),
- t, &TmpTransaction::setDatePosted,
- t.getDatePosted(), q2g(newValue));
+ t, &TmpTransaction::set_date_posted,
+ t.get_date_posted(), q2g(newValue));
}
// ////////////////////////////////////////////////////////////
@@ -378,9 +378,9 @@
, m_previousValue(previousValue)
, m_newValue(newValue)
{
- Q_ASSERT(m_target.getParent());
- Q_ASSERT(m_target.getOtherSplit());
- Q_ASSERT(m_target.getAccount());
+ Q_ASSERT(m_target.get_parent());
+ Q_ASSERT(m_target.get_other_split());
+ Q_ASSERT(m_target.get_account());
}
virtual void redo()
@@ -394,26 +394,26 @@
private:
void set(const value_type& value)
{
- Q_ASSERT(m_target.getParent());
- const TmpTransaction& trans = *m_target.getParent();
- if (trans.countSplits() != 2)
+ Q_ASSERT(m_target.get_parent());
+ const TmpTransaction& trans = *m_target.get_parent();
+ if (trans.get_num_splits() != 2)
return;
- TmpSplit* p_other = m_target.getOtherSplit();
+ TmpSplit* p_other = m_target.get_other_split();
Q_ASSERT(p_other);
TmpSplit& other = *p_other;
- Glib::RefPtr<Commodity> originCommodity = Glib::wrap(m_target.getAccount())->getCommodity();
- Glib::RefPtr<Commodity> transCommodity = trans.getCommodity();
- Q_ASSERT(other.getAccount());
- Glib::RefPtr<Commodity> otherCommodity = Glib::wrap(other.getAccount())->getCommodity();
+ Glib::RefPtr<Commodity> originCommodity = Glib::wrap(m_target.get_account())->get_commodity();
+ Glib::RefPtr<Commodity> transCommodity = trans.get_commodity();
+ Q_ASSERT(other.get_account());
+ Glib::RefPtr<Commodity> otherCommodity = Glib::wrap(other.get_account())->get_commodity();
if (originCommodity != transCommodity
|| transCommodity != otherCommodity)
return;
- m_target.setValue(value);
- m_target.setAmount(value);
+ m_target.set_value(value);
+ m_target.set_amount(value);
Numeric valueNeg = value.neg();
- other.setAmount(valueNeg);
- other.setValue(valueNeg);
+ other.set_amount(valueNeg);
+ other.set_value(valueNeg);
}
protected:
@@ -427,7 +427,7 @@
QUndoCommand* setSplitValueAndAmount(TmpSplit& t, const Numeric& newValue)
{
return new TmpSplitValueAndAmountCmd(QObject::tr("Edit Transaction Value"),
- t, t.getValue(), newValue);
+ t, t.get_value(), newValue);
}
// ////////////////////////////////////////////////////////////
@@ -451,7 +451,7 @@
virtual void redo()
{
- m_created = m_template.createAsReal();
+ m_created = m_template.create_as_real();
}
virtual void undo()
Modified: gnucash/trunk/src/gnc/SplitListModel.cpp
===================================================================
--- gnucash/trunk/src/gnc/SplitListModel.cpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/gnc/SplitListModel.cpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -57,7 +57,7 @@
void SplitListModel::recreateCache()
{
- SplitQList newSplits = Split::fromGList(m_account->getSplitList());
+ SplitQList newSplits = Split::from_glist(m_account->get_split_list());
bool doReset = (newSplits.size() != m_list.size());
m_list = newSplits;
@@ -66,7 +66,7 @@
m_hash.clear();
for (int k = 0; k < m_list.size(); ++k)
{
- m_hash.insert(Glib::wrap(m_list[k])->getParent()->gobj(), k);
+ m_hash.insert(Glib::wrap(m_list[k])->get_parent()->gobj(), k);
}
if (doReset)
@@ -75,20 +75,20 @@
void SplitListModel::recreateTmpTrans()
{
- m_tmpTransaction.resetContent();
- while (m_tmpTransaction.countSplits() > 2)
- m_tmpTransaction.getSplits().pop_back();
- Q_ASSERT(m_tmpTransaction.countSplits() == 2);
+ m_tmpTransaction.reset_content();
+ while (m_tmpTransaction.get_num_splits() > 2)
+ m_tmpTransaction.get_splits().pop_back();
+ Q_ASSERT(m_tmpTransaction.get_num_splits() == 2);
- m_tmpTransaction.setCommodity(m_account->getCommodity());
- m_tmpTransaction.setDatePosted(q2g(QDate::currentDate()));
- TmpSplit& oursplit = m_tmpTransaction.getSplits().front();
- TmpSplit& othersplit = m_tmpTransaction.getSplits().back();
- oursplit.setAccount(m_account->gobj());
+ m_tmpTransaction.set_commodity(m_account->get_commodity());
+ m_tmpTransaction.set_date_posted(q2g(QDate::currentDate()));
+ TmpSplit& oursplit = m_tmpTransaction.get_splits().front();
+ TmpSplit& othersplit = m_tmpTransaction.get_splits().back();
+ oursplit.set_account(m_account->gobj());
- Q_ASSERT(m_tmpTransaction.countSplits() == 2);
- Q_ASSERT(oursplit.getAccount() == m_account->gobj());
- Q_ASSERT(othersplit.getAccount() == NULL);
+ Q_ASSERT(m_tmpTransaction.get_num_splits() == 2);
+ Q_ASSERT(oursplit.get_account() == m_account->gobj());
+ Q_ASSERT(othersplit.get_account() == NULL);
}
SplitListModel::~SplitListModel()
@@ -121,7 +121,7 @@
{
Glib::RefPtr<Split> s = Glib::wrap(m_list.at(row));
Q_ASSERT(s);
- Glib::RefPtr<Transaction> t = s->getParent();
+ Glib::RefPtr<Transaction> t = s->get_parent();
Q_ASSERT(t);
QUndoCommand* cmd = cmd::destroyTransaction(t);
m_undoStack->push(cmd);
@@ -181,9 +181,9 @@
// Special case: We are in the last row which represents the
// newly entered txn.
- const TmpSplit& split(m_tmpTransaction.getSplits().front());
+ const TmpSplit& split(m_tmpTransaction.get_splits().front());
const TmpTransaction& trans = m_tmpTransaction;
- Numeric amount = split.getValue();
+ Numeric amount = split.get_value();
PrintAmountInfo printInfo(m_account, false);
switch (index.column())
{
@@ -192,7 +192,7 @@
{
case Qt::DisplayRole:
case Qt::EditRole:
- return g2q(trans.getDatePosted());
+ return g2q(trans.get_date_posted());
default:
return QVariant();
}
@@ -201,7 +201,7 @@
{
case Qt::DisplayRole:
case Qt::EditRole:
- return g2q(trans.getNum());
+ return g2q(trans.get_num());
default:
return QVariant();
}
@@ -210,7 +210,7 @@
{
case Qt::DisplayRole:
case Qt::EditRole:
- return g2q(trans.getDescription());
+ return g2q(trans.get_description());
default:
return QVariant();
}
@@ -219,8 +219,8 @@
{
case Qt::DisplayRole:
case Qt::EditRole:
- if (trans.countSplits() == 2)
- return QVariant::fromValue(trans.getSplits().back().getAccount());
+ if (trans.get_num_splits() == 2)
+ return QVariant::fromValue(trans.get_splits().back().get_account());
else
return QVariant(); // FIXME: Multi-split txn here
default:
@@ -231,7 +231,7 @@
{
case Qt::DisplayRole:
case Qt::EditRole:
- return QString::fromUtf8(gnc_get_reconcile_str(split.getReconcile()));
+ return QString::fromUtf8(gnc_get_reconcile_str(split.get_reconcile()));
default:
return QVariant();
}
@@ -272,8 +272,8 @@
// transaction and split
Glib::RefPtr<Split> split = Glib::wrap(static_cast< ::Split*>(index.internalPointer()));
- Glib::RefPtr<Transaction> trans(split->getParent());
- Numeric amount = split->getValue(); // Alternatively: xaccSplitConvertAmount(split.gobj(), split.getAccount().gobj());
+ Glib::RefPtr<Transaction> trans(split->get_parent());
+ Numeric amount = split->get_value(); // Alternatively: xaccSplitConvertAmount(split.gobj(), split.getAccount().gobj());
PrintAmountInfo printInfo(split, false);
switch (index.column())
@@ -283,7 +283,7 @@
{
case Qt::DisplayRole:
case Qt::EditRole:
- return g2q(trans->getDatePosted());
+ return g2q(trans->get_date_posted());
default:
return QVariant();
}
@@ -292,7 +292,7 @@
{
case Qt::DisplayRole:
case Qt::EditRole:
- return g2q(trans->getNum());
+ return g2q(trans->get_num());
default:
return QVariant();
}
@@ -301,7 +301,7 @@
{
case Qt::DisplayRole:
case Qt::EditRole:
- return g2q(trans->getDescription());
+ return g2q(trans->get_description());
default:
return QVariant();
}
@@ -310,10 +310,10 @@
{
case Qt::DisplayRole:
case Qt::EditRole:
- if (trans->countSplits() == 2)
- return QVariant::fromValue(split->getOtherSplit()->getAccount()->gobj());
+ if (trans->get_num_splits() == 2)
+ return QVariant::fromValue(split->get_other_split()->get_account()->gobj());
else
- return g2q(split->getCorrAccountFullName());
+ return g2q(split->get_corr_account_full_name());
default:
return QVariant();
}
@@ -322,7 +322,7 @@
{
case Qt::DisplayRole:
case Qt::EditRole:
- return QString::fromUtf8(gnc_get_reconcile_str(split->getReconcile()));
+ return QString::fromUtf8(gnc_get_reconcile_str(split->get_reconcile()));
default:
return QVariant();
}
@@ -354,9 +354,9 @@
switch (role)
{
case Qt::DisplayRole:
- return g2q(split->getBalance().printAmount(printInfo));
+ return g2q(split->get_balance().printAmount(printInfo));
case Qt::ForegroundRole:
- return split->getBalance().negative_p()
+ return split->get_balance().negative_p()
? QBrush(Qt::red)
: QBrush();
default:
@@ -413,10 +413,10 @@
// newly entered txn.
TmpTransaction& trans = m_tmpTransaction;
- TmpSplit& split = trans.getSplits().front();
- Q_ASSERT(split.getAccount() == m_account->gobj());
- Q_ASSERT(trans.countSplits() == 2);
- TmpSplit& other = trans.getSplits().back();
+ TmpSplit& split = trans.get_splits().front();
+ Q_ASSERT(split.get_account() == m_account->gobj());
+ Q_ASSERT(trans.get_num_splits() == 2);
+ TmpSplit& other = trans.get_splits().back();
// "Editing" is done by creating a Cmd-object and adding it to
// the undo stack. That's in fact all that was needed to
@@ -442,13 +442,13 @@
case COLUMN_ACCOUNT:
if (value.canConvert< ::Account*>())
{
- if (trans.countSplits() == 2)
+ if (trans.get_num_splits() == 2)
{
cmd = cmd::setSplitAccount(other, Glib::wrap(value.value< ::Account*>()));
}
else
QMessageBox::warning(NULL, tr("Unimplemented"),
- tr("Sorry, but editing a transaction with more than two splits (here: %1) is not yet implemented.").arg(trans.countSplits()));
+ tr("Sorry, but editing a transaction with more than two splits (here: %1) is not yet implemented.").arg(trans.get_num_splits()));
}
break;
case COLUMN_RECONCILE:
@@ -486,19 +486,19 @@
if (index.column() == COLUMN_DECREASE)
n = n.neg();
// Check whether we have the simple case here
- if (trans.countSplits() != 2)
+ if (trans.get_num_splits() != 2)
{
QMessageBox::warning(NULL, tr("Unimplemented"),
- tr("Sorry, but editing a transaction with more than two splits (here: %1) is not yet implemented.").arg(trans.countSplits()));
+ tr("Sorry, but editing a transaction with more than two splits (here: %1) is not yet implemented.").arg(trans.get_num_splits()));
}
else
{
- Glib::RefPtr<Commodity> originCommodity = m_account->getCommodity();
- Glib::RefPtr<Commodity> transCommodity = trans.getCommodity();
+ Glib::RefPtr<Commodity> originCommodity = m_account->get_commodity();
+ Glib::RefPtr<Commodity> transCommodity = trans.get_commodity();
bool sameCommodities = (originCommodity == transCommodity);
- if (other.getAccount())
+ if (other.get_account())
{
- Glib::RefPtr<Commodity> otherCommodity = Glib::wrap(other.getAccount())->getCommodity();
+ Glib::RefPtr<Commodity> otherCommodity = Glib::wrap(other.get_account())->get_commodity();
sameCommodities = sameCommodities && (transCommodity == otherCommodity);
}
if (!sameCommodities)
@@ -530,7 +530,7 @@
// transaction and split
Glib::RefPtr<Split> split = Glib::wrap(static_cast< ::Split*>(index.internalPointer()));
- Glib::RefPtr<Transaction> trans(split->getParent());
+ Glib::RefPtr<Transaction> trans(split->get_parent());
QVariant y(trans);
// "Editing" is done by creating a Cmd-object and adding it to
@@ -557,15 +557,15 @@
case COLUMN_ACCOUNT:
if (value.canConvert< ::Account*>())
{
- if (trans->countSplits() == 2)
+ if (trans->get_num_splits() == 2)
{
- Glib::RefPtr<Split> other = split->getOtherSplit();
+ Glib::RefPtr<Split> other = split->get_other_split();
cmd = cmd::setSplitAccount(other, Glib::wrap(value.value< ::Account*>()));
}
else
QMessageBox::warning(NULL, tr("Unimplemented"),
tr("Sorry, but editing a transaction with more than two splits "
- "(here: %1) is not yet implemented.").arg(trans->countSplits()));
+ "(here: %1) is not yet implemented.").arg(trans->get_num_splits()));
}
break;
case COLUMN_RECONCILE:
@@ -603,20 +603,20 @@
if (index.column() == COLUMN_DECREASE)
n = n.neg();
// Check whether we have the simple case here
- if (split->getParent()->countSplits() != 2)
+ if (split->get_parent()->get_num_splits() != 2)
{
QMessageBox::warning(NULL, tr("Unimplemented"),
tr("Sorry, but editing a transaction with more than two splits "
- "(here: %1) is not yet implemented.").arg(split->getParent()->countSplits()));
+ "(here: %1) is not yet implemented.").arg(split->get_parent()->get_num_splits()));
}
else
{
- Glib::RefPtr<Transaction> trans = split->getParent();
- Glib::RefPtr<Split> other = split->getOtherSplit();
+ Glib::RefPtr<Transaction> trans = split->get_parent();
+ Glib::RefPtr<Split> other = split->get_other_split();
Q_ASSERT(other);
- Glib::RefPtr<Commodity> originCommodity = split->getAccount()->getCommodity();
- Glib::RefPtr<Commodity> transCommodity = trans->getCurrency();
- Glib::RefPtr<Commodity> otherCommodity = other->getAccount()->getCommodity();
+ Glib::RefPtr<Commodity> originCommodity = split->get_account()->get_commodity();
+ Glib::RefPtr<Commodity> transCommodity = trans->get_currency();
+ Glib::RefPtr<Commodity> otherCommodity = other->get_account()->get_commodity();
if (originCommodity != transCommodity
|| transCommodity != otherCommodity)
{
@@ -731,7 +731,7 @@
{
// Commit the new transaction
//qDebug() << "Commit the new transaction as a real one";
- m_tmpTransaction.setDateEntered(QDateTime::currentDateTime().toTime_t());
+ m_tmpTransaction.set_date_entered(QDateTime::currentDateTime().toTime_t());
QUndoCommand* cmd = cmd::commitNewTransaction(m_tmpTransaction);
recreateTmpTrans();
m_undoStack->push(cmd);
Modified: gnucash/trunk/src/gnc/fpo/ViewletModel.cpp
===================================================================
--- gnucash/trunk/src/gnc/fpo/ViewletModel.cpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/gnc/fpo/ViewletModel.cpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -113,7 +113,7 @@
ViewletModel::buildSplitListDateSort(::Account *selectedAccount)
{
::SplitList * splitL = ::xaccAccountGetSplitList(selectedAccount);
- return Split::fromGList(splitL);
+ return Split::from_glist(splitL);
}
static bool greaterThanByDate(const ::Split* a, const ::Split* b)
@@ -134,7 +134,7 @@
{
::Account *C_acct = static_cast< ::Account *>(accountsList.at(i));
- SplitQList tempList = Split::fromGList(::xaccAccountGetSplitList(C_acct));
+ SplitQList tempList = Split::from_glist(::xaccAccountGetSplitList(C_acct));
int numOfSplits = tempList.size();
for(int i=0; i<numOfSplits; i++)
@@ -165,45 +165,45 @@
for (int i = 0; i < numOfSplits; i++)
{
Glib::RefPtr<Split> split = Glib::wrap(splitList.at(i));
- Glib::RefPtr<Transaction> txn = split->getParent();
+ Glib::RefPtr<Transaction> txn = split->get_parent();
structViewletEntries entry;
if(i == 0)
{
- tempDate = txn->getDatePosted();
+ tempDate = txn->get_date_posted();
entry.isDateEqual = false;
- tempAccount = split->getCorrAccountName();
+ tempAccount = split->get_corr_account_name();
entry.isSplitAccountEqual = false;
}
else
{
- if(txn->getDatePosted() == tempDate)
+ if(txn->get_date_posted() == tempDate)
{
entry.isDateEqual = true;
}
else
{
entry.isDateEqual = false;
- tempDate = txn->getDatePosted();
+ tempDate = txn->get_date_posted();
}
- if(split->getCorrAccountName() == tempAccount)
+ if(split->get_corr_account_name() == tempAccount)
{
entry.isSplitAccountEqual = true;
}
else
{
entry.isSplitAccountEqual = false;
- tempAccount = split->getCorrAccountName();
+ tempAccount = split->get_corr_account_name();
}
}
- entry.txnDate = g2q(txn->getDatePosted()).toString();
- entry.splitAccount = g2q(split->getCorrAccountName());
- entry.txnDescription = g2q(txn->getDescription());
+ entry.txnDate = g2q(txn->get_date_posted()).toString();
+ entry.splitAccount = g2q(split->get_corr_account_name());
+ entry.txnDescription = g2q(txn->get_description());
- Numeric splitAmount = split->getAmount();
+ Numeric splitAmount = split->get_amount();
PrintAmountInfo printInfo(split, true);
entry.splitAmount = g2q(splitAmount.printAmount(printInfo));
Modified: gnucash/trunk/src/gnc/mainwindow.cpp
===================================================================
--- gnucash/trunk/src/gnc/mainwindow.cpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/gnc/mainwindow.cpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -527,7 +527,7 @@
// Insert this as a new tab
tableView->setProperty(PROPERTY_TAB_PREVIOUSPOS, ui->tabWidget->currentIndex());
- ui->tabWidget->addTab(tableView, g2q(account->getName()));
+ ui->tabWidget->addTab(tableView, g2q(account->get_name()));
ui->tabWidget->setCurrentWidget(tableView);
connect(tableView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
Modified: gnucash/trunk/src/optional/gtkmm/gncmm/Account.cpp
===================================================================
--- gnucash/trunk/src/optional/gtkmm/gncmm/Account.cpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/optional/gtkmm/gncmm/Account.cpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -116,7 +116,7 @@
-Glib::RefPtr<Commodity> Account::getCommodity() const
+Glib::RefPtr<Commodity> Account::get_commodity() const
{
return Glib::wrap(xaccAccountGetCommodity(gobj()));
}
@@ -128,7 +128,7 @@
{
return Glib::wrap(gnc_account_get_root(gobj()));
}
-Glib::RefPtr<Account> Account::nth_child (gint num) const
+Glib::RefPtr<Account> Account::get_nth_child (gint num) const
{
return Glib::wrap(gnc_account_nth_child(gobj(), num));
}
Modified: gnucash/trunk/src/optional/gtkmm/gncmm/Account.hpp
===================================================================
--- gnucash/trunk/src/optional/gtkmm/gncmm/Account.hpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/optional/gtkmm/gncmm/Account.hpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -100,29 +100,29 @@
// actual implementation follows here
- Glib::ustring getName() const
+ Glib::ustring get_name() const
{
return (xaccAccountGetName(gobj()));
}
- Glib::ustring getFullName() const
+ Glib::ustring get_full_name() const
{
return gchar_to_ustring(gnc_account_get_full_name (gobj()));
}
- Glib::ustring getCode() const
+ Glib::ustring get_code() const
{
return (xaccAccountGetCode(gobj()));
}
- Glib::ustring getDescription() const
+ Glib::ustring get_description() const
{
return (xaccAccountGetDescription(gobj()));
}
- Glib::RefPtr<Commodity> getCommodity() const;
- int getCommoditySCU() const
+ Glib::RefPtr<Commodity> get_commodity() const;
+ int get_commodity_scu() const
{
return xaccAccountGetCommoditySCU(gobj());
}
- ::SplitList* getSplitList() const
+ ::SplitList* get_split_list() const
{
return xaccAccountGetSplitList(gobj());
}
@@ -136,7 +136,7 @@
{
return gnc_account_is_root(gobj());
}
- gint n_children() const
+ gint get_num_children() const
{
return gnc_account_n_children(gobj());
}
@@ -148,7 +148,7 @@
{
return gnc_account_get_descendants (gobj());
}
- Glib::RefPtr<Account> nth_child (gint num) const;
+ Glib::RefPtr<Account> get_nth_child (gint num) const;
/** Return the index of this account in the children's list of its
Modified: gnucash/trunk/src/optional/gtkmm/gncmm/GncInstance.cpp
===================================================================
--- gnucash/trunk/src/optional/gtkmm/gncmm/GncInstance.cpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/optional/gtkmm/gncmm/GncInstance.cpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -116,7 +116,7 @@
// ////////////////////////////////////////
-Glib::RefPtr<Book> GncInstance::getBook() const
+Glib::RefPtr<Book> GncInstance::get_book() const
{
return Glib::wrap(qof_instance_get_book (gobj()));
}
Modified: gnucash/trunk/src/optional/gtkmm/gncmm/GncInstance.hpp
===================================================================
--- gnucash/trunk/src/optional/gtkmm/gncmm/GncInstance.hpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/optional/gtkmm/gncmm/GncInstance.hpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -97,9 +97,9 @@
public:
- Glib::RefPtr<Book> getBook() const;
+ Glib::RefPtr<Book> get_book() const;
void set_book(Glib::RefPtr<Book> book);
- const ::GncGUID* getGUID() const
+ const ::GncGUID* get_guid() const
{
return qof_entity_get_guid(gobj_const());
}
Modified: gnucash/trunk/src/optional/gtkmm/gncmm/Numeric.hpp
===================================================================
--- gnucash/trunk/src/optional/gtkmm/gncmm/Numeric.hpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/optional/gtkmm/gncmm/Numeric.hpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -66,13 +66,13 @@
#if GLIB_HAVE_DATETIME
// Glib::DateTime is new in glibmm-2.29 but very useful
-inline Glib::DateTime toGDateTime(const ::Timespec& timespec)
+inline Glib::DateTime to_gdatetime(const ::Timespec& timespec)
{
Glib::DateTime result = Glib::DateTime::create_now_utc(timespec.tv_sec);
result.add_seconds(timespec.tv_nsec * 1e-9);
return result;
}
-inline ::Timespec toTimespec(const Glib::DateTime& gdt)
+inline ::Timespec to_timespec(const Glib::DateTime& gdt)
{
::Timespec result;
result.tv_sec = qdt.to_unix;
@@ -84,7 +84,7 @@
/** Copies the pointer values from the given GList into the specified output
* list type, such as std::vector<FooBar*>. */
template<class ResultListType>
-ResultListType fromGList(GList* glist)
+ResultListType from_glist(GList* glist)
{
ResultListType result;
GList* list = glist;
Modified: gnucash/trunk/src/optional/gtkmm/gncmm/Split.cpp
===================================================================
--- gnucash/trunk/src/optional/gtkmm/gncmm/Split.cpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/optional/gtkmm/gncmm/Split.cpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -116,47 +116,47 @@
-Glib::RefPtr<Account> Split::getAccount() const
+Glib::RefPtr<Account> Split::get_account() const
{
return Glib::wrap(xaccSplitGetAccount(gobj()));
}
-void Split::setAccount(Glib::RefPtr<Account> acc)
+void Split::set_account(Glib::RefPtr<Account> acc)
{
if (acc) xaccSplitSetAccount(gobj(), acc->gobj());
}
-void Split::setAccount(::Account* acc)
+void Split::set_account(::Account* acc)
{
xaccSplitSetAccount(gobj(), acc);
}
-Glib::RefPtr<Transaction> Split::getParent() const
+Glib::RefPtr<Transaction> Split::get_parent() const
{
return Glib::wrap(xaccSplitGetParent(gobj()));
}
-void Split::setParent(Glib::RefPtr<Transaction> trans)
+void Split::set_parent(Glib::RefPtr<Transaction> trans)
{
if (trans) xaccSplitSetParent(gobj(), trans->gobj());
}
-void Split::setParent(Transaction& trans)
+void Split::set_parent(Transaction& trans)
{
xaccSplitSetParent(gobj(), trans.gobj());
}
-Glib::RefPtr<Split> Split::getOtherSplit() const
+Glib::RefPtr<Split> Split::get_other_split() const
{
return Glib::wrap(xaccSplitGetOtherSplit(gobj()));
}
TmpSplit::TmpSplit(const Glib::RefPtr<Split>& s, const TmpTransaction* parent_trans)
- : m_account(s->getAccount()->gobj())
+ : m_account(s->get_account()->gobj())
, m_parent(parent_trans)
- , m_memo(s->getMemo())
- , m_action(s->getAction())
- , m_reconcile(s->getReconcile())
- , m_amount(s->getAmount())
- , m_value(s->getValue())
+ , m_memo(s->get_memo())
+ , m_action(s->get_action())
+ , m_reconcile(s->get_reconcile())
+ , m_amount(s->get_amount())
+ , m_value(s->get_value())
{}
TmpSplit::TmpSplit(::Account* account)
@@ -164,15 +164,15 @@
clear(account);
}
-TmpSplit* TmpSplit::getOtherSplit() const
+TmpSplit* TmpSplit::get_other_split() const
{
if (!m_parent)
return NULL;
const TmpTransaction& p = *m_parent;
- if (p.countSplits() != 2)
+ if (p.get_num_splits() != 2)
return NULL;
- TmpTransaction::TmpSplitList& splits = const_cast<TmpTransaction&>(p).getSplits();
- if (splits.front().getAccount() != m_account)
+ TmpTransaction::TmpSplitList& splits = const_cast<TmpTransaction&>(p).get_splits();
+ if (splits.front().get_account() != m_account)
return &splits.front();
else
return &splits.back();
@@ -189,17 +189,17 @@
m_value = Numeric::zero();
}
-void TmpSplit::copyInto(Glib::RefPtr<Transaction> t) const
+void TmpSplit::copy_into(Glib::RefPtr<Transaction> t) const
{
g_assert(t);
- Glib::RefPtr<Split> s(Glib::wrap(xaccMallocSplit(t->getBook()->gobj())));
- s->setAccount(m_account);
- s->setParent(t);
- s->setMemo(m_memo);
- s->setAction(m_action);
- s->setReconcile(m_reconcile);
- s->setAmount(m_amount);
- s->setValue(m_value);
+ Glib::RefPtr<Split> s(Glib::wrap(xaccMallocSplit(t->get_book()->gobj())));
+ s->set_account(m_account);
+ s->set_parent(t);
+ s->set_memo(m_memo);
+ s->set_action(m_action);
+ s->set_reconcile(m_reconcile);
+ s->set_amount(m_amount);
+ s->set_value(m_value);
}
} // END namespace gnc
Modified: gnucash/trunk/src/optional/gtkmm/gncmm/Split.hpp
===================================================================
--- gnucash/trunk/src/optional/gtkmm/gncmm/Split.hpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/optional/gtkmm/gncmm/Split.hpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -105,93 +105,93 @@
public:
- Glib::RefPtr<Account> getAccount() const;
- void setAccount(Glib::RefPtr<Account> acc);
- void setAccount(::Account* acc);
+ Glib::RefPtr<Account> get_account() const;
+ void set_account(Glib::RefPtr<Account> acc);
+ void set_account(::Account* acc);
- Glib::RefPtr<Transaction> getParent() const;
- void setParent(Glib::RefPtr<Transaction> trans);
- void setParent(Transaction& trans);
+ Glib::RefPtr<Transaction> get_parent() const;
+ void set_parent(Glib::RefPtr<Transaction> trans);
+ void set_parent(Transaction& trans);
- Glib::ustring getMemo() const
+ Glib::ustring get_memo() const
{
return xaccSplitGetMemo(gobj());
}
- void setMemo(const Glib::ustring& v)
+ void set_memo(const Glib::ustring& v)
{
xaccSplitSetMemo(gobj(), v.c_str());
}
- Glib::ustring getAction() const
+ Glib::ustring get_action() const
{
return xaccSplitGetAction(gobj());
}
- void setAction(const Glib::ustring& v)
+ void set_action(const Glib::ustring& v)
{
xaccSplitSetAction(gobj(), v.c_str());
}
- char getReconcile() const
+ char get_reconcile() const
{
return xaccSplitGetReconcile(gobj());
}
- void setReconcile(char v)
+ void set_reconcile(char v)
{
xaccSplitSetReconcile(gobj(), v);
}
- Glib::RefPtr<Split> getOtherSplit() const;
+ Glib::RefPtr<Split> get_other_split() const;
- Glib::ustring getCorrAccountFullName() const
+ Glib::ustring get_corr_account_full_name() const
{
return gchar_to_ustring(xaccSplitGetCorrAccountFullName(gobj()));
}
- Glib::ustring getCorrAccountName() const
+ Glib::ustring get_corr_account_name() const
{
return xaccSplitGetCorrAccountName(gobj());
}
- Glib::ustring getCorrAccountCode() const
+ Glib::ustring get_corr_account_code() const
{
return xaccSplitGetCorrAccountCode(gobj());
}
- void setAmount(const Numeric& amount)
+ void set_amount(const Numeric& amount)
{
xaccSplitSetAmount(gobj(), amount);
}
- Numeric getAmount() const
+ Numeric get_amount() const
{
return xaccSplitGetAmount(gobj());
}
- void setValue(const Numeric& value)
+ void set_value(const Numeric& value)
{
xaccSplitSetValue(gobj(), value);
}
- Numeric getValue() const
+ Numeric get_value() const
{
return xaccSplitGetValue(gobj());
}
- Numeric getSharePrice() const
+ Numeric get_share_price() const
{
return xaccSplitGetSharePrice(gobj());
}
- Numeric getBalance() const
+ Numeric get_balance() const
{
return xaccSplitGetBalance(gobj());
}
- Numeric getClearedBalance() const
+ Numeric get_cleared_balance() const
{
return xaccSplitGetClearedBalance(gobj());
}
- Numeric getReconciledBalance() const
+ Numeric get_reconciled_balance() const
{
return xaccSplitGetReconciledBalance(gobj());
}
- static SplitQList fromGList(GList* glist)
+ static SplitQList from_glist(GList* glist)
{
- return gnc::fromGList<SplitQList>(glist);
+ return gnc::from_glist<SplitQList>(glist);
}
};
@@ -223,71 +223,71 @@
/** Copies the content of this tmp split into the given real
* transaction by allocating a new real gnc::Split and adding it
* to the given real gnc::Transaction. */
- void copyInto(Glib::RefPtr<Transaction> t) const;
+ void copy_into(Glib::RefPtr<Transaction> t) const;
- ::Account* getAccount() const
+ ::Account* get_account() const
{
return m_account;
}
- void setAccount(::Account* v)
+ void set_account(::Account* v)
{
m_account = v;
}
- const TmpTransaction* getParent() const
+ const TmpTransaction* get_parent() const
{
return m_parent;
}
- void setParent(const TmpTransaction* v)
+ void set_parent(const TmpTransaction* v)
{
m_parent = v;
}
/** Returns a pointer to the "Other" split if it exists, or NULL
* if none or multiple of them exist. */
- TmpSplit* getOtherSplit() const;
+ TmpSplit* get_other_split() const;
- Glib::ustring getMemo() const
+ Glib::ustring get_memo() const
{
return m_memo;
}
- void setMemo(const Glib::ustring& v)
+ void set_memo(const Glib::ustring& v)
{
m_memo = v;
}
- Glib::ustring getAction() const
+ Glib::ustring get_action() const
{
return m_action;
}
- void setAction(const Glib::ustring& v)
+ void set_action(const Glib::ustring& v)
{
m_action = v;
}
- char getReconcile() const
+ char get_reconcile() const
{
return m_reconcile;
}
- void setReconcile(char v)
+ void set_reconcile(char v)
{
m_reconcile = v;
}
- Numeric getAmount() const
+ Numeric get_amount() const
{
return m_amount;
}
- void setAmount(const Numeric& v)
+ void set_amount(const Numeric& v)
{
m_amount = v;
}
- Numeric getValue() const
+ Numeric get_value() const
{
return m_value;
}
- void setValue(const Numeric& v)
+ void set_value(const Numeric& v)
{
m_value = v;
}
Modified: gnucash/trunk/src/optional/gtkmm/gncmm/Transaction.cpp
===================================================================
--- gnucash/trunk/src/optional/gtkmm/gncmm/Transaction.cpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/optional/gtkmm/gncmm/Transaction.cpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -118,24 +118,24 @@
-Glib::RefPtr<Split> Transaction::findSplitByAccount(const Account& acc) const
+Glib::RefPtr<Split> Transaction::find_split_by_account(const Account& acc) const
{
return Glib::wrap(xaccTransFindSplitByAccount(gobj(), acc.gobj()));
}
-Glib::RefPtr<Split> Transaction::getSplit(int i) const
+Glib::RefPtr<Split> Transaction::get_split(int i) const
{
return Glib::wrap(xaccTransGetSplit(gobj(), i));
}
-void Transaction::appendSplit(Glib::RefPtr<Split> split)
+void Transaction::append_split(Glib::RefPtr<Split> split)
{
g_assert(split);
xaccSplitSetParent(split->gobj(), gobj());
}
-int Transaction::getSplitIndex(const Split& split) const
+int Transaction::get_split_index(const Split& split) const
{
return xaccTransGetSplitIndex(gobj(), split.gobj());
}
-::Transaction* Transaction::newInstance(const Glib::RefPtr<Book> b)
+::Transaction* Transaction::new_instance(const Glib::RefPtr<Book> b)
{
if (b)
return xaccMallocTransaction (const_cast< ::QofBook*>(b->gobj()));
@@ -150,14 +150,14 @@
clear();
}
TmpTransaction::TmpTransaction(const Transaction& t)
- : m_num(t.getNum())
- , m_description(t.getDescription())
- , m_notes(t.getNotes())
- , m_commodity(t.getCurrency())
- , m_datePosted(t.getDatePosted())
- , m_dateTimeEntered(t.getDateEnteredTT())
+ : m_num(t.get_num())
+ , m_description(t.get_description())
+ , m_notes(t.get_notes())
+ , m_commodity(t.get_currency())
+ , m_datePosted(t.get_date_posted())
+ , m_dateTimeEntered(t.get_date_entered_tt())
{
- SplitQList slist = Split::fromGList(t.getSplitList());
+ SplitQList slist = Split::from_glist(t.get_split_list());
for (SplitQList::const_iterator iter = slist.begin(); iter != slist.end(); ++iter)
{
m_splits.push_back(TmpSplit(Glib::wrap(*iter), this));
@@ -167,10 +167,10 @@
void TmpTransaction::clear()
{
m_splits.clear();
- resetContent();
+ reset_content();
}
-void TmpTransaction::resetContent()
+void TmpTransaction::reset_content()
{
m_num.clear();
m_description.clear();
@@ -182,44 +182,44 @@
{
TmpSplit& split = m_splits[i];
split.clear();
- split.setParent(this);
+ split.set_parent(this);
}
}
-void TmpTransaction::copyTo(Glib::RefPtr<Transaction> t) const
+void TmpTransaction::copy_to(Glib::RefPtr<Transaction> t) const
{
assert(t);
- t->setNum(m_num);
- t->setDescription(m_description);
+ t->set_num(m_num);
+ t->set_description(m_description);
if (!m_notes.empty())
- t->setNotes(m_notes);
- t->setCurrency(m_commodity);
- t->setDatePosted(m_datePosted);
- t->setDateEntered(m_dateTimeEntered);
+ t->set_notes(m_notes);
+ t->set_currency(m_commodity);
+ t->set_date_posted(m_datePosted);
+ t->set_date_entered(m_dateTimeEntered);
for (int i = 0; i < m_splits.size(); ++i)
{
- m_splits[i].copyInto(t);
+ m_splits[i].copy_into(t);
}
}
-Glib::RefPtr<Transaction> TmpTransaction::createAsReal() const
+Glib::RefPtr<Transaction> TmpTransaction::create_as_real() const
{
assert (!m_splits.empty());
- Glib::RefPtr<Account> acc(Glib::wrap(m_splits.front().getAccount()));
+ Glib::RefPtr<Account> acc(Glib::wrap(m_splits.front().get_account()));
assert (acc);
- Glib::RefPtr<Book> book(acc->getBook());
+ Glib::RefPtr<Book> book(acc->get_book());
assert (book);
- Glib::RefPtr<Transaction> trans(Glib::wrap(Transaction::newInstance(book)));
- trans->beginEdit();
- copyTo(trans);
- trans->commitEdit();
+ Glib::RefPtr<Transaction> trans(Glib::wrap(Transaction::new_instance(book)));
+ trans->begin_edit();
+ copy_to(trans);
+ trans->commit_edit();
return trans;
}
void TmpTransaction::push_back(const TmpSplit& s)
{
m_splits.push_back(s);
- m_splits.back().setParent(this);
+ m_splits.back().set_parent(this);
}
} // END namespace gnc
Modified: gnucash/trunk/src/optional/gtkmm/gncmm/Transaction.hpp
===================================================================
--- gnucash/trunk/src/optional/gtkmm/gncmm/Transaction.hpp 2011-10-29 07:45:34 UTC (rev 21508)
+++ gnucash/trunk/src/optional/gtkmm/gncmm/Transaction.hpp 2011-10-29 19:39:50 UTC (rev 21509)
@@ -105,106 +105,106 @@
private:
public:
- void beginEdit()
+ void begin_edit()
{
xaccTransBeginEdit(gobj());
}
- void commitEdit()
+ void commit_edit()
{
xaccTransCommitEdit(gobj());
}
- void rollbackEdit()
+ void rollback_edit()
{
xaccTransRollbackEdit(gobj());
}
- bool isOpen() const
+ bool is_open() const
{
return xaccTransIsOpen(gobj());
}
- Glib::ustring getNum() const
+ Glib::ustring get_num() const
{
return xaccTransGetNum(gobj());
}
- void setNum(const Glib::ustring& v)
+ void set_num(const Glib::ustring& v)
{
xaccTransSetNum(gobj(), v.c_str());
}
- Glib::ustring getDescription() const
+ Glib::ustring get_description() const
{
return xaccTransGetDescription(gobj());
}
- void setDescription(const Glib::ustring& v)
+ void set_description(const Glib::ustring& v)
{
xaccTransSetDescription(gobj(), v.c_str());
}
- Glib::ustring getNotes() const
+ Glib::ustring get_notes() const
{
return xaccTransGetNotes(gobj());
}
- void setNotes(const Glib::ustring& v)
+ void set_notes(const Glib::ustring& v)
{
xaccTransSetNotes(gobj(), v.c_str());
}
- int countSplits() const
+ int get_num_splits() const
{
return xaccTransCountSplits(gobj());
}
- Glib::RefPtr<Split> findSplitByAccount(const Account& acc) const;
- void appendSplit(Glib::RefPtr<Split> split);
- Glib::RefPtr<Split> getSplit(int i) const;
- int getSplitIndex(const Split& split) const;
- ::SplitList* getSplitList() const
+ Glib::RefPtr<Split> find_split_by_account(const Account& acc) const;
+ void append_split(Glib::RefPtr<Split> split);
+ Glib::RefPtr<Split> get_split(int i) const;
+ int get_split_index(const Split& split) const;
+ ::SplitList* get_split_list() const
{
return xaccTransGetSplitList(gobj());
}
- Glib::RefPtr<Commodity> getCurrency() const
+ Glib::RefPtr<Commodity> get_currency() const
{
return Glib::wrap(xaccTransGetCurrency(gobj()));
}
- void setCurrency(const Glib::RefPtr<Commodity>& c)
+ void set_currency(const Glib::RefPtr<Commodity>& c)
{
if (c) xaccTransSetCurrency(gobj(), c->gobj());
}
- Numeric getImbalanceValue() const
+ Numeric get_imbalance_value() const
{
return xaccTransGetImbalanceValue(gobj());
}
- bool isBalanced() const
+ bool is_balanced() const
{
return xaccTransIsBalanced(gobj());
}
- Numeric getAccountConvRate(const Account& acc) const
+ Numeric get_account_conv_rate(const Account& acc) const
{
return xaccTransGetAccountConvRate(gobj(), acc.gobj());
}
- void setDatePosted(const Glib::Date& d)
+ void set_date_posted(const Glib::Date& d)
{
xaccTransSetDatePostedGDate(gobj(), *d.gobj());
}
- Glib::Date getDatePosted() const
+ Glib::Date get_date_posted() const
{
return Glib::Date(xaccTransGetDatePostedGDate(gobj()));
}
- void setDateEntered(time_t t)
+ void set_date_entered(time_t t)
{
xaccTransSetDateEnteredSecs(gobj(), t);
}
-// void setDateEntered(const Glib::DateTime& t) { xaccTransSetDateEnteredSecs(gobj(), t.toTime_t()); }
- time_t getDateEnteredTT() const
+// void set_date_entered(const Glib::DateTime& t) { xaccTransSetDateEnteredSecs(gobj(), t.toTime_t()); }
+ time_t get_date_entered_tt() const
{
return timespecToTime_t(xaccTransRetDateEnteredTS(gobj()));
}
- //Glib::DateTime getDateEntered() const { return toGDateTime(xaccTransRetDateEnteredTS(gobj())); }
+ //Glib::DateTime get_date_entered() const { return toGDateTime(xaccTransRetDateEnteredTS(gobj())); }
- static ::Transaction* newInstance(const Glib::RefPtr<Book> b);
+ static ::Transaction* new_instance(const Glib::RefPtr<Book> b);
};
@@ -233,78 +233,78 @@
/** Clears all data fields, but does not delete the splits and
* instead only resets the data fields of all splits */
- void resetContent();
+ void reset_content();
/** Copies the content of this tmp transaction into the given real
* transaction. */
- void copyTo(Glib::RefPtr<Transaction> t) const;
+ void copy_to(Glib::RefPtr<Transaction> t) const;
/** Allocates a new real transaction in the Book and Account as
* stored in the tmp transaction, copies the content of this tmp
* transaction into the newly allocated one, and returns the
* pointer to the newly created real transaction. */
- Glib::RefPtr<Transaction> createAsReal() const;
+ Glib::RefPtr<Transaction> create_as_real() const;
- Glib::ustring getNum() const
+ Glib::ustring get_num() const
{
return m_num;
}
- void setNum(const Glib::ustring& v)
+ void set_num(const Glib::ustring& v)
{
m_num = v;
}
- Glib::ustring getDescription() const
+ Glib::ustring get_description() const
{
return m_description;
}
- void setDescription(const Glib::ustring& v)
+ void set_description(const Glib::ustring& v)
{
m_description = v;
}
void push_back(const TmpSplit& s);
- const TmpSplitList& getSplits() const
+ const TmpSplitList& get_splits() const
{
return m_splits;
}
- TmpSplitList& getSplits()
+ TmpSplitList& get_splits()
{
return m_splits;
}
- int countSplits() const
+ int get_num_splits() const
{
return m_splits.size();
}
- Glib::RefPtr<Commodity> getCommodity() const
+ Glib::RefPtr<Commodity> get_commodity() const
{
return m_commodity;
}
- void setCommodity(const Glib::RefPtr<Commodity>& v)
+ void set_commodity(const Glib::RefPtr<Commodity>& v)
{
m_commodity = v;
}
- Glib::Date getDatePosted() const
+ Glib::Date get_date_posted() const
{
return m_datePosted;
}
- void setDatePosted(const Glib::Date& v)
+ void set_date_posted(const Glib::Date& v)
{
m_datePosted = v;
}
- time_t getDateEnteredTT() const
+ time_t get_date_entered_tt() const
{
return m_dateTimeEntered;
}
- void setDateEntered(time_t v)
+ void set_date_entered(time_t v)
{
m_dateTimeEntered = v;
}
- //Glib::DateTime getDateEntered() const { return m_dateTimeEntered; }
- //void setDateEntered(const Glib::DateTime& v) { m_dateTimeEntered = v; }
+ //Glib::DateTime get_date_entered() const { return m_dateTimeEntered; }
+ //void set_date_entered(const Glib::DateTime& v) { m_dateTimeEntered = v; }
private:
Glib::ustring m_num;
More information about the gnucash-changes
mailing list