From 74373eef3cbbd3279548580893edce8135b25fa7 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Sat, 3 Nov 2007 00:43:44 +0200 Subject: [PATCH] Misc --- docs/osm-indexes.sql | 2 ++ src/bt-maemo.c | 25 +++++++++++++++++++++++++ src/config-gconf.c | 29 ++++++++++++++++++++++++++--- src/file.c | 25 +++++++++++++++++++++++++ src/filter-gui.c | 22 ++++++++++++++++++++++ src/gps-browse.c | 25 +++++++++++++++++++++++++ src/gps-conn.c | 25 +++++++++++++++++++++++++ src/gps-nmea-parse.c | 25 +++++++++++++++++++++++++ src/gps-panels.c | 25 +++++++++++++++++++++++++ src/gps.c | 25 +++++++++++++++++++++++++ src/hildon-wrappers.c | 23 +++++++++++++++++++++++ src/iap.c | 25 +++++++++++++++++++++++++ src/latlon.c | 24 ++++++++++++++++++++++++ src/maemo-osso.c | 25 +++++++++++++++++++++++++ src/map-download.c | 25 +++++++++++++++++++++++++ src/map-repo.c | 25 +++++++++++++++++++++++++ src/mapper-types.h | 2 ++ src/osm-db.c | 6 ++++-- src/route.c | 8 ++------ src/track.h | 14 +++++++++----- 20 files changed, 389 insertions(+), 16 deletions(-) diff --git a/docs/osm-indexes.sql b/docs/osm-indexes.sql index 6d69c79..af28b57 100644 --- a/docs/osm-indexes.sql +++ b/docs/osm-indexes.sql @@ -8,8 +8,10 @@ CREATE INDEX node_ilat_idx on nodes (ilat); CREATE INDEX node_ilon_idx on nodes (ilon); CREATE INDEX way_name_idx on way_names (name); +CREATE INDEX way_norm_name_idx on way_names (norm); CREATE INDEX way_name_nls_id_idx on way_names_nls (wid); CREATE INDEX way_name_nls_name_idx on way_names_nls (name); +CREATE INDEX way_norm_nls_name_idx on way_names_nls (norm); CREATE INDEX way_ref_idx on way_ref (ref); diff --git a/src/bt-maemo.c b/src/bt-maemo.c index cabaafa..793b97b 100644 --- a/src/bt-maemo.c +++ b/src/bt-maemo.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #define _GNU_SOURCE diff --git a/src/config-gconf.c b/src/config-gconf.c index 70e3ea1..239c445 100644 --- a/src/config-gconf.c +++ b/src/config-gconf.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #define _GNU_SOURCE @@ -688,9 +713,7 @@ _conn_state = (_enable_gps ? RCVR_DOWN : RCVR_OFF); /* Load the route locations. */ { GSList *curr; - _loc_list = gconf_client_get_list(gconf_client, - GCONF_KEY_ROUTE_LOCATIONS, - GCONF_VALUE_STRING, NULL); + _loc_list = gconf_client_get_list(gconf_client, GCONF_KEY_ROUTE_LOCATIONS, GCONF_VALUE_STRING, NULL); _loc_model = gtk_list_store_new(1, G_TYPE_STRING); for (curr = _loc_list; curr != NULL; curr = curr->next) { GtkTreeIter iter; diff --git a/src/file.c b/src/file.c index 3c4f57b..7c3cab6 100644 --- a/src/file.c +++ b/src/file.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #define _GNU_SOURCE #include diff --git a/src/filter-gui.c b/src/filter-gui.c index 52aed2f..5889358 100644 --- a/src/filter-gui.c +++ b/src/filter-gui.c @@ -1,3 +1,25 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include "config.h" #define _GNU_SOURCE diff --git a/src/gps-browse.c b/src/gps-browse.c index b150cd0..85934fd 100644 --- a/src/gps-browse.c +++ b/src/gps-browse.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #define _GNU_SOURCE #include diff --git a/src/gps-conn.c b/src/gps-conn.c index b197eee..fb5d563 100644 --- a/src/gps-conn.c +++ b/src/gps-conn.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #define _GNU_SOURCE #include diff --git a/src/gps-nmea-parse.c b/src/gps-nmea-parse.c index b97a7ca..e1c3f74 100644 --- a/src/gps-nmea-parse.c +++ b/src/gps-nmea-parse.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #define _GNU_SOURCE #include diff --git a/src/gps-panels.c b/src/gps-panels.c index 73c08c0..72f8d07 100644 --- a/src/gps-panels.c +++ b/src/gps-panels.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #define _GNU_SOURCE diff --git a/src/gps.c b/src/gps.c index 22d254b..6e8cea5 100644 --- a/src/gps.c +++ b/src/gps.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include "gps.h" #include "utils.h" diff --git a/src/hildon-wrappers.c b/src/hildon-wrappers.c index 3f30537..635005f 100644 --- a/src/hildon-wrappers.c +++ b/src/hildon-wrappers.c @@ -1,3 +1,26 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + /**************************************************************************** * Hildon function Wrappers for non-hildon build ****************************************************************************/ diff --git a/src/iap.c b/src/iap.c index 3d14bed..61d243b 100644 --- a/src/iap.c +++ b/src/iap.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #include diff --git a/src/latlon.c b/src/latlon.c index 1d4e44f..e8a78d7 100644 --- a/src/latlon.c +++ b/src/latlon.c @@ -1,3 +1,27 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * + * Original Algorithms from misc web sites + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + /* * Different Lat/Lon and related functions * (conversion, distances, etc) diff --git a/src/maemo-osso.c b/src/maemo-osso.c index 7e2b57e..e794136 100644 --- a/src/maemo-osso.c +++ b/src/maemo-osso.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + /* * Maemo hardware specific functions */ diff --git a/src/map-download.c b/src/map-download.c index fa292fa..ef8668d 100644 --- a/src/map-download.c +++ b/src/map-download.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include "config.h" #define _GNU_SOURCE diff --git a/src/map-repo.c b/src/map-repo.c index bbacca5..00c2cde 100644 --- a/src/map-repo.c +++ b/src/map-repo.c @@ -1,3 +1,28 @@ +/* + * This file is part of mapper + * + * Copyright (C) 2007 Kaj-Michael Lang + * Copyright (C) 2006-2007 John Costigan. + * + * POI and GPS-Info code originally written by Cezary Jackiewicz. + * + * Default map data provided by http://www.openstreetmap.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #define _GNU_SOURCE diff --git a/src/mapper-types.h b/src/mapper-types.h index 5ebd7d9..6c776c2 100644 --- a/src/mapper-types.h +++ b/src/mapper-types.h @@ -19,6 +19,8 @@ typedef enum { ITEM_LABEL, ITEM_DESC, ITEM_CATLAB, + ITEM_ICON, + ITEM_COLOR, ITEM_NUM_COLUMNS } item_list_id; diff --git a/src/osm-db.c b/src/osm-db.c index 5193392..2663ffe 100644 --- a/src/osm-db.c +++ b/src/osm-db.c @@ -956,14 +956,16 @@ if (ltext) *store = gtk_list_store_new(ITEM_NUM_COLUMNS, G_TYPE_INT, /* ID */ - G_TYPE_INT, /* Category ID */ + G_TYPE_INT, /* */ G_TYPE_DOUBLE, /* Latitude */ G_TYPE_DOUBLE, /* Longitude */ G_TYPE_DOUBLE, /* Distance */ G_TYPE_STRING, /* Lat/Lon */ G_TYPE_STRING, /* Label */ G_TYPE_STRING, /* Desc. */ - G_TYPE_STRING); /* Category */ + G_TYPE_STRING, /* Category */ + G_TYPE_STRING, /* Dummy */ + G_TYPE_STRING); /* Dummy */ while (SQLITE_ROW == sqlite3_step(sql.select_way_name_search)) { gdouble rlat, rlon, dist; diff --git a/src/route.c b/src/route.c index ec690b0..beba259 100644 --- a/src/route.c +++ b/src/route.c @@ -453,17 +453,13 @@ while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) { if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(oti.rad_use_gps)) && !g_slist_find_custom(_loc_list, from, (GCompareFunc) strcmp)) { _loc_list = g_slist_prepend(_loc_list, g_strdup(from)); - gtk_list_store_insert_with_values(_loc_model, - &iter, INT_MAX, 0, from, -1); + gtk_list_store_insert_with_values(_loc_model, &iter, INT_MAX, 0, from, -1); } /* Save Destination in Route Locations list. */ if (!g_slist_find_custom(_loc_list, to, (GCompareFunc) strcmp)) { _loc_list = g_slist_prepend(_loc_list, g_strdup(to)); - gtk_list_store_insert_with_values(_loc_model, - &iter, - INT_MAX, 0, - to, -1); + gtk_list_store_insert_with_values(_loc_model, &iter, INT_MAX, 0, to, -1); } MACRO_BANNER_SHOW_INFO(_window, _("Route Downloaded")); diff --git a/src/track.h b/src/track.h index 5790168..20750de 100644 --- a/src/track.h +++ b/src/track.h @@ -4,16 +4,20 @@ #include #include -#define TRACK_SQL_SELECT_TRACKS "select id,name,sloc,eloc,sdate,edate from tracks order by sdate" +#define TRACK_SQL_SELECT_TRACKS "select id,name,slat,slon,elat,elon,len,sdate,edate from tracks order by sdate" #define TRACK_SQL_INSERT_TRACK "insert into tracks (id,name,sloc,sdate) values (?,?,?,?); #define TRACK_SQL_INSERT_TRACK_POINT "insert into trackpoints (tid,dt,lat,lon,alt,hdop,vdop,pdop,sat,fix) values (?,?,?,?,?,?,?,?,?,?)" #define TRACK_SQL_SELECT_TRACK_POINTS "select tid,dt,lat,lon,alt,hdop,vdop,pdop,sat,fix from trackpoints where tid=? order by dt" struct { - sqlite3_stmt *_insert_track; - sqlite3_stmt *_select_tracks; - sqlite3_stmt *_insert_track_point; - sqlite3_stmt *_select_track_points; + sqlite3_stmt *insert_track; + sqlite3_stmt *select_tracks; + sqlite3_stmt *select_latest_track; + sqlite3_stmt *delete_track; + + sqlite3_stmt *insert_track_point; + sqlite3_stmt *select_track_points; + sqlite3_stmt *delete_track_points; } track_sql; void track_init(void); -- 2.39.5