head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.12 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.10 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.8 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.6 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.4 pkgsrc-2009Q4-base:1.2 pkgsrc-2008Q4:1.2.0.2 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.1.0.34 pkgsrc-2008Q3-base:1.1 cube-native-xorg:1.1.0.32 cube-native-xorg-base:1.1 pkgsrc-2008Q2:1.1.0.30 pkgsrc-2008Q2-base:1.1 cwrapper:1.1.0.28 pkgsrc-2008Q1:1.1.0.26 pkgsrc-2008Q1-base:1.1 pkgsrc-2007Q4:1.1.0.24 pkgsrc-2007Q4-base:1.1 pkgsrc-2007Q3:1.1.0.22 pkgsrc-2007Q3-base:1.1 pkgsrc-2007Q2:1.1.0.20 pkgsrc-2007Q2-base:1.1 pkgsrc-2007Q1:1.1.0.18 pkgsrc-2007Q1-base:1.1 pkgsrc-2006Q4:1.1.0.16 pkgsrc-2006Q4-base:1.1 pkgsrc-2006Q3:1.1.0.14 pkgsrc-2006Q3-base:1.1 pkgsrc-2006Q2:1.1.0.12 pkgsrc-2006Q2-base:1.1 pkgsrc-2006Q1:1.1.0.10 pkgsrc-2006Q1-base:1.1 pkgsrc-2005Q4:1.1.0.8 pkgsrc-2005Q4-base:1.1 pkgsrc-2005Q3:1.1.0.6 pkgsrc-2005Q3-base:1.1 pkgsrc-2005Q2:1.1.0.4 pkgsrc-2005Q2-base:1.1 pkgsrc-2005Q1:1.1.0.2 pkgsrc-2005Q1-base:1.1; locks; strict; comment @# @; 1.2 date 2008.10.28.23.38.34; author wiz; state dead; branches; next 1.1; 1.1 date 2005.03.16.12.48.49; author rillig; state Exp; branches; next ; desc @@ 1.2 log @Update to 2.3.0: New in the 2.3.0 Release: ------------------------- The main changes in this release are: * a new implementation of the projects tree using the GtkTreeView component which fixes a lot of the bugs regarding the projects tree manipulation and prepares the way for many customizations in future releases. * an initial implementation of a tray icon that displays timer status and allows the user to toggle the timer by clicking on it. * a rewrite of the idle detection using the XScreenSaver extension and of the timer system to make it more system power conservation friendly. * port of the report system to use guile version 1.8. * many changes in the configure script, including porperly checking for guile and gconf and version of available DBUS. * removal of some deprecated APIs usage. In addition, many bugs have been fixed, including: * broken behavior of drag-and-drop (#1856268) * compiles but crashes on startup in fedora core 5 (#1802501) * activity journal truncates seconds (#1706365) * green bar flickers when value changes (#1171204) * dragging project to make sub-project will not scroll (#831808) New in the 2.2.3 Release: ------------------------- This release brings better internationalization in reports with locale based formating of times and monetary values. The newly added support for DBus messages allows users to start/stop the timer and save/reload the data file from the command line using the gnotime-remote script. Also, an update user's manual covers most of the features available in this version. In addition, many bugs have been fixed, including: -- Crash when saving to full filesystem (#1548248) -- Day of century calculation error causing skipped day in reports -- Conflicting keybindings (#1639477) -- Invoice report doesn't work in locales other than C -- Hidden question dialog when overwriting file during report saving (http://bugs.debian.org/422023) @ text @$NetBSD: patch-as,v 1.1 2005/03/16 12:48:49 rillig Exp $ gcc-2.95.3 does not like code intermixed with declarations. --- lib/qof/qofsql.c.orig Sun May 23 22:58:28 2004 +++ lib/qof/qofsql.c Wed Mar 16 10:21:03 2005 @@@@ -134,8 +134,7 @@@@ dequote_string (char *str) ('\"' == str[0])) { str ++; - size_t len = strlen(str); - str[len-1] = 0; + str[strlen(str)-1] = 0; } return str; } @@@@ -145,7 +144,14 @@@@ handle_single_condition (QofSqlQuery *qu { char tmpbuff[128]; GSList *param_list; + QofQuery *qq; QofQueryPredData *pred_data = NULL; + sql_field_item *sparam, *svalue; + char *qparam_name, *qvalue_name; + char *table_name; + char *param_name; + QofType param_type; + QofQueryCompare qop; if (NULL == cond) { @@@@ -161,14 +167,14 @@@@ handle_single_condition (QofSqlQuery *qu PWARN("missing left paramter"); return NULL; } - sql_field_item * sparam = cond->d.pair.left->item; + sparam = cond->d.pair.left->item; if (SQL_name != sparam->type) { PWARN("we support only paramter names at this time (parsed %d)", sparam->type); return NULL; } - char * qparam_name = sparam->d.name->data; + qparam_name = sparam->d.name->data; if (NULL == qparam_name) { PWARN ("missing paramter name"); @@@@ -183,13 +189,13 @@@@ handle_single_condition (QofSqlQuery *qu PWARN ("missing right paramter"); return NULL; } - sql_field_item * svalue = cond->d.pair.right->item; + svalue = cond->d.pair.right->item; if (SQL_name != svalue->type) { PWARN("we support only simple values (parsed as %d)", svalue->type); return NULL; } - char * qvalue_name = svalue->d.name->data; + qvalue_name = svalue->d.name->data; if (NULL == qvalue_name) { PWARN("missing value"); @@@@ -202,16 +208,18 @@@@ handle_single_condition (QofSqlQuery *qu * If it is, look up the value. */ if (0 == strncasecmp (qvalue_name, "kvp://", 6)) { + KvpValue *kv; + KvpValueType kvt; if (NULL == query->kvp_join) { PWARN ("missing kvp frame"); return NULL; } - KvpValue *kv = kvp_frame_get_value (query->kvp_join, qvalue_name+5); + kv = kvp_frame_get_value (query->kvp_join, qvalue_name+5); /* If there's no value, its not an error; * we just don't do this predicate */ if (!kv) return NULL; - KvpValueType kvt = kvp_value_get_type (kv); + kvt = kvp_value_get_type (kv); tmpbuff[0] = 0x0; qvalue_name = tmpbuff; @@@@ -251,7 +259,6 @@@@ handle_single_condition (QofSqlQuery *qu param_list = qof_query_build_param_list (qparam_name, NULL); /* Get the where-term comparison operator */ - QofQueryCompare qop; switch (cond->op) { case SQL_eq: qop = QOF_COMPARE_EQUAL; break; @@@@ -270,8 +277,6 @@@@ handle_single_condition (QofSqlQuery *qu /* OK, need to know the type of the thing being matched * in order to build the correct predicate. Get the type * from the object parameters. */ - char *table_name; - char *param_name; get_table_and_param (qparam_name, &table_name, ¶m_name); if (NULL == table_name) { @@@@ -290,7 +295,7 @@@@ handle_single_condition (QofSqlQuery *qu return NULL; } - QofType param_type = qof_class_get_parameter_type (table_name, param_name); + param_type = qof_class_get_parameter_type (table_name, param_name); if (!param_type) { PWARN ("The parameter \'%s\' on object \'%s\' is not known", @@@@ -334,19 +339,20 @@@@ handle_single_condition (QofSqlQuery *qu } else if (!strcmp (param_type, QOF_TYPE_DATE)) { + time_t exact; + int rc; + Timespec ts; // XXX FIXME: this doesn't handle time strings, only date strings // XXX should also see if we need to do a day-compare or time-compare. /* work around highly bogus locale setting */ qof_date_format_set(QOF_DATE_FORMAT_US); - time_t exact; - int rc = qof_scan_date_secs (qvalue_name, &exact); + qof_scan_date_secs (qvalue_name, &exact); if (0 == rc) { PWARN ("unable to parse date: %s", qvalue_name); return NULL; } - Timespec ts; ts.tv_sec = exact; ts.tv_nsec = 0; pred_data = qof_query_date_predicate (qop, QOF_DATE_MATCH_DAY, ts); @@@@ -367,6 +373,8 @@@@ handle_single_condition (QofSqlQuery *qu else if (!strcmp (param_type, QOF_TYPE_GUID)) { GUID guid; + QofGuidMatch gm; + GList *guid_list; gboolean rc = string_to_guid (qvalue_name, &guid); if (0 == rc) { @@@@ -377,9 +385,9 @@@@ handle_single_condition (QofSqlQuery *qu // XXX less, than greater than don't make sense, // should check for those bad conditions - QofGuidMatch gm = QOF_GUID_MATCH_ANY; + gm = QOF_GUID_MATCH_ANY; if (QOF_COMPARE_NEQ == qop) gm = QOF_GUID_MATCH_NONE; - GList *guid_list = g_list_append (NULL, &guid); + guid_list = g_list_append (NULL, &guid); pred_data = qof_query_guid_predicate (gm, guid_list); g_list_free (guid_list); @@@@ -389,12 +397,14 @@@@ handle_single_condition (QofSqlQuery *qu /* We are expecting an encoded value that looks like * /some/path/string:value */ - char *sep = strchr (qvalue_name, ':'); + char *path, *str, *p, *sep; + KvpValue *kval; + int len; + sep = strchr (qvalue_name, ':'); if (!sep) return NULL; *sep = 0; - char * path = qvalue_name; - char * str = sep +1; - char * p; + path = qvalue_name; + str = sep +1; /* If str has only digits, we know its a plain number. * If its numbers and a decimal point, assume a float * If its numbers and a slash, assume numeric @@@@ -402,8 +412,8 @@@@ handle_single_condition (QofSqlQuery *qu * If it looks like an iso date ... * else assume its a string. */ - KvpValue *kval = NULL; - int len = strlen (str); + kval = NULL; + len = strlen (str); if ((32 == len) && (32 == strspn (str, "0123456789abcdef"))) { GUID guid; @@@@ -455,7 +465,7 @@@@ handle_single_condition (QofSqlQuery *qu return NULL; } - QofQuery *qq = qof_query_create(); + qq = qof_query_create(); qof_query_add_term (qq, param_list, pred_data, QOF_QUERY_FIRST_TERM); return qq; } @@@@ -471,9 +481,10 @@@@ handle_where (QofSqlQuery *query, sql_wh { QofQuery *qleft = handle_where (query, swear->d.pair.left); QofQuery *qright = handle_where (query, swear->d.pair.right); + QofQueryOp qop; + QofQuery *qq; if (NULL == qleft) return qright; if (NULL == qright) return qleft; - QofQueryOp qop; switch (swear->d.pair.op) { case SQL_and: qop = QOF_QUERY_AND; break; @@@@ -484,7 +495,7 @@@@ handle_where (QofSqlQuery *query, sql_wh qof_query_destroy (qright); return NULL; } - QofQuery * qq = qof_query_merge (qleft, qright, qop); + qq = qof_query_merge (qleft, qright, qop); qof_query_destroy (qleft); qof_query_destroy (qright); return qq; @@@@ -511,12 +522,12 @@@@ handle_where (QofSqlQuery *query, sql_wh static void handle_sort_order (QofSqlQuery *query, GList *sorder_list) { - if (!sorder_list) return; - GSList *qsp[3]; gboolean direction[3]; int i; + if (!sorder_list) return; + for (i=0; i<3; i++) { qsp[i] = NULL; @@@@ -524,14 +535,15 @@@@ handle_sort_order (QofSqlQuery *query, G if (sorder_list) { + char * qparam_name = NULL; + GList *n; sql_order_field *sorder = sorder_list->data; /* Set the sort direction */ if (SQL_asc == sorder->order_type) direction[i] = TRUE; /* Find the paramter name */ - char * qparam_name = NULL; - GList *n = sorder->name; + n = sorder->name; if (n) { qparam_name = n->data; @@@@ -559,6 +571,10 @@@@ handle_sort_order (QofSqlQuery *query, G void qof_sql_query_parse (QofSqlQuery *query, const char *str) { + GList *tables; + sql_select_statement *sss; + sql_where *swear; + if (!query) return; /* Delete old query, if any */ @@@@ -590,14 +606,14 @@@@ qof_sql_query_parse (QofSqlQuery *query, * user wrote "SELECT * FROM tableA, tableB WHERE ..." * then we don't have a single unique table-name. */ - GList *tables = sql_statement_get_tables (query->parse_result); + tables = sql_statement_get_tables (query->parse_result); if (1 == g_list_length (tables)) { query->single_global_tablename = tables->data; } - sql_select_statement *sss = query->parse_result->statement; - sql_where * swear = sss->where; + sss = query->parse_result->statement; + swear = sss->where; if (swear) { /* Walk over the where terms, turn them into QOF predicates */ @@@@ -625,7 +641,7 @@@@ qof_sql_query_parse (QofSqlQuery *query, GList * qof_sql_query_run (QofSqlQuery *query, const char *str) { - GList *node; + GList *node, *results; if (!query) return NULL; @@@@ -635,7 +651,7 @@@@ qof_sql_query_run (QofSqlQuery *query, c qof_query_set_book (query->qof_query, query->book); // qof_query_print (query->qof_query); - GList *results = qof_query_run (query->qof_query); + results = qof_query_run (query->qof_query); return results; } @@@@ -643,7 +659,7 @@@@ qof_sql_query_run (QofSqlQuery *query, c GList * qof_sql_query_rerun (QofSqlQuery *query) { - GList *node; + GList *node, *results; if (!query) return NULL; @@@@ -652,7 +668,7 @@@@ qof_sql_query_rerun (QofSqlQuery *query) qof_query_set_book (query->qof_query, query->book); // qof_query_print (query->qof_query); - GList *results = qof_query_run (query->qof_query); + results = qof_query_run (query->qof_query); return results; } @ 1.1 log @Added patches to enable building with gcc-2.95.3. Approved by wiz. @ text @d1 1 a1 1 $NetBSD$ @