minor bug fix

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4307 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 2001-05-27 17:50:24 +00:00
parent eb82429848
commit 7bb5353af0
2 changed files with 15 additions and 2 deletions

View File

@ -1389,6 +1389,7 @@ get_price_cb (PGBackend *be, PGresult *result, int j, gpointer data)
gint64 num, denom;
gnc_numeric value;
GUID guid = nullguid;
int not_found = 0;
gnc_commodity * modity;
@ -1401,11 +1402,13 @@ get_price_cb (PGBackend *be, PGresult *result, int j, gpointer data)
pr = gnc_price_create();
gnc_price_begin_edit (pr);
gnc_price_set_guid (pr, &guid);
not_found = 1;
}
else
{
gnc_price_ref (pr);
gnc_price_begin_edit (pr);
not_found = 0;
}
modity = gnc_string_to_commodity (DB_GET_VAL("commodity",j));
@ -1425,7 +1428,7 @@ get_price_cb (PGBackend *be, PGresult *result, int j, gpointer data)
value = gnc_numeric_create (num, denom);
gnc_price_set_value (pr, value);
gnc_pricedb_add_price(prdb, pr);
if (not_found) gnc_pricedb_add_price(prdb, pr);
gnc_price_commit_edit (pr);
gnc_price_unref (pr);
@ -2374,6 +2377,11 @@ pgend_session_begin (GNCBook *sess, const char * sessionid,
g_free (be->hostname);
be->hostname = NULL;
}
/* hack alert -- we should connect to template1 first, and look for an
entry in the system table pgdatabase i.e. SELECT datname FROM
pg_database; this should tell us if it exists already, or if it needs to
be created.
*/
be->connection = PQsetdbLogin (be->hostname,
be->portno,

View File

@ -153,7 +153,12 @@ Core bugs/features that still need work:
this. So something is marking teh data 'not saved'.
fix this (again ...)
-- allow user to enter URL in GUI dialog, get GUI to remember the URL
-- allow user to enter URL in GUI dialog. User can currently type url
into the file dialog window; it would be nice to have something
slightly nicer tan this.
-- change code for initial db access. We should query the pg_database
table to see if the database already exists.
-- Wire in the GUI to ask user for username/password to log onto the
server. (GUI already implemented, just not yet used).