diff --git a/src/gnc/Account.hpp b/src/gnc/Account.hpp index 0ac958c28e..dcfae1019e 100644 --- a/src/gnc/Account.hpp +++ b/src/gnc/Account.hpp @@ -59,25 +59,25 @@ public: Account(element_type* ptr = 0) : base_class(ptr) { } - QString getName() const { return QString::fromUtf8(xaccAccountGetName(get())); } - QString getFullName() const { return gchar_to_QString(gnc_account_get_full_name (get())); } - QString getCode() const { return QString::fromUtf8(xaccAccountGetCode(get())); } - QString getDescription() const { return QString::fromUtf8(xaccAccountGetDescription(get())); } - Commodity getCommodity() const { return xaccAccountGetCommodity(get()); } - int getCommoditySCU() const { return xaccAccountGetCommoditySCU(get()); } + QString getName() const { return QString::fromUtf8(xaccAccountGetName(gobj())); } + QString getFullName() const { return gchar_to_QString(gnc_account_get_full_name (gobj())); } + QString getCode() const { return QString::fromUtf8(xaccAccountGetCode(gobj())); } + QString getDescription() const { return QString::fromUtf8(xaccAccountGetDescription(gobj())); } + Commodity getCommodity() const { return xaccAccountGetCommodity(gobj()); } + int getCommoditySCU() const { return xaccAccountGetCommoditySCU(gobj()); } - ::SplitList* getSplitList() const { return xaccAccountGetSplitList(get()); } + ::SplitList* getSplitList() const { return xaccAccountGetSplitList(gobj()); } /** @name Account tree traversal */ //@{ - Account get_parent() const { return gnc_account_get_parent(get()); } - Account get_root() { return gnc_account_get_root(get()); } - bool is_root() const { return gnc_account_is_root(get()); } - gint n_children() const { return gnc_account_n_children(get()); } - GList *get_children() const { return gnc_account_get_children(get()); } - GList *get_descendants () const { return gnc_account_get_descendants (get()); } - Account nth_child (gint num) const { return gnc_account_nth_child(get(), num); } + Account get_parent() const { return gnc_account_get_parent(gobj()); } + Account get_root() { return gnc_account_get_root(gobj()); } + bool is_root() const { return gnc_account_is_root(gobj()); } + gint n_children() const { return gnc_account_n_children(gobj()); } + GList *get_children() const { return gnc_account_get_children(gobj()); } + GList *get_descendants () const { return gnc_account_get_descendants (gobj()); } + 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 @@ -86,14 +86,14 @@ public: gint child_index () const { Account parent(get_parent()); - if (parent.get()) - return gnc_account_child_index(parent.get(), get()); + if (parent.gobj()) + return gnc_account_child_index(parent.gobj(), gobj()); else return 0; } - gint get_current_depth () const { return gnc_account_get_current_depth(get()); } - gint get_tree_depth () const { return gnc_account_get_tree_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(gobj()); } //@} diff --git a/src/gnc/AccountItemModel.cpp b/src/gnc/AccountItemModel.cpp index ec0e1568a2..459ab8b833 100644 --- a/src/gnc/AccountItemModel.cpp +++ b/src/gnc/AccountItemModel.cpp @@ -50,10 +50,10 @@ QModelIndex AccountTreeModel::index(int row, int column, parentItem.reset(static_cast< ::Account*>(parent.internalPointer())); Account childItem = parentItem.nth_child(row); - if (childItem.get()) + if (childItem.gobj()) { //qDebug() << "returning" << childItem.getName(); - return createIndex(row, column, childItem.get()); + return createIndex(row, column, childItem.gobj()); } else return QModelIndex(); @@ -68,10 +68,10 @@ QModelIndex AccountTreeModel::parent(const QModelIndex &index) const Account childItem(static_cast< ::Account*>(index.internalPointer())); Account parentItem(childItem.get_parent()); - if (parentItem.get() == m_root.get()) + if (parentItem.gobj() == m_root.gobj()) 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 @@ -120,8 +120,8 @@ QVariant AccountTreeModel::data(const QModelIndex& index, int role) const return account.getDescription(); case 3: { - Numeric balance = gnc_ui_account_get_balance(account.get(), false); - PrintAmountInfo printInfo(account.get(), true); + Numeric balance = gnc_ui_account_get_balance(account.gobj(), false); + PrintAmountInfo printInfo(account.gobj(), true); return balance.printAmount(printInfo); } default: @@ -207,10 +207,10 @@ QModelIndex AccountListModel::index(int row, int column, return QModelIndex(); Account childItem = m_list.at(row); - if (childItem.get()) + if (childItem.gobj()) { //qDebug() << "returning" << childItem.getName(); - return createIndex(row, column, childItem.get()); + return createIndex(row, column, childItem.gobj()); } else return QModelIndex(); diff --git a/src/gnc/AccountSelectionDelegate.cpp b/src/gnc/AccountSelectionDelegate.cpp index 991280891c..225cb1b4d5 100644 --- a/src/gnc/AccountSelectionDelegate.cpp +++ b/src/gnc/AccountSelectionDelegate.cpp @@ -88,7 +88,7 @@ void AccountSelectionDelegate::setEditorData(QWidget *editor, const QModelIndex { const AccountListModel* amodel = dynamic_cast(comboBox->model()); Q_ASSERT(amodel); - comboBox->setCurrentIndex(amodel->indexOf(acc.get())); + comboBox->setCurrentIndex(amodel->indexOf(acc.gobj())); } } else diff --git a/src/gnc/Book.cpp b/src/gnc/Book.cpp index 157dc94363..b3e1797488 100644 --- a/src/gnc/Book.cpp +++ b/src/gnc/Book.cpp @@ -28,7 +28,7 @@ namespace gnc { Account Book::get_root_account() { - return Account(gnc_book_get_root_account (get())); + return Account(gnc_book_get_root_account (gobj())); } } // END namespace gnc diff --git a/src/gnc/Cmd.cpp b/src/gnc/Cmd.cpp index c46ebd1936..e67b21934d 100644 --- a/src/gnc/Cmd.cpp +++ b/src/gnc/Cmd.cpp @@ -105,7 +105,7 @@ public: const value_type& newValue, QUndoCommand *parent = 0) : base_class(text, parent) - , m_target(targetPtr.get()) + , m_target(targetPtr.gobj()) , m_previousValue(previousValue) , m_newValue(newValue) { @@ -201,7 +201,7 @@ public: WeakPointer& targetPtr, QUndoCommand *parent = 0) : base_class(text, parent) - , m_target(targetPtr.get()) + , m_target(targetPtr.gobj()) , m_previousValue(m_target) , m_book(m_target.getBook()) { @@ -210,7 +210,7 @@ public: virtual void redo() { - xaccTransDestroy(m_target.get()); + xaccTransDestroy(m_target.gobj()); m_target.reset(); } @@ -313,7 +313,7 @@ QUndoCommand* setSplitAccount(TmpSplit& t, Account newValue) { return new CmdRef(QObject::tr("Edit Split Account"), t, &TmpSplit::setAccount, - t.getAccount(), newValue.get()); + t.getAccount(), newValue.gobj()); } QUndoCommand* setSplitReconcile(TmpSplit& t, char newValue) { @@ -437,7 +437,7 @@ public: virtual void undo() { - xaccTransDestroy(m_created.get()); + xaccTransDestroy(m_created.gobj()); m_created.reset(); } diff --git a/src/gnc/Cmd.hpp b/src/gnc/Cmd.hpp index 0aa03da6f7..76d0b63b99 100644 --- a/src/gnc/Cmd.hpp +++ b/src/gnc/Cmd.hpp @@ -88,7 +88,7 @@ public: const value_type& newValue, QUndoCommand *parent = 0) : base_class(text, parent) - , m_target(targetPtr.get()) + , m_target(targetPtr.gobj()) , m_setter(setter) , m_previousValue((m_target.*getter)()) , m_newValue(newValue) @@ -114,7 +114,7 @@ public: const value_type& newValue, QUndoCommand *parent = 0) : base_class(text, parent) - , m_target(targetPtr.get()) + , m_target(targetPtr.gobj()) , m_setter(setter) , m_previousValue(previousValue) , m_newValue(newValue) diff --git a/src/gnc/Commodity.hpp b/src/gnc/Commodity.hpp index 0125797c56..32142b4691 100644 --- a/src/gnc/Commodity.hpp +++ b/src/gnc/Commodity.hpp @@ -46,17 +46,17 @@ public: Commodity(element_type *ptr = 0) : base_class(ptr) {} - QString get_mnemonic() const { return gnc_commodity_get_mnemonic(get()); } - QString get_namespace() const { return gnc_commodity_get_namespace(get()); } - QString get_fullname() const { return gnc_commodity_get_fullname(get()); } - QString get_printname() const { return gnc_commodity_get_printname(get()); } + QString get_mnemonic() const { return gnc_commodity_get_mnemonic(gobj()); } + QString get_namespace() const { return gnc_commodity_get_namespace(gobj()); } + QString get_fullname() const { return gnc_commodity_get_fullname(gobj()); } + QString get_printname() const { return gnc_commodity_get_printname(gobj()); } - int get_fraction() const { return gnc_commodity_get_fraction(get()); } - bool get_quote_flag() const { return gnc_commodity_get_quote_flag(get()); } + int get_fraction() const { return gnc_commodity_get_fraction(gobj()); } + 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) diff --git a/src/gnc/GncInstance.hpp b/src/gnc/GncInstance.hpp index d4c3bdd5ce..e7c002e1b7 100644 --- a/src/gnc/GncInstance.hpp +++ b/src/gnc/GncInstance.hpp @@ -54,15 +54,15 @@ public: : base_class(ptr) { } - GncInstance< ::QofBook > getBook() const { return qof_instance_get_book (QOF_INSTANCE(base_class::get())); } - ::GncGUID getGUID() const { return qof_entity_get_guid(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::gobj())); } - bool is_dirty() const { return qof_instance_get_dirty(QOF_INSTANCE(base_class::get())); } - void set_dirty() { return qof_instance_set_dirty(QOF_INSTANCE(base_class::get())); } - void mark_clean() { return qof_instance_mark_clean(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::gobj())); } + 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)); } - //Slots getSlots() const { return qof_instance_get_slots(QOF_INSTANCE(get())); } + //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(gobj())); } }; } // END namespace gnc diff --git a/src/gnc/Numeric.cpp b/src/gnc/Numeric.cpp index 9d06855181..4a03dd0bff 100644 --- a/src/gnc/Numeric.cpp +++ b/src/gnc/Numeric.cpp @@ -36,10 +36,10 @@ namespace gnc // headers 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) - : 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 diff --git a/src/gnc/Session.cpp b/src/gnc/Session.cpp index 9b8894642b..683b5af829 100644 --- a/src/gnc/Session.cpp +++ b/src/gnc/Session.cpp @@ -33,7 +33,7 @@ namespace gnc Book Session::get_book () const { - return Book(qof_session_get_book(get())); + return Book(qof_session_get_book(gobj())); } diff --git a/src/gnc/Session.hpp b/src/gnc/Session.hpp index bdcb5e660b..9959be16fd 100644 --- a/src/gnc/Session.hpp +++ b/src/gnc/Session.hpp @@ -60,49 +60,49 @@ public: 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) { - qof_session_load(get(), percentage_func); + qof_session_load(gobj(), percentage_func); } QofBackendError get_error () { - return qof_session_get_error(get()); + return qof_session_get_error(gobj()); } QofBackendError pop_error () { - return qof_session_pop_error(get()); + return qof_session_pop_error(gobj()); } 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; 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 { - return QString::fromUtf8(qof_session_get_url(get())); + return QString::fromUtf8(qof_session_get_url(gobj())); } bool save_in_progress() const { - return qof_session_save_in_progress(get()); + return qof_session_save_in_progress(gobj()); } void save (QofPercentageFunc percentage_func) { - qof_session_save(get(), percentage_func); + qof_session_save(gobj(), percentage_func); } void call_close_hooks () { - qof_session_call_close_hooks (get()); + qof_session_call_close_hooks (gobj()); } diff --git a/src/gnc/Split.cpp b/src/gnc/Split.cpp index 36eaea51fa..f6968e824e 100644 --- a/src/gnc/Split.cpp +++ b/src/gnc/Split.cpp @@ -29,17 +29,17 @@ namespace gnc { -Account Split::getAccount() const { return xaccSplitGetAccount(get()); } -void Split::setAccount(Account acc) { xaccSplitSetAccount(get(), acc.get()); } -void Split::setAccount(::Account* acc) { xaccSplitSetAccount(get(), acc); } +Account Split::getAccount() const { return xaccSplitGetAccount(gobj()); } +void Split::setAccount(Account acc) { xaccSplitSetAccount(gobj(), acc.gobj()); } +void Split::setAccount(::Account* acc) { xaccSplitSetAccount(gobj(), acc); } -Transaction Split::getParent() const { return xaccSplitGetParent(get()); } -void Split::setParent(Transaction& trans) { xaccSplitSetParent(get(), trans.get()); } +Transaction Split::getParent() const { return xaccSplitGetParent(gobj()); } +void Split::setParent(Transaction& trans) { xaccSplitSetParent(gobj(), trans.gobj()); } TmpSplit::TmpSplit(const Split& s, const TmpTransaction* parent_trans) - : m_account(s.getAccount().get()) + : m_account(s.getAccount().gobj()) , m_parent(parent_trans) , m_memo(s.getMemo()) , m_action(s.getAction()) @@ -80,7 +80,7 @@ void TmpSplit::clear(::Account* account) void TmpSplit::copyInto(Transaction& t) const { - Split s(xaccMallocSplit(t.getBook().get())); + Split s(xaccMallocSplit(t.getBook().gobj())); s.setAccount(m_account); s.setParent(t); s.setMemo(m_memo); diff --git a/src/gnc/Split.hpp b/src/gnc/Split.hpp index 91dc7426fc..b67ac1a882 100644 --- a/src/gnc/Split.hpp +++ b/src/gnc/Split.hpp @@ -70,32 +70,32 @@ public: Transaction getParent() const; void setParent(Transaction& trans); - QString getMemo() const { return QString::fromUtf8(xaccSplitGetMemo(get())); } - void setMemo(const QString& v) { xaccSplitSetMemo(get(), v.toUtf8()); } + QString getMemo() const { return QString::fromUtf8(xaccSplitGetMemo(gobj())); } + void setMemo(const QString& v) { xaccSplitSetMemo(gobj(), v.toUtf8()); } - QString getAction() const { return QString::fromUtf8(xaccSplitGetAction(get())); } - void setAction(const QString& v) { xaccSplitSetAction(get(), v.toUtf8()); } + QString getAction() const { return QString::fromUtf8(xaccSplitGetAction(gobj())); } + void setAction(const QString& v) { xaccSplitSetAction(gobj(), v.toUtf8()); } - char getReconcile() const { return xaccSplitGetReconcile(get()); } - void setReconcile(char v) { xaccSplitSetReconcile(get(), v); } + char getReconcile() const { return xaccSplitGetReconcile(gobj()); } + void setReconcile(char v) { xaccSplitSetReconcile(gobj(), v); } - Split getOtherSplit() const { return xaccSplitGetOtherSplit(get()); } + Split getOtherSplit() const { return xaccSplitGetOtherSplit(gobj()); } QString getCorrAccountFullName() const { - return gchar_to_QString(xaccSplitGetCorrAccountFullName(get())); + return gchar_to_QString(xaccSplitGetCorrAccountFullName(gobj())); } - QString getCorrAccountName() const { return QString::fromUtf8(xaccSplitGetCorrAccountName(get())); } - QString getCorrAccountCode() const { return QString::fromUtf8(xaccSplitGetCorrAccountCode(get())); } + QString getCorrAccountName() const { return QString::fromUtf8(xaccSplitGetCorrAccountName(gobj())); } + QString getCorrAccountCode() const { return QString::fromUtf8(xaccSplitGetCorrAccountCode(gobj())); } - void setAmount(const Numeric& amount) { xaccSplitSetAmount(get(), amount); } - Numeric getAmount() const { return xaccSplitGetAmount(get()); } - void setValue(const Numeric& value) { xaccSplitSetValue(get(), value); } - Numeric getValue() const { return xaccSplitGetValue(get()); } - Numeric getSharePrice() const { return xaccSplitGetSharePrice(get()); } - Numeric getBalance() const { return xaccSplitGetBalance(get()); } - Numeric getClearedBalance() const { return xaccSplitGetClearedBalance(get()); } - Numeric getReconciledBalance() const { return xaccSplitGetReconciledBalance(get()); } + void setAmount(const Numeric& amount) { xaccSplitSetAmount(gobj(), amount); } + Numeric getAmount() const { return xaccSplitGetAmount(gobj()); } + void setValue(const Numeric& value) { xaccSplitSetValue(gobj(), value); } + Numeric getValue() const { return xaccSplitGetValue(gobj()); } + Numeric getSharePrice() const { return xaccSplitGetSharePrice(gobj()); } + Numeric getBalance() const { return xaccSplitGetBalance(gobj()); } + Numeric getClearedBalance() const { return xaccSplitGetClearedBalance(gobj()); } + Numeric getReconciledBalance() const { return xaccSplitGetReconciledBalance(gobj()); } diff --git a/src/gnc/SplitListModel.cpp b/src/gnc/SplitListModel.cpp index 868d182a42..aa718dd5f0 100644 --- a/src/gnc/SplitListModel.cpp +++ b/src/gnc/SplitListModel.cpp @@ -65,7 +65,7 @@ void SplitListModel::recreateCache() m_hash.clear(); 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) @@ -83,10 +83,10 @@ void SplitListModel::recreateTmpTrans() m_tmpTransaction.setDatePosted(QDate::currentDate()); TmpSplit& oursplit = m_tmpTransaction.getSplits().front(); TmpSplit& othersplit = m_tmpTransaction.getSplits().back(); - oursplit.setAccount(m_account.get()); + oursplit.setAccount(m_account.gobj()); 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); } @@ -105,10 +105,10 @@ QModelIndex SplitListModel::index(int row, int column, return createIndex(row, column, (void*)NULL); Split childItem = m_list.at(row); - if (childItem.get()) + if (childItem.gobj()) { //qDebug() << "returning" << childItem.getName(); - return createIndex(row, column, childItem.get()); + return createIndex(row, column, childItem.gobj()); } else return QModelIndex(); @@ -272,7 +272,7 @@ QVariant SplitListModel::data(const QModelIndex& index, int role) const Split split(static_cast< ::Split*>(index.internalPointer())); 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); switch (index.column()) @@ -413,7 +413,7 @@ bool SplitListModel::setData(const QModelIndex &index, const QVariant &value, in TmpTransaction& trans = m_tmpTransaction; TmpSplit& split = trans.getSplits().front(); - Q_ASSERT(split.getAccount() == m_account.get()); + Q_ASSERT(split.getAccount() == m_account.gobj()); Q_ASSERT(trans.countSplits() == 2); 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) { - if (acc != m_account.get()) + if (acc != m_account.gobj()) return; //qDebug() << "SplitListModel::accountEvent, id=" << qofEventToString(event_type); diff --git a/src/gnc/SplitListView.cpp b/src/gnc/SplitListView.cpp index be7651915e..e487e4005e 100644 --- a/src/gnc/SplitListView.cpp +++ b/src/gnc/SplitListView.cpp @@ -86,7 +86,7 @@ void SplitListView::closeEditor(QWidget* editor, QAbstractItemDelegate::EndEditH void SplitListView::accountEvent( ::Account* v, QofEventId event_type) { - if (v != m_account.get()) + if (v != m_account.gobj()) return; //qDebug() << "SplitListView::accountEvent, id=" << qofEventToString(event_type); switch (event_type) diff --git a/src/gnc/Transaction.cpp b/src/gnc/Transaction.cpp index cba816039d..7338fe255a 100644 --- a/src/gnc/Transaction.cpp +++ b/src/gnc/Transaction.cpp @@ -28,23 +28,23 @@ namespace gnc Split Transaction::findSplitByAccount(const Account& acc) const { - return xaccTransFindSplitByAccount(get(), acc.get()); + return xaccTransFindSplitByAccount(gobj(), acc.gobj()); } Split Transaction::getSplit(int i) const { - return xaccTransGetSplit(get(), i); + return xaccTransGetSplit(gobj(), i); } void Transaction::appendSplit(Split& split) { - xaccSplitSetParent(split.get(), get()); + xaccSplitSetParent(split.gobj(), gobj()); } 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) { - return xaccMallocTransaction (b.get()); + return xaccMallocTransaction (b.gobj()); } // //////////////////////////////////////////////////////////// diff --git a/src/gnc/Transaction.hpp b/src/gnc/Transaction.hpp index cac86e74fb..e7a9b6403b 100644 --- a/src/gnc/Transaction.hpp +++ b/src/gnc/Transaction.hpp @@ -62,39 +62,39 @@ public: : base_class(ptr) { } - void beginEdit() { xaccTransBeginEdit(get()); } - void commitEdit() { xaccTransCommitEdit(get()); } - void rollbackEdit() { xaccTransRollbackEdit(get()); } - bool isOpen() const { return xaccTransIsOpen(get()); } + void beginEdit() { xaccTransBeginEdit(gobj()); } + void commitEdit() { xaccTransCommitEdit(gobj()); } + void rollbackEdit() { xaccTransRollbackEdit(gobj()); } + bool isOpen() const { return xaccTransIsOpen(gobj()); } - QString getNum() const { return QString::fromUtf8(xaccTransGetNum(get())); } - void setNum(const QString& v) { xaccTransSetNum(get(), v.toUtf8()); } + QString getNum() const { return QString::fromUtf8(xaccTransGetNum(gobj())); } + void setNum(const QString& v) { xaccTransSetNum(gobj(), v.toUtf8()); } - QString getDescription() const { return QString::fromUtf8(xaccTransGetDescription(get())); } - void setDescription(const QString& v) { xaccTransSetDescription(get(), v.toUtf8()); } + QString getDescription() const { return QString::fromUtf8(xaccTransGetDescription(gobj())); } + void setDescription(const QString& v) { xaccTransSetDescription(gobj(), v.toUtf8()); } - QString getNotes() const { return QString::fromUtf8(xaccTransGetNotes(get())); } - void setNotes(const QString& v) { xaccTransSetNotes(get(), v.toUtf8()); } + QString getNotes() const { return QString::fromUtf8(xaccTransGetNotes(gobj())); } + 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; void appendSplit(Split& split); Split getSplit(int i) 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()); } - void setCurrency(const Commodity& c) { xaccTransSetCurrency(get(), c.get()); } + Commodity getCurrency() const { return xaccTransGetCurrency(gobj()); } + void setCurrency(const Commodity& c) { xaccTransSetCurrency(gobj(), c.gobj()); } - Numeric getImbalanceValue() const { return xaccTransGetImbalanceValue(get()); } - bool isBalanced() const { return xaccTransIsBalanced(get()); } - Numeric getAccountConvRate(const Account& acc) const { return xaccTransGetAccountConvRate(get(), acc.get()); } + Numeric getImbalanceValue() const { return xaccTransGetImbalanceValue(gobj()); } + bool isBalanced() const { return xaccTransIsBalanced(gobj()); } + 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 setDateEntered(const QDateTime& t) { xaccTransSetDateEnteredSecs(get(), t.toTime_t()); } - QDate getDatePosted() const { return toQDate(xaccTransGetDatePostedGDate(get())); } - QDateTime getDateEntered() const { return toQDateTime(xaccTransRetDateEnteredTS(get())); } + void setDatePosted(const QDate& d) { xaccTransSetDate(gobj(), d.day(), d.month(), d.year()); } + void setDateEntered(const QDateTime& t) { xaccTransSetDateEnteredSecs(gobj(), t.toTime_t()); } + QDate getDatePosted() const { return toQDate(xaccTransGetDatePostedGDate(gobj())); } + QDateTime getDateEntered() const { return toQDateTime(xaccTransRetDateEnteredTS(gobj())); } static element_type* newInstance(const Book& b); }; diff --git a/src/gnc/WeakPointer.hpp b/src/gnc/WeakPointer.hpp index 9b5977eb57..6d775e29c5 100644 --- a/src/gnc/WeakPointer.hpp +++ b/src/gnc/WeakPointer.hpp @@ -70,7 +70,7 @@ public: return m_ptr; } - T * get() const // never throws + T * gobj() const // never throws { return m_ptr; } diff --git a/src/gnc/mainwindow-file.cpp b/src/gnc/mainwindow-file.cpp index 4acabd3603..daf21cd0bf 100644 --- a/src/gnc/mainwindow-file.cpp +++ b/src/gnc/mainwindow-file.cpp @@ -312,7 +312,7 @@ bool MainWindow::show_session_error (QWidget *parent, static void 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 ------------- */ /* -- this code is almost identical in FileOpen and FileSaveAs -- */ m_session.call_close_hooks(); - gnc_hook_run(HOOK_BOOK_CLOSED, m_session.get()); - qof_session_destroy(m_session.get()); + gnc_hook_run(HOOK_BOOK_CLOSED, m_session.gobj()); + qof_session_destroy(m_session.gobj()); m_session.reset(); /* load the accounts from the users datafile */ @@ -415,7 +415,7 @@ void MainWindow::loadFile(const QString &fileName) else if (msgBox.clickedButton() == createNewFile) { /* 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. */ newFile(); @@ -592,7 +592,7 @@ bool MainWindow::saveFileAs(const QString &fileName) } QByteArray newfile = newfile_qstring.toUtf8(); - QofSession *session = m_session.get(); + QofSession *session = m_session.gobj(); if (m_session.get_url() == fileName) { 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 */ /* close up the old file session (if any) */ qof_session_swap_data (session, new_session); - qof_session_destroy(m_session.get()); + qof_session_destroy(m_session.gobj()); m_session.reset(); session = NULL; @@ -703,9 +703,9 @@ static bool been_here_before = false; 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()) return on_actionSave_as_triggered(); @@ -726,7 +726,7 @@ bool MainWindow::saveFile() progress_functor functor(&progressBar); // 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. statusBar()->removeWidget(&progressBar); @@ -754,7 +754,7 @@ bool MainWindow::saveFile() } xaccReopenLog(); - gnc_hook_run(HOOK_BOOK_SAVED, m_session.get()); + gnc_hook_run(HOOK_BOOK_SAVED, m_session.gobj()); documentCleanStateChanged(true); statusBar()->showMessage(tr("File saved"), 5000); diff --git a/src/gnc/mainwindow.cpp b/src/gnc/mainwindow.cpp index 1f238685e3..9ecd79f3c4 100644 --- a/src/gnc/mainwindow.cpp +++ b/src/gnc/mainwindow.cpp @@ -122,9 +122,9 @@ 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(); } } @@ -576,10 +576,10 @@ void MainWindow::closeEvent(QCloseEvent *event) * transactions during shutdown would cause massive redraws */ qof_event_suspend (); - qof_session_call_close_hooks(m_session.get()); - gnc_hook_run(HOOK_BOOK_CLOSED, m_session.get()); + qof_session_call_close_hooks(m_session.gobj()); + gnc_hook_run(HOOK_BOOK_CLOSED, m_session.gobj()); - qof_session_destroy(m_session.get()); + qof_session_destroy(m_session.gobj()); m_session.reset(); qof_event_resume (); @@ -598,13 +598,13 @@ void MainWindow::newFile() if (m_session) { /* 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 (); 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(); qof_event_resume (); } @@ -615,7 +615,7 @@ void MainWindow::newFile() gnc_hook_run(HOOK_NEW_BOOK, NULL); /* 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(""); }