The Birdfont Source Code


All Repositories / birdfont.git / blobdiff – RSS feed

Case insensitive search in overview

Changes made to libbirdfont/CharDatabaseParser.vala

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
--- libbirdfont/CharDatabaseParser.vala +++ libbirdfont/CharDatabaseParser.vala @@ -102,9 +102,10 @@ public void insert_lookup (int64 character, string word) { string? errmsg; + string w = word.down (); string query = """ INSERT INTO Words (unicode, word) - VALUES (""" + @"$((int64) character)" + """, '""" + word.replace ("'", "''") + "');"; + VALUES (""" + @"$((int64) character)" + """, '""" + w.replace ("'", "''") + "');"; int ec = db.exec (query, null, out errmsg); if (ec != Sqlite.OK) { stderr.printf (query); @@ -163,7 +164,6 @@ unicode_hex = e[0].up (); ch = Font.to_unichar ("U+" + unicode_hex.down ()); - stdout.printf ("Adding " + (!) ch.to_string () + "\n"); insert_entry ((int64) ch, data); utf8.add_single (ch); @@ -217,9 +217,7 @@ add_entry (description); transaction_number++; - if (transaction_number >= 1000) { - print ("Write to database\n"); - + if (transaction_number >= 1000) { ec = db.exec ("END TRANSACTION", null, out errmsg); if (ec != Sqlite.OK) { warning ("Error: %s\n", (!) errmsg);