r15812 - gnucash/branches/gobject-engine-dev-warlord - convert price/pricedb objects to GObject initialization

Derek Atkins warlord at cvs.gnucash.org
Wed Apr 4 20:24:41 EDT 2007


Author: warlord
Date: 2007-04-04 20:24:38 -0400 (Wed, 04 Apr 2007)
New Revision: 15812
Trac: http://svn.gnucash.org/trac/changeset/15812

Modified:
   gnucash/branches/gobject-engine-dev-warlord/
   gnucash/branches/gobject-engine-dev-warlord/src/backend/file/gnc-pricedb-xml-v2.c
   gnucash/branches/gobject-engine-dev-warlord/src/backend/file/io-gncxml-v1.c
   gnucash/branches/gobject-engine-dev-warlord/src/backend/postgres/price.c
   gnucash/branches/gobject-engine-dev-warlord/src/backend/postgres/table.m4
   gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-engine.h
   gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb-p.h
   gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c
   gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.h
   gnucash/branches/gobject-engine-dev-warlord/src/engine/test-core/test-engine-stuff.c
   gnucash/branches/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-price.c
   gnucash/branches/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-view-price.c
   gnucash/branches/gobject-engine-dev-warlord/src/gnome/dialog-price-editor.c
   gnucash/branches/gobject-engine-dev-warlord/src/gnome/druid-stock-split.c
   gnucash/branches/gobject-engine-dev-warlord/src/scm/price-quotes.scm
Log:
convert price/pricedb objects to GObject initialization
rename gnc_price_{get,set}_type() to _typestr() so it doesn't
conflict with the GType gnc_price_get_type() API.



Property changes on: gnucash/branches/gobject-engine-dev-warlord
___________________________________________________________________
Name: svk:merge
   - 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/swig-redo:802
3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/trunk:1037
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord:14369
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord1:14392
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:14282
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk2:13366
   + 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/swig-redo:802
3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/trunk:1037
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord:14369
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord1:14393
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:14282
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk2:13366

Modified: gnucash/branches/gobject-engine-dev-warlord/src/backend/file/gnc-pricedb-xml-v2.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/backend/file/gnc-pricedb-xml-v2.c	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/backend/file/gnc-pricedb-xml-v2.c	2007-04-05 00:24:38 UTC (rev 15812)
@@ -115,7 +115,7 @@
   } else if(safe_strcmp("price:type", (char*)sub_node->name) == 0) {
     char *text = dom_tree_to_text(sub_node);
     if(!text) return FALSE;
-    gnc_price_set_type(p, text);
+    gnc_price_set_typestr(p, text);
     g_free(text);
   } else if(safe_strcmp("price:value", (char*)sub_node->name) == 0) {
     gnc_numeric *value = dom_tree_to_gnc_numeric(sub_node);
@@ -406,7 +406,7 @@
     if(!add_child_or_kill_parent(price_xml, tmpnode)) return NULL;
   }
     
