[Cutecash] Rename get() member to gobj() to increase compatibility to future gtkmm wrappers.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21481 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2011-10-22 20:10:08 +00:00
parent d71ac128a3
commit 3c31952bc7
20 changed files with 143 additions and 143 deletions

View File

@ -59,25 +59,25 @@ public:
Account(element_type* ptr = 0) Account(element_type* ptr = 0)
: base_class(ptr) : base_class(ptr)
{ } { }
QString getName() const { return QString::fromUtf8(xaccAccountGetName(get())); } QString getName() const { return QString::fromUtf8(xaccAccountGetName(gobj())); }
QString getFullName() const { return gchar_to_QString(gnc_account_get_full_name (get())); } QString getFullName() const { return gchar_to_QString(gnc_account_get_full_name (gobj())); }
QString getCode() const { return QString::fromUtf8(xaccAccountGetCode(get())); } QString getCode() const { return QString::fromUtf8(xaccAccountGetCode(gobj())); }
QString getDescription() const { return QString::fromUtf8(xaccAccountGetDescription(get())); } QString getDescription() const { return QString::fromUtf8(xaccAccountGetDescription(gobj())); }
Commodity getCommodity() const { return xaccAccountGetCommodity(get()); } Commodity getCommodity() const { return xaccAccountGetCommodity(gobj()); }
int getCommoditySCU() const { return xaccAccountGetCommoditySCU(get()); } int getCommoditySCU() const { return xaccAccountGetCommoditySCU(gobj()); }
::SplitList* getSplitList() const { return xaccAccountGetSplitList(get()); } ::SplitList* getSplitList() const { return xaccAccountGetSplitList(gobj()); }
/** @name Account tree traversal */ /** @name Account tree traversal */
//@{ //@{
Account get_parent() const { return gnc_account_get_parent(get()); } Account get_parent() const { return gnc_account_get_parent(gobj()); }
Account get_root() { return gnc_account_get_root(get()); } Account get_root() { return gnc_account_get_root(gobj()); }
bool is_root() const { return gnc_account_is_root(get()); } bool is_root() const { return gnc_account_is_root(gobj()); }
gint n_children() const { return gnc_account_n_children(get()); } gint n_children() const { return gnc_account_n_children(gobj()); }
GList *get_children() const { return gnc_account_get_children(get()); } GList *get_children() const { return gnc_account_get_children(gobj()); }
GList *get_descendants () const { return gnc_account_get_descendants (get()); } GList *get_descendants () const { return gnc_account_get_descendants (gobj()); }
Account nth_child (gint num) const { return gnc_account_nth_child(get(), num); } Account nth_child (gint num) const { return gnc_account_nth_child(gobj(), num); }
/** Return the index of this account in the children's list of its /** Return the index of this account in the children's list of its
@ -86,14 +86,14 @@ public:
gint child_index () const gint child_index () const
{ {
Account parent(get_parent()); Account parent(get_parent());
if (parent.get()) if (parent.gobj())
return gnc_account_child_index(parent.get(), get()); return gnc_account_child_index(parent.gobj(), gobj());
else else
return 0; return 0;
} }
gint get_current_depth () const { return gnc_account_get_current_depth(get()); } gint get_current_depth () const { return gnc_account_get_current_depth(gobj()); }
gint get_tree_depth () const { return gnc_account_get_tree_depth(get()); } gint get_tree_depth () const { return gnc_account_get_tree_depth(gobj()); }
//@} //@}

View File

@ -50,10 +50,10 @@ QModelIndex AccountTreeModel::index(int row, int column,
parentItem.reset(static_cast< ::Account*>(parent.internalPointer())); parentItem.reset(static_cast< ::Account*>(parent.internalPointer()));
Account childItem = parentItem.nth_child(row); Account childItem = parentItem.nth_child(row);
if (childItem.get()) if (childItem.gobj())
{ {
//qDebug() << "returning" << childItem.getName(); //qDebug() << "returning" << childItem.getName();
return createIndex(row, column, childItem.get()); return createIndex(row, column, childItem.gobj());
} }
else else
return QModelIndex(); return QModelIndex();
@ -68,10 +68,10 @@ QModelIndex AccountTreeModel::parent(const QModelIndex &index) const
Account childItem(static_cast< ::Account*>(index.internalPointer())); Account childItem(static_cast< ::Account*>(index.internalPointer()));
Account parentItem(childItem.get_parent()); Account parentItem(childItem.get_parent());
if (parentItem.get() == m_root.get()) if (parentItem.gobj() == m_root.gobj())
return QModelIndex(); return QModelIndex();
return createIndex(parentItem.child_index(), 0, parentItem.get()); return createIndex(parentItem.child_index(), 0, parentItem.gobj());
} }
int AccountTreeModel::rowCount(const QModelIndex& parent) const int AccountTreeModel::rowCount(const QModelIndex& parent) const
@ -120,8 +120,8 @@ QVariant AccountTreeModel::data(const QModelIndex& index, int role) const
return account.getDescription(); return account.getDescription();
case 3: case 3:
{ {
Numeric balance = gnc_ui_account_get_balance(account.get(), false); Numeric balance = gnc_ui_account_get_balance(account.gobj(), false);
PrintAmountInfo printInfo(account.get(), true); PrintAmountInfo printInfo(account.gobj(), true);
return balance.printAmount(printInfo); return balance.printAmount(printInfo);
} }
default: default:
@ -207,10 +207,10 @@ QModelIndex AccountListModel::index(int row, int column,
return QModelIndex(); return QModelIndex();
Account childItem = m_list.at(row); Account childItem = m_list.at(row);
if (childItem.get()) if (childItem.gobj())
{ {
//qDebug() << "returning" << childItem.getName(); //qDebug() << "returning" << childItem.getName();
return createIndex(row, column, childItem.get()); return createIndex(row, column, childItem.gobj());
} }
else else
return QModelIndex(); return QModelIndex();

View File

@ -88,7 +88,7 @@ void AccountSelectionDelegate::setEditorData(QWidget *editor, const QModelIndex
{ {
const AccountListModel* amodel = dynamic_cast<const AccountListModel*>(comboBox->model()); const AccountListModel* amodel = dynamic_cast<const AccountListModel*>(comboBox->model());
Q_ASSERT(amodel); Q_ASSERT(amodel);
comboBox->setCurrentIndex(amodel->indexOf(acc.get())); comboBox->setCurrentIndex(amodel->indexOf(acc.gobj()));
} }
} }
else else

View File

@ -28,7 +28,7 @@ namespace gnc
{ {
Account Book::get_root_account() Account Book::get_root_account()
{ {
return Account(gnc_book_get_root_account (get())); return Account(gnc_book_get_root_account (gobj()));
} }
} // END namespace gnc } // END namespace gnc

View File

@ -105,7 +105,7 @@ public:
const value_type& newValue, const value_type& newValue,
QUndoCommand *parent = 0) QUndoCommand *parent = 0)
: base_class(text, parent) : base_class(text, parent)
, m_target(targetPtr.get()) , m_target(targetPtr.gobj())
, m_previousValue(previousValue) , m_previousValue(previousValue)
, m_newValue(newValue) , m_newValue(newValue)
{ {
@ -201,7 +201,7 @@ public:
WeakPointer<target_type::element_type>& targetPtr, WeakPointer<target_type::element_type>& targetPtr,
QUndoCommand *parent = 0) QUndoCommand *parent = 0)
: base_class(text, parent) : base_class(text, parent)
, m_target(targetPtr.get()) , m_target(targetPtr.gobj())
, m_previousValue(m_target) , m_previousValue(m_target)
, m_book(m_target.getBook()) , m_book(m_target.getBook())
{ {
@ -210,7 +210,7 @@ public:
virtual void redo() virtual void redo()
{ {
xaccTransDestroy(m_target.get()); xaccTransDestroy(m_target.gobj());
m_target.reset(); m_target.reset();
} }
@ -313,7 +313,7 @@ QUndoCommand* setSplitAccount(TmpSplit& t, Account newValue)
{ {
return new CmdRef<TmpSplit, ::Account*, void(TmpSplit::*)(::Account*)>(QObject::tr("Edit Split Account"), return new CmdRef<TmpSplit, ::Account*, void(TmpSplit::*)(::Account*)>(QObject::tr("Edit Split Account"),
t, &TmpSplit::setAccount, t, &TmpSplit::setAccount,
t.getAccount(), newValue.get()); t.getAccount(), newValue.gobj());
} }
QUndoCommand* setSplitReconcile(TmpSplit& t, char newValue) QUndoCommand* setSplitReconcile(TmpSplit& t, char newValue)
{ {
@ -437,7 +437,7 @@ public:
virtual void undo() virtual void undo()
{ {
xaccTransDestroy(m_created.get()); xaccTransDestroy(m_created.gobj());
m_created.reset(); m_created.reset();
} }

View File

@ -88,7 +88,7 @@ public:
const value_type& newValue, const value_type& newValue,
QUndoCommand *parent = 0) QUndoCommand *parent = 0)
: base_class(text, parent) : base_class(text, parent)
, m_target(targetPtr.get()) , m_target(targetPtr.gobj())
, m_setter(setter) , m_setter(setter)
, m_previousValue((m_target.*getter)()) , m_previousValue((m_target.*getter)())
, m_newValue(newValue) , m_newValue(newValue)
@ -114,7 +114,7 @@ public:
const value_type& newValue, const value_type& newValue,
QUndoCommand *parent = 0) QUndoCommand *parent = 0)
: base_class(text, parent) : base_class(text, parent)
, m_target(targetPtr.get()) , m_target(targetPtr.gobj())
, m_setter(setter) , m_setter(setter)
, m_previousValue(previousValue) , m_previousValue(previousValue)
, m_newValue(newValue) , m_newValue(newValue)

View File

@ -46,17 +46,17 @@ public:
Commodity(element_type *ptr = 0) Commodity(element_type *ptr = 0)
: base_class(ptr) : base_class(ptr)
{} {}
QString get_mnemonic() const { return gnc_commodity_get_mnemonic(get()); } QString get_mnemonic() const { return gnc_commodity_get_mnemonic(gobj()); }
QString get_namespace() const { return gnc_commodity_get_namespace(get()); } QString get_namespace() const { return gnc_commodity_get_namespace(gobj()); }
QString get_fullname() const { return gnc_commodity_get_fullname(get()); } QString get_fullname() const { return gnc_commodity_get_fullname(gobj()); }
QString get_printname() const { return gnc_commodity_get_printname(get()); } QString get_printname() const { return gnc_commodity_get_printname(gobj()); }
int get_fraction() const { return gnc_commodity_get_fraction(get()); } int get_fraction() const { return gnc_commodity_get_fraction(gobj()); }
bool get_quote_flag() const { return gnc_commodity_get_quote_flag(get()); } bool get_quote_flag() const { return gnc_commodity_get_quote_flag(gobj()); }
bool is_currency() const { return gnc_commodity_is_currency(get()); } bool is_currency() const { return gnc_commodity_is_currency(gobj()); }
bool equal(const Commodity& other) const { return gnc_commodity_equal(get(), other.get()); } bool equal(const Commodity& other) const { return gnc_commodity_equal(gobj(), other.gobj()); }
}; };
inline bool operator==(const Commodity& a, const Commodity& b) inline bool operator==(const Commodity& a, const Commodity& b)

View File

@ -54,15 +54,15 @@ public:
: base_class(ptr) : base_class(ptr)
{ } { }
GncInstance< ::QofBook > getBook() const { return qof_instance_get_book (QOF_INSTANCE(base_class::get())); } GncInstance< ::QofBook > getBook() const { return qof_instance_get_book (QOF_INSTANCE(base_class::gobj())); }
::GncGUID getGUID() const { return qof_entity_get_guid(QOF_INSTANCE(base_class::get())); } ::GncGUID getGUID() const { return qof_entity_get_guid(QOF_INSTANCE(base_class::gobj())); }
bool is_dirty() const { return qof_instance_get_dirty(QOF_INSTANCE(base_class::get())); } bool is_dirty() const { return qof_instance_get_dirty(QOF_INSTANCE(base_class::gobj())); }
void set_dirty() { return qof_instance_set_dirty(QOF_INSTANCE(base_class::get())); } void set_dirty() { return qof_instance_set_dirty(QOF_INSTANCE(base_class::gobj())); }
void mark_clean() { return qof_instance_mark_clean(QOF_INSTANCE(base_class::get())); } void mark_clean() { return qof_instance_mark_clean(QOF_INSTANCE(base_class::gobj())); }
//bool check_type(const char* type_id) { return (0 == g_strcmp0(type_id, QOF_INSTANCE(base_class::get())->e_type)); } //bool check_type(const char* type_id) { return (0 == g_strcmp0(type_id, QOF_INSTANCE(base_class::gobj())->e_type)); }
//Slots getSlots() const { return qof_instance_get_slots(QOF_INSTANCE(get())); } //Slots getSlots() const { return qof_instance_get_slots(QOF_INSTANCE(gobj())); }
}; };
} // END namespace gnc } // END namespace gnc

View File

@ -36,10 +36,10 @@ namespace gnc
// headers // headers
PrintAmountInfo::PrintAmountInfo(const Account& account, bool use_symbol) PrintAmountInfo::PrintAmountInfo(const Account& account, bool use_symbol)
: base_class(gnc_account_print_info(account.get(), use_symbol)) : base_class(gnc_account_print_info(account.gobj(), use_symbol))
{} {}
PrintAmountInfo::PrintAmountInfo(const Split& split, bool use_symbol) PrintAmountInfo::PrintAmountInfo(const Split& split, bool use_symbol)
: base_class(gnc_split_amount_print_info(split.get(), use_symbol)) : base_class(gnc_split_amount_print_info(split.gobj(), use_symbol))
{} {}
QString Numeric::printAmount(const PrintAmountInfo& info) const QString Numeric::printAmount(const PrintAmountInfo& info) const

View File

@ -33,7 +33,7 @@ namespace gnc
Book Session::get_book () const Book Session::get_book () const
{ {
return Book(qof_session_get_book(get())); return Book(qof_session_get_book(gobj()));
} }

View File

@ -60,49 +60,49 @@ public:
void begin(const QString& book_id, bool ignore_lock, bool create_if_nonexistent, bool force) void begin(const QString& book_id, bool ignore_lock, bool create_if_nonexistent, bool force)
{ {
qof_session_begin(get(), book_id.toUtf8(), ignore_lock, create_if_nonexistent, force); qof_session_begin(gobj(), book_id.toUtf8(), ignore_lock, create_if_nonexistent, force);
} }
void load (QofPercentageFunc percentage_func) void load (QofPercentageFunc percentage_func)
{ {
qof_session_load(get(), percentage_func); qof_session_load(gobj(), percentage_func);
} }
QofBackendError get_error () QofBackendError get_error ()
{ {
return qof_session_get_error(get()); return qof_session_get_error(gobj());
} }
QofBackendError pop_error () QofBackendError pop_error ()
{ {
return qof_session_pop_error(get()); return qof_session_pop_error(gobj());
} }
QString get_error_message() const QString get_error_message() const
{ {
return QString::fromUtf8(qof_session_get_error_message(get())); return QString::fromUtf8(qof_session_get_error_message(gobj()));
} }
Book get_book () const; Book get_book () const;
QString get_file_path () const QString get_file_path () const
{ {
return QString::fromUtf8(qof_session_get_file_path(get())); return QString::fromUtf8(qof_session_get_file_path(gobj()));
} }
QString get_url() const QString get_url() const
{ {
return QString::fromUtf8(qof_session_get_url(get())); return QString::fromUtf8(qof_session_get_url(gobj()));
} }
bool save_in_progress() const bool save_in_progress() const
{ {
return qof_session_save_in_progress(get()); return qof_session_save_in_progress(gobj());
} }
void save (QofPercentageFunc percentage_func) void save (QofPercentageFunc percentage_func)
{ {
qof_session_save(get(), percentage_func); qof_session_save(gobj(), percentage_func);
} }
void call_close_hooks () void call_close_hooks ()
{ {
qof_session_call_close_hooks (get()); qof_session_call_close_hooks (gobj());
} }

View File

@ -29,17 +29,17 @@
namespace gnc namespace gnc
{ {
Account Split::getAccount() const { return xaccSplitGetAccount(get()); } Account Split::getAccount() const { return xaccSplitGetAccount(gobj()); }
void Split::setAccount(Account acc) { xaccSplitSetAccount(get(), acc.get()); } void Split::setAccount(Account acc) { xaccSplitSetAccount(gobj(), acc.gobj()); }
void Split::setAccount(::Account* acc) { xaccSplitSetAccount(get(), acc); } void Split::setAccount(::Account* acc) { xaccSplitSetAccount(gobj(), acc); }
Transaction Split::getParent() const { return xaccSplitGetParent(get()); } Transaction Split::getParent() const { return xaccSplitGetParent(gobj()); }
void Split::setParent(Transaction& trans) { xaccSplitSetParent(get(), trans.get()); } void Split::setParent(Transaction& trans) { xaccSplitSetParent(gobj(), trans.gobj()); }
TmpSplit::TmpSplit(const Split& s, const TmpTransaction* parent_trans) TmpSplit::TmpSplit(const Split& s, const TmpTransaction* parent_trans)
: m_account(s.getAccount().get()) : m_account(s.getAccount().gobj())
, m_parent(parent_trans) , m_parent(parent_trans)
, m_memo(s.getMemo()) , m_memo(s.getMemo())
, m_action(s.getAction()) , m_action(s.getAction())
@ -80,7 +80,7 @@ void TmpSplit::clear(::Account* account)
void TmpSplit::copyInto(Transaction& t) const void TmpSplit::copyInto(Transaction& t) const
{ {
Split s(xaccMallocSplit(t.getBook().get())); Split s(xaccMallocSplit(t.getBook().gobj()));
s.setAccount(m_account); s.setAccount(m_account);
s.setParent(t); s.setParent(t);
s.setMemo(m_memo); s.setMemo(m_memo);

View File

@ -70,32 +70,32 @@ public:
Transaction getParent() const; Transaction getParent() const;
void setParent(Transaction& trans); void setParent(Transaction& trans);
QString getMemo() const { return QString::fromUtf8(xaccSplitGetMemo(get())); } QString getMemo() const { return QString::fromUtf8(xaccSplitGetMemo(gobj())); }
void setMemo(const QString& v) { xaccSplitSetMemo(get(), v.toUtf8()); } void setMemo(const QString& v) { xaccSplitSetMemo(gobj(), v.toUtf8()); }
QString getAction() const { return QString::fromUtf8(xaccSplitGetAction(get())); } QString getAction() const { return QString::fromUtf8(xaccSplitGetAction(gobj())); }
void setAction(const QString& v) { xaccSplitSetAction(get(), v.toUtf8()); } void setAction(const QString& v) { xaccSplitSetAction(gobj(), v.toUtf8()); }
char getReconcile() const { return xaccSplitGetReconcile(get()); } char getReconcile() const { return xaccSplitGetReconcile(gobj()); }
void setReconcile(char v) { xaccSplitSetReconcile(get(), v); } void setReconcile(char v) { xaccSplitSetReconcile(gobj(), v); }
Split getOtherSplit() const { return xaccSplitGetOtherSplit(get()); } Split getOtherSplit() const { return xaccSplitGetOtherSplit(gobj()); }
QString getCorrAccountFullName() const QString getCorrAccountFullName() const
{ {
return gchar_to_QString(xaccSplitGetCorrAccountFullName(get())); return gchar_to_QString(xaccSplitGetCorrAccountFullName(gobj()));
} }
QString getCorrAccountName() const { return QString::fromUtf8(xaccSplitGetCorrAccountName(get())); } QString getCorrAccountName() const { return QString::fromUtf8(xaccSplitGetCorrAccountName(gobj())); }
QString getCorrAccountCode() const { return QString::fromUtf8(xaccSplitGetCorrAccountCode(get())); } QString getCorrAccountCode() const { return QString::fromUtf8(xaccSplitGetCorrAccountCode(gobj())); }
void setAmount(const Numeric& amount) { xaccSplitSetAmount(get(), amount); } void setAmount(const Numeric& amount) { xaccSplitSetAmount(gobj(), amount); }
Numeric getAmount() const { return xaccSplitGetAmount(get()); } Numeric getAmount() const { return xaccSplitGetAmount(gobj()); }
void setValue(const Numeric& value) { xaccSplitSetValue(get(), value); } void setValue(const Numeric& value) { xaccSplitSetValue(gobj(), value); }
Numeric getValue() const { return xaccSplitGetValue(get()); } Numeric getValue() const { return xaccSplitGetValue(gobj()); }
Numeric getSharePrice() const { return xaccSplitGetSharePrice(get()); } Numeric getSharePrice() const { return xaccSplitGetSharePrice(gobj()); }
Numeric getBalance() const { return xaccSplitGetBalance(get()); } Numeric getBalance() const { return xaccSplitGetBalance(gobj()); }
Numeric getClearedBalance() const { return xaccSplitGetClearedBalance(get()); } Numeric getClearedBalance() const { return xaccSplitGetClearedBalance(gobj()); }
Numeric getReconciledBalance() const { return xaccSplitGetReconciledBalance(get()); } Numeric getReconciledBalance() const { return xaccSplitGetReconciledBalance(gobj()); }

View File

@ -65,7 +65,7 @@ void SplitListModel::recreateCache()
m_hash.clear(); m_hash.clear();
for (int k = 0; k < m_list.size(); ++k) for (int k = 0; k < m_list.size(); ++k)
{ {
m_hash.insert(Split(m_list[k]).getParent().get(), k); m_hash.insert(Split(m_list[k]).getParent().gobj(), k);
} }
if (doReset) if (doReset)
@ -83,10 +83,10 @@ void SplitListModel::recreateTmpTrans()
m_tmpTransaction.setDatePosted(QDate::currentDate()); m_tmpTransaction.setDatePosted(QDate::currentDate());
TmpSplit& oursplit = m_tmpTransaction.getSplits().front(); TmpSplit& oursplit = m_tmpTransaction.getSplits().front();
TmpSplit& othersplit = m_tmpTransaction.getSplits().back(); TmpSplit& othersplit = m_tmpTransaction.getSplits().back();
oursplit.setAccount(m_account.get()); oursplit.setAccount(m_account.gobj());
Q_ASSERT(m_tmpTransaction.countSplits() == 2); Q_ASSERT(m_tmpTransaction.countSplits() == 2);
Q_ASSERT(oursplit.getAccount() == m_account.get()); Q_ASSERT(oursplit.getAccount() == m_account.gobj());
Q_ASSERT(othersplit.getAccount() == NULL); Q_ASSERT(othersplit.getAccount() == NULL);
} }
@ -105,10 +105,10 @@ QModelIndex SplitListModel::index(int row, int column,
return createIndex(row, column, (void*)NULL); return createIndex(row, column, (void*)NULL);
Split childItem = m_list.at(row); Split childItem = m_list.at(row);
if (childItem.get()) if (childItem.gobj())
{ {
//qDebug() << "returning" << childItem.getName(); //qDebug() << "returning" << childItem.getName();
return createIndex(row, column, childItem.get()); return createIndex(row, column, childItem.gobj());
} }
else else
return QModelIndex(); return QModelIndex();
@ -272,7 +272,7 @@ QVariant SplitListModel::data(const QModelIndex& index, int role) const
Split split(static_cast< ::Split*>(index.internalPointer())); Split split(static_cast< ::Split*>(index.internalPointer()));
Transaction trans(split.getParent()); Transaction trans(split.getParent());
Numeric amount = split.getValue(); // Alternatively: xaccSplitConvertAmount(split.get(), split.getAccount().get()); Numeric amount = split.getValue(); // Alternatively: xaccSplitConvertAmount(split.gobj(), split.getAccount().gobj());
PrintAmountInfo printInfo(split, false); PrintAmountInfo printInfo(split, false);
switch (index.column()) switch (index.column())
@ -413,7 +413,7 @@ bool SplitListModel::setData(const QModelIndex &index, const QVariant &value, in
TmpTransaction& trans = m_tmpTransaction; TmpTransaction& trans = m_tmpTransaction;
TmpSplit& split = trans.getSplits().front(); TmpSplit& split = trans.getSplits().front();
Q_ASSERT(split.getAccount() == m_account.get()); Q_ASSERT(split.getAccount() == m_account.gobj());
Q_ASSERT(trans.countSplits() == 2); Q_ASSERT(trans.countSplits() == 2);
TmpSplit& other = trans.getSplits().back(); TmpSplit& other = trans.getSplits().back();
@ -679,7 +679,7 @@ void SplitListModel::transactionEvent( ::Transaction* trans, QofEventId event_ty
void SplitListModel::accountEvent( ::Account* acc, QofEventId event_type) void SplitListModel::accountEvent( ::Account* acc, QofEventId event_type)
{ {
if (acc != m_account.get()) if (acc != m_account.gobj())
return; return;
//qDebug() << "SplitListModel::accountEvent, id=" << qofEventToString(event_type); //qDebug() << "SplitListModel::accountEvent, id=" << qofEventToString(event_type);

View File

@ -86,7 +86,7 @@ void SplitListView::closeEditor(QWidget* editor, QAbstractItemDelegate::EndEditH
void SplitListView::accountEvent( ::Account* v, QofEventId event_type) void SplitListView::accountEvent( ::Account* v, QofEventId event_type)
{ {
if (v != m_account.get()) if (v != m_account.gobj())
return; return;
//qDebug() << "SplitListView::accountEvent, id=" << qofEventToString(event_type); //qDebug() << "SplitListView::accountEvent, id=" << qofEventToString(event_type);
switch (event_type) switch (event_type)

View File

@ -28,23 +28,23 @@ namespace gnc
Split Transaction::findSplitByAccount(const Account& acc) const Split Transaction::findSplitByAccount(const Account& acc) const
{ {
return xaccTransFindSplitByAccount(get(), acc.get()); return xaccTransFindSplitByAccount(gobj(), acc.gobj());
} }
Split Transaction::getSplit(int i) const Split Transaction::getSplit(int i) const
{ {
return xaccTransGetSplit(get(), i); return xaccTransGetSplit(gobj(), i);
} }
void Transaction::appendSplit(Split& split) void Transaction::appendSplit(Split& split)
{ {
xaccSplitSetParent(split.get(), get()); xaccSplitSetParent(split.gobj(), gobj());
} }
int Transaction::getSplitIndex(const Split& split) const int Transaction::getSplitIndex(const Split& split) const
{ {
return xaccTransGetSplitIndex(get(), split.get()); return xaccTransGetSplitIndex(gobj(), split.gobj());
} }
Transaction::element_type* Transaction::newInstance(const Book& b) Transaction::element_type* Transaction::newInstance(const Book& b)
{ {
return xaccMallocTransaction (b.get()); return xaccMallocTransaction (b.gobj());
} }
// //////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////

View File

@ -62,39 +62,39 @@ public:
: base_class(ptr) : base_class(ptr)
{ } { }
void beginEdit() { xaccTransBeginEdit(get()); } void beginEdit() { xaccTransBeginEdit(gobj()); }
void commitEdit() { xaccTransCommitEdit(get()); } void commitEdit() { xaccTransCommitEdit(gobj()); }
void rollbackEdit() { xaccTransRollbackEdit(get()); } void rollbackEdit() { xaccTransRollbackEdit(gobj()); }
bool isOpen() const { return xaccTransIsOpen(get()); } bool isOpen() const { return xaccTransIsOpen(gobj()); }
QString getNum() const { return QString::fromUtf8(xaccTransGetNum(get())); } QString getNum() const { return QString::fromUtf8(xaccTransGetNum(gobj())); }
void setNum(const QString& v) { xaccTransSetNum(get(), v.toUtf8()); } void setNum(const QString& v) { xaccTransSetNum(gobj(), v.toUtf8()); }
QString getDescription() const { return QString::fromUtf8(xaccTransGetDescription(get())); } QString getDescription() const { return QString::fromUtf8(xaccTransGetDescription(gobj())); }
void setDescription(const QString& v) { xaccTransSetDescription(get(), v.toUtf8()); } void setDescription(const QString& v) { xaccTransSetDescription(gobj(), v.toUtf8()); }
QString getNotes() const { return QString::fromUtf8(xaccTransGetNotes(get())); } QString getNotes() const { return QString::fromUtf8(xaccTransGetNotes(gobj())); }
void setNotes(const QString& v) { xaccTransSetNotes(get(), v.toUtf8()); } void setNotes(const QString& v) { xaccTransSetNotes(gobj(), v.toUtf8()); }
int countSplits() const { return xaccTransCountSplits(get()); } int countSplits() const { return xaccTransCountSplits(gobj()); }
Split findSplitByAccount(const Account& acc) const; Split findSplitByAccount(const Account& acc) const;
void appendSplit(Split& split); void appendSplit(Split& split);
Split getSplit(int i) const; Split getSplit(int i) const;
int getSplitIndex(const Split& split) const; int getSplitIndex(const Split& split) const;
::SplitList* getSplitList() const { return xaccTransGetSplitList(get()); } ::SplitList* getSplitList() const { return xaccTransGetSplitList(gobj()); }
Commodity getCurrency() const { return xaccTransGetCurrency(get()); } Commodity getCurrency() const { return xaccTransGetCurrency(gobj()); }
void setCurrency(const Commodity& c) { xaccTransSetCurrency(get(), c.get()); } void setCurrency(const Commodity& c) { xaccTransSetCurrency(gobj(), c.gobj()); }
Numeric getImbalanceValue() const { return xaccTransGetImbalanceValue(get()); } Numeric getImbalanceValue() const { return xaccTransGetImbalanceValue(gobj()); }
bool isBalanced() const { return xaccTransIsBalanced(get()); } bool isBalanced() const { return xaccTransIsBalanced(gobj()); }
Numeric getAccountConvRate(const Account& acc) const { return xaccTransGetAccountConvRate(get(), acc.get()); } Numeric getAccountConvRate(const Account& acc) const { return xaccTransGetAccountConvRate(gobj(), acc.gobj()); }
void setDatePosted(const QDate& d) { xaccTransSetDate(get(), d.day(), d.month(), d.year()); } void setDatePosted(const QDate& d) { xaccTransSetDate(gobj(), d.day(), d.month(), d.year()); }
void setDateEntered(const QDateTime& t) { xaccTransSetDateEnteredSecs(get(), t.toTime_t()); } void setDateEntered(const QDateTime& t) { xaccTransSetDateEnteredSecs(gobj(), t.toTime_t()); }
QDate getDatePosted() const { return toQDate(xaccTransGetDatePostedGDate(get())); } QDate getDatePosted() const { return toQDate(xaccTransGetDatePostedGDate(gobj())); }
QDateTime getDateEntered() const { return toQDateTime(xaccTransRetDateEnteredTS(get())); } QDateTime getDateEntered() const { return toQDateTime(xaccTransRetDateEnteredTS(gobj())); }
static element_type* newInstance(const Book& b); static element_type* newInstance(const Book& b);
}; };

View File

@ -70,7 +70,7 @@ public:
return m_ptr; return m_ptr;
} }
T * get() const // never throws T * gobj() const // never throws
{ {
return m_ptr; return m_ptr;
} }

View File

@ -312,7 +312,7 @@ bool MainWindow::show_session_error (QWidget *parent,
static void static void
gnc_book_opened (Session& sess) gnc_book_opened (Session& sess)
{ {
gnc_hook_run(HOOK_BOOK_OPENED, sess.get()); gnc_hook_run(HOOK_BOOK_OPENED, sess.gobj());
} }
@ -376,8 +376,8 @@ void MainWindow::loadFile(const QString &fileName)
/* -------------- BEGIN CORE SESSION CODE ------------- */ /* -------------- BEGIN CORE SESSION CODE ------------- */
/* -- this code is almost identical in FileOpen and FileSaveAs -- */ /* -- this code is almost identical in FileOpen and FileSaveAs -- */
m_session.call_close_hooks(); m_session.call_close_hooks();
gnc_hook_run(HOOK_BOOK_CLOSED, m_session.get()); gnc_hook_run(HOOK_BOOK_CLOSED, m_session.gobj());
qof_session_destroy(m_session.get()); qof_session_destroy(m_session.gobj());
m_session.reset(); m_session.reset();
/* load the accounts from the users datafile */ /* load the accounts from the users datafile */
@ -415,7 +415,7 @@ void MainWindow::loadFile(const QString &fileName)
else if (msgBox.clickedButton() == createNewFile) else if (msgBox.clickedButton() == createNewFile)
{ {
/* Can't use the given file, so just create a new /* Can't use the given file, so just create a new
* database so that the user will get a window that * database so that the user will gobj a window that
* they can click "Exit" on. * they can click "Exit" on.
*/ */
newFile(); newFile();
@ -592,7 +592,7 @@ bool MainWindow::saveFileAs(const QString &fileName)
} }
QByteArray newfile = newfile_qstring.toUtf8(); QByteArray newfile = newfile_qstring.toUtf8();
QofSession *session = m_session.get(); QofSession *session = m_session.gobj();
if (m_session.get_url() == fileName) if (m_session.get_url() == fileName)
{ {
return saveFile(); return saveFile();
@ -678,7 +678,7 @@ bool MainWindow::saveFileAs(const QString &fileName)
/* if we got to here, then we've successfully gotten a new session */ /* if we got to here, then we've successfully gotten a new session */
/* close up the old file session (if any) */ /* close up the old file session (if any) */
qof_session_swap_data (session, new_session); qof_session_swap_data (session, new_session);
qof_session_destroy(m_session.get()); qof_session_destroy(m_session.gobj());
m_session.reset(); m_session.reset();
session = NULL; session = NULL;
@ -703,9 +703,9 @@ static bool been_here_before = false;
bool MainWindow::saveFile() bool MainWindow::saveFile()
{ {
/* hack alert -- Somehow make sure all in-progress edits get committed! */ /* hack alert -- Somehow make sure all in-progress edits gobj committed! */
/* If we don't have a filename/path to save to get one. */ /* If we don't have a filename/path to save to gobj one. */
if (m_session.get_url().isEmpty()) if (m_session.get_url().isEmpty())
return on_actionSave_as_triggered(); return on_actionSave_as_triggered();
@ -726,7 +726,7 @@ bool MainWindow::saveFile()
progress_functor functor(&progressBar); progress_functor functor(&progressBar);
// The actual saving // The actual saving
qof_session_save (m_session.get(), &progress_functor::static_func); qof_session_save (m_session.gobj(), &progress_functor::static_func);
// Remove the progress bar again from the status bar. // Remove the progress bar again from the status bar.
statusBar()->removeWidget(&progressBar); statusBar()->removeWidget(&progressBar);
@ -754,7 +754,7 @@ bool MainWindow::saveFile()
} }
xaccReopenLog(); xaccReopenLog();
gnc_hook_run(HOOK_BOOK_SAVED, m_session.get()); gnc_hook_run(HOOK_BOOK_SAVED, m_session.gobj());
documentCleanStateChanged(true); documentCleanStateChanged(true);
statusBar()->showMessage(tr("File saved"), 5000); statusBar()->showMessage(tr("File saved"), 5000);

View File

@ -122,9 +122,9 @@ MainWindow::MainWindow()
MainWindow::~MainWindow() MainWindow::~MainWindow()
{ {
if (m_session.get()) if (m_session.gobj())
{ {
qof_session_destroy(m_session.get()); qof_session_destroy(m_session.gobj());
m_session.reset(); m_session.reset();
} }
} }
@ -576,10 +576,10 @@ void MainWindow::closeEvent(QCloseEvent *event)
* transactions during shutdown would cause massive redraws */ * transactions during shutdown would cause massive redraws */
qof_event_suspend (); qof_event_suspend ();
qof_session_call_close_hooks(m_session.get()); qof_session_call_close_hooks(m_session.gobj());
gnc_hook_run(HOOK_BOOK_CLOSED, m_session.get()); gnc_hook_run(HOOK_BOOK_CLOSED, m_session.gobj());
qof_session_destroy(m_session.get()); qof_session_destroy(m_session.gobj());
m_session.reset(); m_session.reset();
qof_event_resume (); qof_event_resume ();
@ -598,13 +598,13 @@ void MainWindow::newFile()
if (m_session) if (m_session)
{ {
/* close any ongoing file sessions, and free the accounts. /* close any ongoing file sessions, and free the accounts.
* disable events so we don't get spammed by redraws. */ * disable events so we don't gobj spammed by redraws. */
qof_event_suspend (); qof_event_suspend ();
m_session.call_close_hooks(); m_session.call_close_hooks();
gnc_hook_run(HOOK_BOOK_CLOSED, m_session.get()); gnc_hook_run(HOOK_BOOK_CLOSED, m_session.gobj());
qof_session_destroy(m_session.get()); qof_session_destroy(m_session.gobj());
m_session.reset(); m_session.reset();
qof_event_resume (); qof_event_resume ();
} }
@ -615,7 +615,7 @@ void MainWindow::newFile()
gnc_hook_run(HOOK_NEW_BOOK, NULL); gnc_hook_run(HOOK_NEW_BOOK, NULL);
/* Call this after re-enabling events. */ /* Call this after re-enabling events. */
gnc_hook_run(HOOK_BOOK_OPENED, m_session.get()); gnc_hook_run(HOOK_BOOK_OPENED, m_session.gobj());
setCurrentFile(""); setCurrentFile("");
} }