mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-10-25 07:37:39 -05:00
[engine] Remove the unused Transaction online_id property
The "online-id" GObject property on Transaction (KVP slot "online_id") was vestigial: GnuCash records the OFX/HBCI import identifier on the bank/asset Split, not on the Transaction. Drop the property, its get/set_property cases, the xaccTransClone special-case that cleared it, and the corresponding test_trans_kvp_properties coverage.
This commit is contained in:
1 parent
13112ab809
commit
222714d764
3 files changed
-27
No files matched your search
@@ -200,7 +200,6 @@ enum
|
||||
PROP_DESCRIPTION, /* Table */
|
||||
PROP_INVOICE, /* KVP */
|
||||
PROP_SX_TXN, /* KVP */
|
||||
PROP_ONLINE_ACCOUNT,/* KVP */
|
||||
};
|
||||
|
||||
void
|
||||
@@ -331,9 +330,6 @@ gnc_transaction_get_property(GObject* object,
|
||||
case PROP_SX_TXN:
|
||||
qof_instance_get_kvp (QOF_INSTANCE (tx), value, 1, GNC_SX_FROM);
|
||||
break;
|
||||
case PROP_ONLINE_ACCOUNT:
|
||||
qof_instance_get_kvp (QOF_INSTANCE (tx), value, 1, "online_id");
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
||||
break;
|
||||
@@ -379,9 +375,6 @@ gnc_transaction_set_property(GObject* object,
|
||||
case PROP_SX_TXN:
|
||||
qof_instance_set_kvp (QOF_INSTANCE (tx), value, 1, GNC_SX_FROM);
|
||||
break;
|
||||
case PROP_ONLINE_ACCOUNT:
|
||||
qof_instance_set_kvp (QOF_INSTANCE (tx), value, 1, "online_id");
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
||||
break;
|
||||
@@ -470,16 +463,6 @@ gnc_transaction_class_init(TransactionClass* klass)
|
||||
"transactions",
|
||||
GNC_TYPE_GUID,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property
|
||||
(gobject_class,
|
||||
PROP_ONLINE_ACCOUNT,
|
||||
g_param_spec_string ("online-id",
|
||||
"Online Account ID",
|
||||
"The online account which corresponds to this "
|
||||
"account for OFX/HCBI import",
|
||||
nullptr,
|
||||
G_PARAM_READWRITE));
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
@@ -678,9 +661,6 @@ xaccTransClone (const Transaction *from)
|
||||
xaccTransBeginEdit (to);
|
||||
qof_instance_copy_kvp (QOF_INSTANCE (to), QOF_INSTANCE (from));
|
||||
|
||||
/* But not the online-id! */
|
||||
qof_instance_set (QOF_INSTANCE (to), "online-id", nullptr, nullptr);
|
||||
|
||||
for (GList* lfrom = from->splits, *lto = to->splits; lfrom && lto;
|
||||
lfrom = g_list_next (lfrom), lto = g_list_next (lto))
|
||||
xaccSplitCopyKvp (GNC_SPLIT(lfrom->data), GNC_SPLIT(lto->data));
|
||||
|
||||
@@ -352,7 +352,6 @@ const char * xaccTransGetDocLink(const Transaction *trans);
|
||||
The Notes field is only visible in the register in double-line mode */
|
||||
const char * xaccTransGetNotes (const Transaction *trans);
|
||||
|
||||
|
||||
/** Sets whether or not this transaction is a "closing transaction" */
|
||||
void xaccTransSetIsClosingTxn (Transaction *trans, gboolean is_closing);
|
||||
|
||||
|
||||
@@ -189,14 +189,11 @@ test_trans_kvp_properties (Fixture *fixture, gconstpointer pData)
|
||||
GncGUID *invoice = guid_new ();
|
||||
GncGUID *from_sx = guid_new ();
|
||||
GncGUID *invoice_r, *from_sx_r;
|
||||
gchar *online_id = "my online id";
|
||||
gchar *online_id_r;
|
||||
|
||||
xaccTransBeginEdit (fixture->trans);
|
||||
qof_instance_set (QOF_INSTANCE (fixture->trans),
|
||||
"invoice", invoice,
|
||||
"from-sched-xaction", from_sx,
|
||||
"online-id", online_id,
|
||||
NULL);
|
||||
|
||||
g_assert_true (qof_instance_is_dirty (QOF_INSTANCE (fixture->trans)));
|
||||
@@ -205,17 +202,14 @@ test_trans_kvp_properties (Fixture *fixture, gconstpointer pData)
|
||||
qof_instance_get (QOF_INSTANCE (fixture->trans),
|
||||
"invoice", &invoice_r,
|
||||
"from-sched-xaction", &from_sx_r,
|
||||
"online-id", &online_id_r,
|
||||
NULL);
|
||||
g_assert_true (guid_equal (invoice, invoice_r));
|
||||
g_assert_true (guid_equal (from_sx, from_sx_r));
|
||||
g_assert_cmpstr (online_id, ==, online_id_r);
|
||||
g_assert_true (!qof_instance_is_dirty (QOF_INSTANCE (fixture->trans)));
|
||||
guid_free (invoice);
|
||||
guid_free (invoice_r);
|
||||
guid_free (from_sx);
|
||||
guid_free (from_sx_r);
|
||||
g_free (online_id_r);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in new issue
Block a user