-  typestr = gnc_price_get_type(price);
+  typestr = gnc_price_get_typestr(price);
   if(typestr && (strlen(typestr) != 0)) {
     tmpnode = text_to_dom_tree("price:type", typestr);
     if(!add_child_or_kill_parent(price_xml, tmpnode)) return NULL;

Modified: gnucash/branches/gobject-engine-dev-warlord/src/backend/file/io-gncxml-v1.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/backend/file/io-gncxml-v1.c	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/backend/file/io-gncxml-v1.c	2007-04-05 00:24:38 UTC (rev 15812)
@@ -3585,7 +3585,7 @@
   } else if(safe_strcmp("price:type", (char*)sub_node->name) == 0) {
     char *text = dom_tree_to_text(sub_node);
     if(!text) return FALSE;
-    gnc_price_set_type(p, text);
+    gnc_price_set_typestr(p, text);
     g_free(text);
   } else if(safe_strcmp("price:value", (char*)sub_node->name) == 0) {
     gnc_numeric *value = dom_tree_to_gnc_numeric(sub_node);

Modified: gnucash/branches/gobject-engine-dev-warlord/src/backend/postgres/price.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/backend/postgres/price.c	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/backend/postgres/price.c	2007-04-05 00:24:38 UTC (rev 15812)
@@ -307,7 +307,7 @@
    gnc_price_set_time (pr, ts);
 
    gnc_price_set_source (pr, DB_GET_VAL("source",j));
-   gnc_price_set_type (pr, DB_GET_VAL("type",j));
+   gnc_price_set_typestr (pr, DB_GET_VAL("type",j));
 
    num = strtoll (DB_GET_VAL("valueNum", j), NULL, 0);
    denom = strtoll (DB_GET_VAL("valueDenom", j), NULL, 0);

Modified: gnucash/branches/gobject-engine-dev-warlord/src/backend/postgres/table.m4
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/backend/postgres/table.m4	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/backend/postgres/table.m4	2007-04-05 00:24:38 UTC (rev 15812)
@@ -73,7 +73,7 @@
        currency,     , commod,   gnc_commodity_get_unique_name(gnc_price_get_currency(ptr)),
        time,         , Timespec, gnc_price_get_time(ptr),
        source,       , char *,   gnc_price_get_source(ptr),
-       type,         , char *,   gnc_price_get_type(ptr),
+       type,         , char *,   gnc_price_get_typestr(ptr),
        valueNum,     , int64,    gnc_numeric_num(gnc_price_get_value(ptr)),
        valueDenom,   , int64,    gnc_numeric_denom(gnc_price_get_value(ptr)),
        version,      , int32,    gnc_price_get_version(ptr),

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-engine.h
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-engine.h	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-engine.h	2007-04-05 00:24:38 UTC (rev 15812)
@@ -196,9 +196,6 @@
 typedef struct gnc_price_s           GNCPrice;
 typedef struct gnc_quote_source_s    gnc_quote_source;
 
-#define GNC_IS_PRICE(obj)  (QOF_CHECK_TYPE((obj), GNC_ID_PRICE))
-#define GNC_PRICE(obj)     (QOF_CHECK_CAST((obj), GNC_ID_PRICE, GNCPrice))
-
 /** GList of Account */
 typedef GList                  AccountList;
 /** GList of GNCLots */

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb-p.h
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb-p.h	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb-p.h	2007-04-05 00:24:38 UTC (rev 15812)
@@ -49,8 +49,11 @@
   guint32  refcount;             /* garbage collection reference count */
 };
 
+struct _GncPriceClass
+{
+  QofInstanceClass parent_class;
+};
 
-
 struct gnc_price_db_s
 {
   QofInstance inst;              /* globally unique object identifier */
@@ -58,6 +61,11 @@
   gboolean bulk_update;		 /* TRUE while reading XML file, etc. */
 };
 
+struct _GncPriceDBClass
+{
+  QofInstanceClass parent_class;
+};
+
 /* These structs define the kind of price lookup being done
  * so that it can be passed to the backend.  This is a rather
  * cheesy, low-brow interface.  It could stand improvement.

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c	2007-04-05 00:24:38 UTC (rev 15812)
@@ -35,6 +35,19 @@
 static gboolean add_price(GNCPriceDB *db, GNCPrice *p);
 static gboolean remove_price(GNCPriceDB *db, GNCPrice *p, gboolean cleanup);
 
+/* GObject Initialization */
+QOF_GOBJECT_IMPL(gnc_price, GNCPrice, QOF_TYPE_INSTANCE);
+
+static void
+gnc_price_init(GNCPrice* price)
+{
+}
+
+static void
+gnc_price_finalize_real(GObject* pricep)
+{
+}
+
 /* ==================================================================== */
 /* GNCPrice functions
  */
@@ -47,7 +60,7 @@
 
   g_return_val_if_fail (book, NULL);
 
-  p = g_new0(GNCPrice, 1);
+  p = g_object_new(GNC_TYPE_PRICE, NULL);
 
   p->refcount = 1;
   p->version = 0;
@@ -56,7 +69,7 @@
   p->type = NULL;
   p->source = NULL;
 
-  qof_instance_init (&p->inst, GNC_ID_PRICE, book);
+  qof_instance_init_data (&p->inst, GNC_ID_PRICE, book);
   qof_event_gen (&p->inst, QOF_EVENT_CREATE, NULL);
 
   return p;
@@ -71,9 +84,8 @@
   if(p->type) CACHE_REMOVE(p->type);
   if(p->source) CACHE_REMOVE(p->source);
 
