r21481 - gnucash/trunk/src/gnc - [Cutecash] Rename get() member to gobj() to increase compatibility to future gtkmm wrappers.

Christian Stimming cstim at code.gnucash.org
Sat Oct 22 16:10:08 EDT 2011


Author: cstim
Date: 2011-10-22 16:10:08 -0400 (Sat, 22 Oct 2011)
New Revision: 21481
Trac: http://svn.gnucash.org/trac/changeset/21481

Modified:
   gnucash/trunk/src/gnc/Account.hpp
   gnucash/trunk/src/gnc/AccountItemModel.cpp
   gnucash/trunk/src/gnc/AccountSelectionDelegate.cpp
   gnucash/trunk/src/gnc/Book.cpp
   gnucash/trunk/src/gnc/Cmd.cpp
   gnucash/trunk/src/gnc/Cmd.hpp
   gnucash/trunk/src/gnc/Commodity.hpp
   gnucash/trunk/src/gnc/GncInstance.hpp
   gnucash/trunk/src/gnc/Numeric.cpp
   gnucash/trunk/src/gnc/Session.cpp
   gnucash/trunk/src/gnc/Session.hpp
   gnucash/trunk/src/gnc/Split.cpp
   gnucash/trunk/src/gnc/Split.hpp
   gnucash/trunk/src/gnc/SplitListModel.cpp
   gnucash/trunk/src/gnc/SplitListView.cpp
   gnucash/trunk/src/gnc/Transaction.cpp
   gnucash/trunk/src/gnc/Transaction.hpp
   gnucash/trunk/src/gnc/WeakPointer.hpp
   gnucash/trunk/src/gnc/mainwindow-file.cpp
   gnucash/trunk/src/gnc/mainwindow.cpp
Log:
[Cutecash] Rename get() member to gobj() to increase compatibility to future gtkmm wrappers.

Modified: gnucash/trunk/src/gnc/Account.hpp
===================================================================
--- gnucash/trunk/src/gnc/Account.hpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Account.hpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -59,25 +59,25 @@
     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 @@
     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()); }
     //@}
 
 

Modified: gnucash/trunk/src/gnc/AccountItemModel.cpp
===================================================================
--- gnucash/trunk/src/gnc/AccountItemModel.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/AccountItemModel.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -50,10 +50,10 @@
         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 @@
     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 @@
             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 @@
         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();

Modified: gnucash/trunk/src/gnc/AccountSelectionDelegate.cpp
===================================================================
--- gnucash/trunk/src/gnc/AccountSelectionDelegate.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/AccountSelectionDelegate.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -88,7 +88,7 @@
         {
             const AccountListModel* amodel = dynamic_cast<const AccountListModel*>(comboBox->model());
             Q_ASSERT(amodel);
-            comboBox->setCurrentIndex(amodel->indexOf(acc.get()));
+            comboBox->setCurrentIndex(amodel->indexOf(acc.gobj()));
         }
     }
     else

Modified: gnucash/trunk/src/gnc/Book.cpp
===================================================================
--- gnucash/trunk/src/gnc/Book.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Book.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -28,7 +28,7 @@
 {
 Account Book::get_root_account()
 {
-    return Account(gnc_book_get_root_account (get()));
+    return Account(gnc_book_get_root_account (gobj()));
 }
 
 } // END namespace gnc

Modified: gnucash/trunk/src/gnc/Cmd.cpp
===================================================================
--- gnucash/trunk/src/gnc/Cmd.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Cmd.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -105,7 +105,7 @@
                            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 @@
                           WeakPointer<target_type::element_type>& 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 @@
 
     virtual void redo()
     {
-        xaccTransDestroy(m_target.get());
+        xaccTransDestroy(m_target.gobj());
         m_target.reset();
     }
 
@@ -313,7 +313,7 @@
 {
     return new CmdRef<TmpSplit, ::Account*, void(TmpSplit::*)(::Account*)>(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 @@
 
     virtual void undo()
     {
-        xaccTransDestroy(m_created.get());
+        xaccTransDestroy(m_created.gobj());
         m_created.reset();
     }
 

Modified: gnucash/trunk/src/gnc/Cmd.hpp
===================================================================
--- gnucash/trunk/src/gnc/Cmd.hpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Cmd.hpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -88,7 +88,7 @@
         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 @@
         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)

Modified: gnucash/trunk/src/gnc/Commodity.hpp
===================================================================
--- gnucash/trunk/src/gnc/Commodity.hpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Commodity.hpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -46,17 +46,17 @@
     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)

