r21480 - gnucash/branches/2.4/src/gnc - Revert r21479, "[Cutecash] Rename get() member to gobj()..." - wrong branch.
Christian Stimming
cstim at code.gnucash.org
Sat Oct 22 16:06:56 EDT 2011
Author: cstim
Date: 2011-10-22 16:06:55 -0400 (Sat, 22 Oct 2011)
New Revision: 21480
Trac: http://svn.gnucash.org/trac/changeset/21480
Modified:
gnucash/branches/2.4/src/gnc/Account.hpp
gnucash/branches/2.4/src/gnc/AccountItemModel.cpp
gnucash/branches/2.4/src/gnc/AccountSelectionDelegate.cpp
gnucash/branches/2.4/src/gnc/Book.cpp
gnucash/branches/2.4/src/gnc/Cmd.cpp
gnucash/branches/2.4/src/gnc/Cmd.hpp
gnucash/branches/2.4/src/gnc/Commodity.hpp
gnucash/branches/2.4/src/gnc/GncInstance.hpp
gnucash/branches/2.4/src/gnc/Numeric.cpp
gnucash/branches/2.4/src/gnc/Session.cpp
gnucash/branches/2.4/src/gnc/Session.hpp
gnucash/branches/2.4/src/gnc/Split.cpp
gnucash/branches/2.4/src/gnc/Split.hpp
gnucash/branches/2.4/src/gnc/SplitListModel.cpp
gnucash/branches/2.4/src/gnc/SplitListView.cpp
gnucash/branches/2.4/src/gnc/Transaction.cpp
gnucash/branches/2.4/src/gnc/Transaction.hpp
gnucash/branches/2.4/src/gnc/WeakPointer.hpp
gnucash/branches/2.4/src/gnc/mainwindow-file.cpp
gnucash/branches/2.4/src/gnc/mainwindow.cpp
Log:
Revert r21479, "[Cutecash] Rename get() member to gobj()..." - wrong branch.
Modified: gnucash/branches/2.4/src/gnc/Account.hpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Account.hpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Account.hpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -59,25 +59,25 @@
Account(element_type* ptr = 0)
: base_class(ptr)
{ }
- 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()); }
+ 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()); }
- ::SplitList* getSplitList() const { return xaccAccountGetSplitList(gobj()); }
+ ::SplitList* getSplitList() const { return xaccAccountGetSplitList(get()); }
/** @name Account tree traversal */
//@{
- 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); }
+ 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); }
/** 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.gobj())
- return gnc_account_child_index(parent.gobj(), gobj());
+ if (parent.get())
+ return gnc_account_child_index(parent.get(), get());
else
return 0;
}
- gint get_current_depth () const { return gnc_account_get_current_depth(gobj()); }
- gint get_tree_depth () const { return gnc_account_get_tree_depth(gobj()); }
+ gint get_current_depth () const { return gnc_account_get_current_depth(get()); }
+ gint get_tree_depth () const { return gnc_account_get_tree_depth(get()); }
//@}
Modified: gnucash/branches/2.4/src/gnc/AccountItemModel.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/AccountItemModel.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/AccountItemModel.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -50,10 +50,10 @@
parentItem.reset(static_cast< ::Account*>(parent.internalPointer()));
Account childItem = parentItem.nth_child(row);
- if (childItem.gobj())
+ if (childItem.get())
{
//qDebug() << "returning" << childItem.getName();
- return createIndex(row, column, childItem.gobj());
+ return createIndex(row, column, childItem.get());
}
else
return QModelIndex();
@@ -68,10 +68,10 @@
Account childItem(static_cast< ::Account*>(index.internalPointer()));
Account parentItem(childItem.get_parent());
- if (parentItem.gobj() == m_root.gobj())
+ if (parentItem.get() == m_root.get())
return QModelIndex();
- return createIndex(parentItem.child_index(), 0, parentItem.gobj());
+ return createIndex(parentItem.child_index(), 0, parentItem.get());
}
int AccountTreeModel::rowCount(const QModelIndex& parent) const
@@ -120,8 +120,8 @@
return account.getDescription();
case 3:
{
- Numeric balance = gnc_ui_account_get_balance(account.gobj(), false);
- PrintAmountInfo printInfo(account.gobj(), true);
+ Numeric balance = gnc_ui_account_get_balance(account.get(), false);
+ PrintAmountInfo printInfo(account.get(), true);
return balance.printAmount(printInfo);
}
default:
@@ -207,10 +207,10 @@
return QModelIndex();
Account childItem = m_list.at(row);
- if (childItem.gobj())
+ if (childItem.get())
{
//qDebug() << "returning" << childItem.getName();
- return createIndex(row, column, childItem.gobj());
+ return createIndex(row, column, childItem.get());
}
else
return QModelIndex();
Modified: gnucash/branches/2.4/src/gnc/AccountSelectionDelegate.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/AccountSelectionDelegate.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/AccountSelectionDelegate.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -88,7 +88,7 @@
{
const AccountListModel* amodel = dynamic_cast<const AccountListModel*>(comboBox->model());
Q_ASSERT(amodel);
- comboBox->setCurrentIndex(amodel->indexOf(acc.gobj()));
+ comboBox->setCurrentIndex(amodel->indexOf(acc.get()));
}
}
else
Modified: gnucash/branches/2.4/src/gnc/Book.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Book.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Book.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -28,7 +28,7 @@
{
Account Book::get_root_account()
{
- return Account(gnc_book_get_root_account (gobj()));
+ return Account(gnc_book_get_root_account (get()));
}
} // END namespace gnc
Modified: gnucash/branches/2.4/src/gnc/Cmd.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Cmd.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Cmd.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -105,7 +105,7 @@
const value_type& newValue,
QUndoCommand *parent = 0)
: base_class(text, parent)
- , m_target(targetPtr.gobj())
+ , m_target(targetPtr.get())
, 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.gobj())
+ , m_target(targetPtr.get())
, m_previousValue(m_target)
, m_book(m_target.getBook())
{
@@ -210,7 +210,7 @@
virtual void redo()
{
- xaccTransDestroy(m_target.gobj());
+ xaccTransDestroy(m_target.get());
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.gobj());
+ t.getAccount(), newValue.get());
}
QUndoCommand* setSplitReconcile(TmpSplit& t, char newValue)
{
@@ -437,7 +437,7 @@
virtual void undo()
{
- xaccTransDestroy(m_created.gobj());
+ xaccTransDestroy(m_created.get());
m_created.reset();
}
Modified: gnucash/branches/2.4/src/gnc/Cmd.hpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Cmd.hpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Cmd.hpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -88,7 +88,7 @@
const value_type& newValue,
QUndoCommand *parent = 0)
: base_class(text, parent)
- , m_target(targetPtr.gobj())
+ , m_target(targetPtr.get())
, 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.gobj())
+ , m_target(targetPtr.get())
, m_setter(setter)
, m_previousValue(previousValue)
, m_newValue(newValue)
Modified: gnucash/branches/2.4/src/gnc/Commodity.hpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Commodity.hpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Commodity.hpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -46,17 +46,17 @@
Commodity(element_type *ptr = 0)
: base_class(ptr)
{}
- 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()); }
+ 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()); }
- int get_fraction() const { return gnc_commodity_get_fraction(gobj()); }
- bool get_quote_flag() const { return gnc_commodity_get_quote_flag(gobj()); }
+ int get_fraction() const { return gnc_commodity_get_fraction(get()); }
+ bool get_quote_flag() const { return gnc_commodity_get_quote_flag(get()); }
- bool is_currency() const { return gnc_commodity_is_currency(gobj()); }
+ bool is_currency() const { return gnc_commodity_is_currency(get()); }
- bool equal(const Commodity& other) const { return gnc_commodity_equal(gobj(), other.gobj()); }
+ bool equal(const Commodity& other) const { return gnc_commodity_equal(get(), other.get()); }
};
inline bool operator==(const Commodity& a, const Commodity& b)
Modified: gnucash/branches/2.4/src/gnc/GncInstance.hpp
===================================================================
--- gnucash/branches/2.4/src/gnc/GncInstance.hpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/GncInstance.hpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -54,15 +54,15 @@
: base_class(ptr)
{ }
- 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())); }
+ 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())); }
- 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 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 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())); }
+ //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())); }
};
} // END namespace gnc
Modified: gnucash/branches/2.4/src/gnc/Numeric.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Numeric.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Numeric.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -36,10 +36,10 @@
// headers
PrintAmountInfo::PrintAmountInfo(const Account& account, bool use_symbol)
- : base_class(gnc_account_print_info(account.gobj(), use_symbol))
+ : base_class(gnc_account_print_info(account.get(), use_symbol))
{}
PrintAmountInfo::PrintAmountInfo(const Split& split, bool use_symbol)
- : base_class(gnc_split_amount_print_info(split.gobj(), use_symbol))
+ : base_class(gnc_split_amount_print_info(split.get(), use_symbol))
{}
QString Numeric::printAmount(const PrintAmountInfo& info) const
Modified: gnucash/branches/2.4/src/gnc/Session.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Session.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Session.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -33,7 +33,7 @@
Book Session::get_book () const
{
- return Book(qof_session_get_book(gobj()));
+ return Book(qof_session_get_book(get()));
}
Modified: gnucash/branches/2.4/src/gnc/Session.hpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Session.hpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Session.hpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -60,49 +60,49 @@
void begin(const QString& book_id, bool ignore_lock, bool create_if_nonexistent, bool force)
{
- qof_session_begin(gobj(), book_id.toUtf8(), ignore_lock, create_if_nonexistent, force);
+ qof_session_begin(get(), book_id.toUtf8(), ignore_lock, create_if_nonexistent, force);
}
void load (QofPercentageFunc percentage_func)
{
- qof_session_load(gobj(), percentage_func);
+ qof_session_load(get(), percentage_func);
}
QofBackendError get_error ()
{
- return qof_session_get_error(gobj());
+ return qof_session_get_error(get());
}
QofBackendError pop_error ()
{
- return qof_session_pop_error(gobj());
+ return qof_session_pop_error(get());
}
QString get_error_message() const
{
- return QString::fromUtf8(qof_session_get_error_message(gobj()));
+ return QString::fromUtf8(qof_session_get_error_message(get()));
}
Book get_book () const;
QString get_file_path () const
{
- return QString::fromUtf8(qof_session_get_file_path(gobj()));
+ return QString::fromUtf8(qof_session_get_file_path(get()));
}
QString get_url() const
{
- return QString::fromUtf8(qof_session_get_url(gobj()));
+ return QString::fromUtf8(qof_session_get_url(get()));
}
bool save_in_progress() const
{
- return qof_session_save_in_progress(gobj());
+ return qof_session_save_in_progress(get());
}
void save (QofPercentageFunc percentage_func)
{
- qof_session_save(gobj(), percentage_func);
+ qof_session_save(get(), percentage_func);
}
void call_close_hooks ()
{
- qof_session_call_close_hooks (gobj());
+ qof_session_call_close_hooks (get());
}
Modified: gnucash/branches/2.4/src/gnc/Split.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Split.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Split.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -29,17 +29,17 @@
namespace gnc
{
-Account Split::getAccount() const { return xaccSplitGetAccount(gobj()); }
-void Split::setAccount(Account acc) { xaccSplitSetAccount(gobj(), acc.gobj()); }
-void Split::setAccount(::Account* acc) { xaccSplitSetAccount(gobj(), acc); }
+Account Split::getAccount() const { return xaccSplitGetAccount(get()); }
+void Split::setAccount(Account acc) { xaccSplitSetAccount(get(), acc.get()); }
+void Split::setAccount(::Account* acc) { xaccSplitSetAccount(get(), acc); }
-Transaction Split::getParent() const { return xaccSplitGetParent(gobj()); }
-void Split::setParent(Transaction& trans) { xaccSplitSetParent(gobj(), trans.gobj()); }
+Transaction Split::getParent() const { return xaccSplitGetParent(get()); }
+void Split::setParent(Transaction& trans) { xaccSplitSetParent(get(), trans.get()); }
TmpSplit::TmpSplit(const Split& s, const TmpTransaction* parent_trans)
- : m_account(s.getAccount().gobj())
+ : m_account(s.getAccount().get())
, 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().gobj()));
+ Split s(xaccMallocSplit(t.getBook().get()));
s.setAccount(m_account);
s.setParent(t);
s.setMemo(m_memo);
Modified: gnucash/branches/2.4/src/gnc/Split.hpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Split.hpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Split.hpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -70,32 +70,32 @@
Transaction getParent() const;
void setParent(Transaction& trans);
- QString getMemo() const { return QString::fromUtf8(xaccSplitGetMemo(gobj())); }
- void setMemo(const QString& v) { xaccSplitSetMemo(gobj(), v.toUtf8()); }
+ QString getMemo() const { return QString::fromUtf8(xaccSplitGetMemo(get())); }
+ void setMemo(const QString& v) { xaccSplitSetMemo(get(), v.toUtf8()); }
- QString getAction() const { return QString::fromUtf8(xaccSplitGetAction(gobj())); }
- void setAction(const QString& v) { xaccSplitSetAction(gobj(), v.toUtf8()); }
+ QString getAction() const { return QString::fromUtf8(xaccSplitGetAction(get())); }
+ void setAction(const QString& v) { xaccSplitSetAction(get(), v.toUtf8()); }
- char getReconcile() const { return xaccSplitGetReconcile(gobj()); }
- void setReconcile(char v) { xaccSplitSetReconcile(gobj(), v); }
+ char getReconcile() const { return xaccSplitGetReconcile(get()); }
+ void setReconcile(char v) { xaccSplitSetReconcile(get(), v); }
- Split getOtherSplit() const { return xaccSplitGetOtherSplit(gobj()); }
+ Split getOtherSplit() const { return xaccSplitGetOtherSplit(get()); }
QString getCorrAccountFullName() const
{
- return gchar_to_QString(xaccSplitGetCorrAccountFullName(gobj()));
+ return gchar_to_QString(xaccSplitGetCorrAccountFullName(get()));
}
- QString getCorrAccountName() const { return QString::fromUtf8(xaccSplitGetCorrAccountName(gobj())); }
- QString getCorrAccountCode() const { return QString::fromUtf8(xaccSplitGetCorrAccountCode(gobj())); }
+ QString getCorrAccountName() const { return QString::fromUtf8(xaccSplitGetCorrAccountName(get())); }
+ QString getCorrAccountCode() const { return QString::fromUtf8(xaccSplitGetCorrAccountCode(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()); }
+ 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()); }
Modified: gnucash/branches/2.4/src/gnc/SplitListModel.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/SplitListModel.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/SplitListModel.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -65,7 +65,7 @@
m_hash.clear();
for (int k = 0; k < m_list.size(); ++k)
{
- m_hash.insert(Split(m_list[k]).getParent().gobj(), k);
+ m_hash.insert(Split(m_list[k]).getParent().get(), 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.gobj());
+ oursplit.setAccount(m_account.get());
Q_ASSERT(m_tmpTransaction.countSplits() == 2);
- Q_ASSERT(oursplit.getAccount() == m_account.gobj());
+ Q_ASSERT(oursplit.getAccount() == m_account.get());
Q_ASSERT(othersplit.getAccount() == NULL);
}
@@ -105,10 +105,10 @@
return createIndex(row, column, (void*)NULL);
Split childItem = m_list.at(row);
- if (childItem.gobj())
+ if (childItem.get())
{
//qDebug() << "returning" << childItem.getName();
- return createIndex(row, column, childItem.gobj());
+ return createIndex(row, column, childItem.get());
}
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.gobj(), split.getAccount().gobj());
+ Numeric amount = split.getValue(); // Alternatively: xaccSplitConvertAmount(split.get(), split.getAccount().get());
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.gobj());
+ Q_ASSERT(split.getAccount() == m_account.get());
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.gobj())
+ if (acc != m_account.get())
return;
//qDebug() << "SplitListModel::accountEvent, id=" << qofEventToString(event_type);
Modified: gnucash/branches/2.4/src/gnc/SplitListView.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/SplitListView.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/SplitListView.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -86,7 +86,7 @@
void SplitListView::accountEvent( ::Account* v, QofEventId event_type)
{
- if (v != m_account.gobj())
+ if (v != m_account.get())
return;
//qDebug() << "SplitListView::accountEvent, id=" << qofEventToString(event_type);
switch (event_type)
Modified: gnucash/branches/2.4/src/gnc/Transaction.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Transaction.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Transaction.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -28,23 +28,23 @@
Split Transaction::findSplitByAccount(const Account& acc) const
{
- return xaccTransFindSplitByAccount(gobj(), acc.gobj());
+ return xaccTransFindSplitByAccount(get(), acc.get());
}
Split Transaction::getSplit(int i) const
{
- return xaccTransGetSplit(gobj(), i);
+ return xaccTransGetSplit(get(), i);
}
void Transaction::appendSplit(Split& split)
{
- xaccSplitSetParent(split.gobj(), gobj());
+ xaccSplitSetParent(split.get(), get());
}
int Transaction::getSplitIndex(const Split& split) const
{
- return xaccTransGetSplitIndex(gobj(), split.gobj());
+ return xaccTransGetSplitIndex(get(), split.get());
}
Transaction::element_type* Transaction::newInstance(const Book& b)
{
- return xaccMallocTransaction (b.gobj());
+ return xaccMallocTransaction (b.get());
}
// ////////////////////////////////////////////////////////////
Modified: gnucash/branches/2.4/src/gnc/Transaction.hpp
===================================================================
--- gnucash/branches/2.4/src/gnc/Transaction.hpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/Transaction.hpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -62,39 +62,39 @@
: base_class(ptr)
{ }
- void beginEdit() { xaccTransBeginEdit(gobj()); }
- void commitEdit() { xaccTransCommitEdit(gobj()); }
- void rollbackEdit() { xaccTransRollbackEdit(gobj()); }
- bool isOpen() const { return xaccTransIsOpen(gobj()); }
+ void beginEdit() { xaccTransBeginEdit(get()); }
+ void commitEdit() { xaccTransCommitEdit(get()); }
+ void rollbackEdit() { xaccTransRollbackEdit(get()); }
+ bool isOpen() const { return xaccTransIsOpen(get()); }
- QString getNum() const { return QString::fromUtf8(xaccTransGetNum(gobj())); }
- void setNum(const QString& v) { xaccTransSetNum(gobj(), v.toUtf8()); }
+ QString getNum() const { return QString::fromUtf8(xaccTransGetNum(get())); }
+ void setNum(const QString& v) { xaccTransSetNum(get(), v.toUtf8()); }
- QString getDescription() const { return QString::fromUtf8(xaccTransGetDescription(gobj())); }
- void setDescription(const QString& v) { xaccTransSetDescription(gobj(), v.toUtf8()); }
+ QString getDescription() const { return QString::fromUtf8(xaccTransGetDescription(get())); }
+ void setDescription(const QString& v) { xaccTransSetDescription(get(), v.toUtf8()); }
- QString getNotes() const { return QString::fromUtf8(xaccTransGetNotes(gobj())); }
- void setNotes(const QString& v) { xaccTransSetNotes(gobj(), v.toUtf8()); }
+ QString getNotes() const { return QString::fromUtf8(xaccTransGetNotes(get())); }
+ void setNotes(const QString& v) { xaccTransSetNotes(get(), v.toUtf8()); }
- int countSplits() const { return xaccTransCountSplits(gobj()); }
+ int countSplits() const { return xaccTransCountSplits(get()); }
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(gobj()); }
+ ::SplitList* getSplitList() const { return xaccTransGetSplitList(get()); }
- Commodity getCurrency() const { return xaccTransGetCurrency(gobj()); }
- void setCurrency(const Commodity& c) { xaccTransSetCurrency(gobj(), c.gobj()); }
+ Commodity getCurrency() const { return xaccTransGetCurrency(get()); }
+ void setCurrency(const Commodity& c) { xaccTransSetCurrency(get(), c.get()); }
- Numeric getImbalanceValue() const { return xaccTransGetImbalanceValue(gobj()); }
- bool isBalanced() const { return xaccTransIsBalanced(gobj()); }
- Numeric getAccountConvRate(const Account& acc) const { return xaccTransGetAccountConvRate(gobj(), acc.gobj()); }
+ Numeric getImbalanceValue() const { return xaccTransGetImbalanceValue(get()); }
+ bool isBalanced() const { return xaccTransIsBalanced(get()); }
+ Numeric getAccountConvRate(const Account& acc) const { return xaccTransGetAccountConvRate(get(), acc.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())); }
+ 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())); }
static element_type* newInstance(const Book& b);
};
Modified: gnucash/branches/2.4/src/gnc/WeakPointer.hpp
===================================================================
--- gnucash/branches/2.4/src/gnc/WeakPointer.hpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/WeakPointer.hpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -70,7 +70,7 @@
return m_ptr;
}
- T * gobj() const // never throws
+ T * get() const // never throws
{
return m_ptr;
}
Modified: gnucash/branches/2.4/src/gnc/mainwindow-file.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/mainwindow-file.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/mainwindow-file.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -309,7 +309,7 @@
static void
gnc_book_opened (Session& sess)
{
- gnc_hook_run(HOOK_BOOK_OPENED, sess.gobj());
+ gnc_hook_run(HOOK_BOOK_OPENED, sess.get());
}
@@ -373,8 +373,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.gobj());
- qof_session_destroy(m_session.gobj());
+ gnc_hook_run(HOOK_BOOK_CLOSED, m_session.get());
+ qof_session_destroy(m_session.get());
m_session.reset();
/* load the accounts from the users datafile */
@@ -412,7 +412,7 @@
else if (msgBox.clickedButton() == createNewFile)
{
/* Can't use the given file, so just create a new
- * database so that the user will gobj a window that
+ * database so that the user will get a window that
* they can click "Exit" on.
*/
newFile();
@@ -584,7 +584,7 @@
}
QByteArray newfile = newfile_qstring.toUtf8();
- QofSession *session = m_session.gobj();
+ QofSession *session = m_session.get();
if (m_session.get_url() == fileName)
{
return saveFile();
@@ -670,7 +670,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.gobj());
+ qof_session_destroy(m_session.get());
m_session.reset();
session = NULL;
@@ -695,9 +695,9 @@
bool MainWindow::saveFile()
{
- /* hack alert -- Somehow make sure all in-progress edits gobj committed! */
+ /* hack alert -- Somehow make sure all in-progress edits get committed! */
- /* If we don't have a filename/path to save to gobj one. */
+ /* If we don't have a filename/path to save to get one. */
if (m_session.get_url().isEmpty())
return on_actionSave_as_triggered();
@@ -718,7 +718,7 @@
progress_functor functor(&progressBar);
// The actual saving
- qof_session_save (m_session.gobj(), &progress_functor::static_func);
+ qof_session_save (m_session.get(), &progress_functor::static_func);
// Remove the progress bar again from the status bar.
statusBar()->removeWidget(&progressBar);
@@ -746,7 +746,7 @@
}
xaccReopenLog();
- gnc_hook_run(HOOK_BOOK_SAVED, m_session.gobj());
+ gnc_hook_run(HOOK_BOOK_SAVED, m_session.get());
documentCleanStateChanged(true);
statusBar()->showMessage(tr("File saved"), 5000);
Modified: gnucash/branches/2.4/src/gnc/mainwindow.cpp
===================================================================
--- gnucash/branches/2.4/src/gnc/mainwindow.cpp 2011-10-22 20:05:32 UTC (rev 21479)
+++ gnucash/branches/2.4/src/gnc/mainwindow.cpp 2011-10-22 20:06:55 UTC (rev 21480)
@@ -99,9 +99,9 @@
MainWindow::~MainWindow()
{
- if (m_session.gobj())
+ if (m_session.get())
{
- qof_session_destroy(m_session.gobj());
+ qof_session_destroy(m_session.get());
m_session.reset();
}
}
@@ -481,10 +481,10 @@
* transactions during shutdown would cause massive redraws */
qof_event_suspend ();
- qof_session_call_close_hooks(m_session.gobj());
- gnc_hook_run(HOOK_BOOK_CLOSED, m_session.gobj());
+ qof_session_call_close_hooks(m_session.get());
+ gnc_hook_run(HOOK_BOOK_CLOSED, m_session.get());
- qof_session_destroy(m_session.gobj());
+ qof_session_destroy(m_session.get());
m_session.reset();
qof_event_resume ();
@@ -503,13 +503,13 @@
if (m_session)
{
/* close any ongoing file sessions, and free the accounts.
- * disable events so we don't gobj spammed by redraws. */
+ * disable events so we don't get spammed by redraws. */
qof_event_suspend ();
m_session.call_close_hooks();
- gnc_hook_run(HOOK_BOOK_CLOSED, m_session.gobj());
+ gnc_hook_run(HOOK_BOOK_CLOSED, m_session.get());
- qof_session_destroy(m_session.gobj());
+ qof_session_destroy(m_session.get());
m_session.reset();
qof_event_resume ();
}
@@ -520,7 +520,7 @@
gnc_hook_run(HOOK_NEW_BOOK, NULL);
/* Call this after re-enabling events. */
- gnc_hook_run(HOOK_BOOK_OPENED, m_session.gobj());
+ gnc_hook_run(HOOK_BOOK_OPENED, m_session.get());
setCurrentFile("");
}
More information about the gnucash-changes
mailing list