-  qof_instance_release (&p->inst);
-  memset(p, 0, sizeof(GNCPrice));
-  g_free(p);
+  /* qof_instance_release (&p->inst); */
+  g_object_unref(p);
   LEAVE (" ");
 }
 
@@ -126,7 +138,7 @@
   gnc_price_set_commodity(new_p, gnc_price_get_commodity(p));
   gnc_price_set_time(new_p, gnc_price_get_time(p));
   gnc_price_set_source(new_p, gnc_price_get_source(p));
-  gnc_price_set_type(new_p, gnc_price_get_type(p));
+  gnc_price_set_typestr(new_p, gnc_price_get_typestr(p));
   gnc_price_set_value(new_p, gnc_price_get_value(p));
   gnc_price_set_currency(new_p, gnc_price_get_currency(p));
   gnc_price_commit_edit(new_p);
@@ -261,7 +273,7 @@
 }
 
 void
-gnc_price_set_type(GNCPrice *p, const char* type)
+gnc_price_set_typestr(GNCPrice *p, const char* type)
 {
   if(!p) return;
   if(safe_strcmp(p->type, type) != 0)
@@ -339,7 +351,7 @@
 }
 
 const char *
-gnc_price_get_type(GNCPrice *p)
+gnc_price_get_typestr(GNCPrice *p)
 {
   if(!p) return NULL;
   return p->type;
@@ -396,8 +408,8 @@
                    gnc_price_get_source (p2)) != 0)
     return FALSE;
 
-  if (safe_strcmp (gnc_price_get_type (p1),
-                   gnc_price_get_type (p2)) != 0)
+  if (safe_strcmp (gnc_price_get_typestr (p1),
+                   gnc_price_get_typestr (p2)) != 0)
     return FALSE;
 
   if (!gnc_numeric_eq (gnc_price_get_value (p1),
@@ -555,6 +567,19 @@
    that the value is expressed in terms of.
  */
 
+/* GObject Initialization */
+QOF_GOBJECT_IMPL(gnc_pricedb, GNCPriceDB, QOF_TYPE_INSTANCE);
+
+static void
+gnc_pricedb_init(GNCPriceDB* pdb)
+{
+}
+
+static void
+gnc_pricedb_finalize_real(GObject* pdbp)
+{
+}
+
 static GNCPriceDB *
 gnc_pricedb_create(QofBook * book)
 {
@@ -574,8 +599,8 @@
     return result;
   }
 
-  result = g_new0(GNCPriceDB, 1);
-  qof_instance_init (&result->inst, GNC_ID_PRICEDB, book);
+  result = g_object_new(GNC_TYPE_PRICEDB, NULL);
+  qof_instance_init_data (&result->inst, GNC_ID_PRICEDB, book);
   qof_collection_mark_clean(col);
 
   /** \todo This leaks result when the collection is destroyed.  When
@@ -631,8 +656,8 @@
   }
   g_hash_table_destroy (db->commodity_hash);
   db->commodity_hash = NULL;
-  qof_instance_release (&db->inst);
-  g_free(db);
+  /* qof_instance_release (&db->inst); */
+  g_object_unref(db);
 }
 
 void
@@ -2268,7 +2293,7 @@
   str = gnc_price_get_source(p);
   str = str ? str : "(null)";
   fprintf(f, "%s  %s\n", istr, str);
-  str = gnc_price_get_type(p);
+  str = gnc_price_get_typestr(p);
   str = str ? str : "(null)";
   fprintf(f, "%s  %s\n", istr, str);
   fprintf(f, "%s  %g\n", istr, gnc_numeric_to_double(gnc_price_get_value(p)));
@@ -2452,7 +2477,7 @@
     { PRICE_CURRENCY, GNC_ID_COMMODITY, (QofAccessFunc)gnc_price_get_currency, (QofSetterFunc)gnc_price_set_currency },
     { PRICE_DATE, QOF_TYPE_DATE, (QofAccessFunc)gnc_price_get_time, (QofSetterFunc)gnc_price_set_time },
     { PRICE_SOURCE, QOF_TYPE_STRING, (QofAccessFunc)gnc_price_get_source, (QofSetterFunc)gnc_price_set_source },
-    { PRICE_TYPE, QOF_TYPE_STRING, (QofAccessFunc)gnc_price_get_type, (QofSetterFunc)gnc_price_set_type },
+    { PRICE_TYPE, QOF_TYPE_STRING, (QofAccessFunc)gnc_price_get_typestr, (QofSetterFunc)gnc_price_set_typestr },
     { PRICE_VALUE, QOF_TYPE_NUMERIC, (QofAccessFunc)gnc_price_get_value, (QofSetterFunc)gnc_price_set_value },
     { NULL },
   };

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.h
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.h	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/gnc-pricedb.h	2007-04-05 00:24:38 UTC (rev 15812)
@@ -23,11 +23,43 @@
 #ifndef GNC_PRICEDB_H
 #define GNC_PRICEDB_H
 