Modified: gnucash/trunk/src/gnc/GncInstance.hpp
===================================================================
--- gnucash/trunk/src/gnc/GncInstance.hpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/GncInstance.hpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -54,15 +54,15 @@
             : 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

Modified: gnucash/trunk/src/gnc/Numeric.cpp
===================================================================
--- gnucash/trunk/src/gnc/Numeric.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Numeric.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -36,10 +36,10 @@
 // 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

Modified: gnucash/trunk/src/gnc/Session.cpp
===================================================================
--- gnucash/trunk/src/gnc/Session.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Session.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -33,7 +33,7 @@
 
 Book Session::get_book () const
 {
-    return Book(qof_session_get_book(get()));
+    return Book(qof_session_get_book(gobj()));
 }
 
 

Modified: gnucash/trunk/src/gnc/Session.hpp
===================================================================
--- gnucash/trunk/src/gnc/Session.hpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Session.hpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -60,49 +60,49 @@
 
     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());
     }
 
 

Modified: gnucash/trunk/src/gnc/Split.cpp
===================================================================
--- gnucash/trunk/src/gnc/Split.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Split.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -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::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);

Modified: gnucash/trunk/src/gnc/Split.hpp
===================================================================
--- gnucash/trunk/src/gnc/Split.hpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Split.hpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -70,32 +70,32 @@
     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()); }
 
 
 

Modified: gnucash/trunk/src/gnc/SplitListModel.cpp
===================================================================
--- gnucash/trunk/src/gnc/SplitListModel.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/SplitListModel.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -65,7 +65,7 @@
     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 @@
     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 @@
         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 @@
 
         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 @@
 
         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::accountEvent( ::Account* acc, QofEventId event_type)
 {
-    if (acc != m_account.get())
+    if (acc != m_account.gobj())
         return;
     //qDebug() << "SplitListModel::accountEvent, id=" << qofEventToString(event_type);
 

Modified: gnucash/trunk/src/gnc/SplitListView.cpp
===================================================================
--- gnucash/trunk/src/gnc/SplitListView.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/SplitListView.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -86,7 +86,7 @@
 
 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)

Modified: gnucash/trunk/src/gnc/Transaction.cpp
===================================================================
--- gnucash/trunk/src/gnc/Transaction.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Transaction.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -28,23 +28,23 @@
 
 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());
 }
 
 // ////////////////////////////////////////////////////////////

Modified: gnucash/trunk/src/gnc/Transaction.hpp
===================================================================
--- gnucash/trunk/src/gnc/Transaction.hpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/Transaction.hpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -62,39 +62,39 @@
             : 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);
 };

Modified: gnucash/trunk/src/gnc/WeakPointer.hpp
===================================================================
--- gnucash/trunk/src/gnc/WeakPointer.hpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/WeakPointer.hpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -70,7 +70,7 @@
         return m_ptr;
     }
 
-    T * get() const // never throws
+    T * gobj() const // never throws
     {
         return m_ptr;
     }

Modified: gnucash/trunk/src/gnc/mainwindow-file.cpp
===================================================================
--- gnucash/trunk/src/gnc/mainwindow-file.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/mainwindow-file.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -312,7 +312,7 @@
 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 @@
     /* -------------- 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 @@
         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 @@
     }
     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 @@
     /* 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 @@
 
 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 @@
         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 @@
     }
 
     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);

Modified: gnucash/trunk/src/gnc/mainwindow.cpp
===================================================================
--- gnucash/trunk/src/gnc/mainwindow.cpp	2011-10-22 20:06:55 UTC (rev 21480)
+++ gnucash/trunk/src/gnc/mainwindow.cpp	2011-10-22 20:10:08 UTC (rev 21481)
@@ -122,9 +122,9 @@
 
 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 @@
          * 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 @@
         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 @@
         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("");
     }



More information about the gnucash-changes mailing list