+typedef struct _GncPriceClass GNCPriceClass;
+typedef struct _GncPriceDBClass GNCPriceDBClass;
+
 #include <stdio.h>
 #include "qof.h"
 #include "gnc-commodity.h"
 #include "gnc-engine.h"
 
+/* --- type macros --- */
+#define GNC_TYPE_PRICE            (gnc_price_get_type ())
+#define GNC_PRICE(o)              \
+     (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PRICE, GNCPrice))
+#define GNC_PRICE_CLASS(k)        \
+     (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_PRICE, GNCPriceClass))
+#define GNC_IS_PRICE(o)           \
+     (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PRICE))
+#define GNC_IS_PRICE_CLASS(k)     \
+     (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_PRICE))
+#define GNC_PRICE_GET_CLASS(o)    \
+     (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_PRICE, GNCPriceClass))
+GType gnc_price_get_type(void);
+
+/* --- type macros --- */
+#define GNC_TYPE_PRICEDB            (gnc_pricedb_get_type ())
+#define GNC_PRICEDB(o)              \
+     (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PRICEDB, GNCPriceDB))
+#define GNC_PRICEDB_CLASS(k)        \
+     (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_PRICEDB, GNCPriceDBClass))
+#define GNC_IS_PRICEDB(o)           \
+     (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PRICEDB))
+#define GNC_IS_PRICEDB_CLASS(k)     \
+     (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_PRICEDB))
+#define GNC_PRICEDB_GET_CLASS(o)    \
+     (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_PRICEDB, GNCPriceDBClass))
+GType gnc_pricedb_get_type(void);
+
+
 /** @addtogroup PriceDB
     @{ */
 /** @file gnc-pricedb.h
@@ -150,7 +182,7 @@
    around (i.e. increase its reference count by 1). */
 void      gnc_price_ref(GNCPrice *p);
 
-/** gnc_price_ref - indicate you're finished with a price
+/** gnc_price_unref - indicate you're finished with a price
    (i.e. decrease its reference count by 1). */
 void      gnc_price_unref(GNCPrice *p);
 /**  @} */
@@ -176,7 +208,7 @@
 void gnc_price_set_currency(GNCPrice *p, gnc_commodity *c);
 void gnc_price_set_time(GNCPrice *p, Timespec t);
 void gnc_price_set_source(GNCPrice *p, const char *source);
-void gnc_price_set_type(GNCPrice *p, const char* type);
+void gnc_price_set_typestr(GNCPrice *p, const char* type);
 void gnc_price_set_value(GNCPrice *p, gnc_numeric value);
 void gnc_price_set_version(GNCPrice *p, gint32 versn);
 /**  @} */
@@ -192,7 +224,7 @@
 gnc_commodity * gnc_price_get_currency(GNCPrice *p);
 Timespec        gnc_price_get_time(GNCPrice *p);
 const char *    gnc_price_get_source(GNCPrice *p);
-const char *    gnc_price_get_type(GNCPrice *p);
+const char *    gnc_price_get_typestr(GNCPrice *p);
 gnc_numeric     gnc_price_get_value(GNCPrice *p);
 gint32          gnc_price_get_version(GNCPrice *p);
 gboolean        gnc_price_equal(GNCPrice *p1, GNCPrice *p2);

Modified: gnucash/branches/gobject-engine-dev-warlord/src/engine/test-core/test-engine-stuff.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/engine/test-core/test-engine-stuff.c	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/engine/test-core/test-engine-stuff.c	2007-04-05 00:24:38 UTC (rev 15812)
@@ -662,7 +662,7 @@
   g_free (string);
 
   string = get_random_string ();
-  gnc_price_set_type (p, string);
+  gnc_price_set_typestr (p, string);
   g_free (string);
 
   gnc_price_set_value (p, get_random_gnc_numeric ());

Modified: gnucash/branches/gobject-engine-dev-warlord/src/gnome/dialog-price-editor.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/gnome/dialog-price-editor.c	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/gnome/dialog-price-editor.c	2007-04-05 00:24:38 UTC (rev 15812)
@@ -127,7 +127,7 @@
     currency = gnc_price_get_currency (pedit_dialog->price);
     date = gnc_price_get_time (pedit_dialog->price);
     source = gnc_price_get_source (pedit_dialog->price);
-    type = gnc_price_get_type (pedit_dialog->price);
+    type = gnc_price_get_typestr (pedit_dialog->price);
     value = gnc_price_get_value (pedit_dialog->price);
   }
   else
@@ -196,7 +196,7 @@
   gnc_price_set_commodity (pedit_dialog->price, commodity);
   gnc_price_set_currency (pedit_dialog->price, currency);
   gnc_price_set_time (pedit_dialog->price, date);
-  gnc_price_set_type (pedit_dialog->price, type);
+  gnc_price_set_typestr (pedit_dialog->price, type);
   gnc_price_set_value (pedit_dialog->price, value);
   gnc_price_commit_edit (pedit_dialog->price);
 

Modified: gnucash/branches/gobject-engine-dev-warlord/src/gnome/druid-stock-split.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/gnome/druid-stock-split.c	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/gnome/druid-stock-split.c	2007-04-05 00:24:38 UTC (rev 15812)
@@ -474,7 +474,7 @@
     gnc_price_set_currency (price, gnc_currency_edit_get_currency (ce));
     gnc_price_set_time (price, ts);
     gnc_price_set_source (price, "user:stock-split");
-    gnc_price_set_type (price, "unknown");
+    gnc_price_set_typestr (price, "unknown");
     gnc_price_set_value (price, amount);
     gnc_price_commit_edit (price);
 

Modified: gnucash/branches/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-price.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-price.c	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-price.c	2007-04-05 00:24:38 UTC (rev 15812)
@@ -712,7 +712,7 @@
 			break;
 		case GNC_TREE_MODEL_PRICE_COL_TYPE:
 			g_value_init (value, G_TYPE_STRING);
-			g_value_set_string (value, gnc_price_get_type (price));
+			g_value_set_string (value, gnc_price_get_typestr (price));
 			break;
 		case GNC_TREE_MODEL_PRICE_COL_VALUE:
 			g_value_init (value, G_TYPE_STRING);

Modified: gnucash/branches/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-view-price.c
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-view-price.c	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-view-price.c	2007-04-05 00:24:38 UTC (rev 15812)
@@ -329,8 +329,8 @@
     return sort_ns_or_cm (f_model, f_iter_a, f_iter_b);
 
   /* sort by source first */
-  result = safe_utf8_collate (gnc_price_get_type (price_a),
-			      gnc_price_get_type (price_b));
+  result = safe_utf8_collate (gnc_price_get_typestr (price_a),
+			      gnc_price_get_typestr (price_b));
   if (result != 0)
     return result;
 

Modified: gnucash/branches/gobject-engine-dev-warlord/src/scm/price-quotes.scm
===================================================================
--- gnucash/branches/gobject-engine-dev-warlord/src/scm/price-quotes.scm	2007-04-05 00:24:28 UTC (rev 15811)
+++ gnucash/branches/gobject-engine-dev-warlord/src/scm/price-quotes.scm	2007-04-05 00:24:38 UTC (rev 15812)
@@ -585,7 +585,7 @@
                   (gnc-price-set-currency gnc-price currency)
                   (gnc-price-set-time gnc-price gnc-time)
                   (gnc-price-set-source gnc-price "Finance::Quote")
-                  (gnc-price-set-type gnc-price price-type)
+                  (gnc-price-set-typestr gnc-price price-type)
                   (gnc-price-set-value gnc-price price)
                   gnc-price))))))
 



More information about the gnucash-changes mailing list