[Gpredict-svn] SF.net SVN: gpredict:[961] trunk/src
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
From: <cs...@us...> - 2011-11-23 19:57:25
|
Revision: 961 http://gpredict.svn.sourceforge.net/gpredict/?rev=961&view=rev Author: csete Date: 2011-11-23 19:57:19 +0000 (Wed, 23 Nov 2011) Log Message: ----------- Bug 3441490: No need for keeping an escaped copy of nickname since we can fix escaping issues where they occur. Modified Paths: -------------- trunk/src/gtk-event-list-popup.c trunk/src/gtk-polar-view-popup.c trunk/src/gtk-polar-view.c trunk/src/gtk-sat-data.c trunk/src/gtk-sat-list-popup.c trunk/src/gtk-sat-map-popup.c trunk/src/gtk-sat-map.c trunk/src/gtk-single-sat.c trunk/src/sat-info.c trunk/src/sgpsdp/sgp4sdp4.h Modified: trunk/src/gtk-event-list-popup.c =================================================================== --- trunk/src/gtk-event-list-popup.c 2011-11-23 15:16:36 UTC (rev 960) +++ trunk/src/gtk-event-list-popup.c 2011-11-23 19:57:19 UTC (rev 961) @@ -65,7 +65,7 @@ menuitem = gtk_image_menu_item_new (); label = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); - buff = g_strdup_printf ("<b>%s</b>", sat->escapednickname); + buff = g_markup_printf_escaped ("<b>%s</b>", sat->nickname); gtk_label_set_markup (GTK_LABEL (label), buff); g_free (buff); gtk_container_add (GTK_CONTAINER (menuitem), label); Modified: trunk/src/gtk-polar-view-popup.c =================================================================== --- trunk/src/gtk-polar-view-popup.c 2011-11-23 15:16:36 UTC (rev 960) +++ trunk/src/gtk-polar-view-popup.c 2011-11-23 19:57:19 UTC (rev 961) @@ -82,7 +82,7 @@ menuitem = gtk_image_menu_item_new (); label = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); - buff = g_strdup_printf ("<b>%s</b>", sat->escapednickname); + buff = g_markup_printf_escaped ("<b>%s</b>", sat->nickname); gtk_label_set_markup (GTK_LABEL (label), buff); g_free (buff); gtk_container_add (GTK_CONTAINER (menuitem), label); Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2011-11-23 15:16:36 UTC (rev 960) +++ trunk/src/gtk-polar-view.c 2011-11-23 19:57:19 UTC (rev 961) @@ -884,13 +884,13 @@ g_object_set (obj->label,"text",sat->nickname,NULL); /* update tooltip */ - tooltip = g_strdup_printf("<big><b>%s</b>\n</big>"\ - "<tt>Az: %5.1f\302\260\n" \ - "El: %5.1f\302\260\n" \ - "%s</tt>", - sat->escapednickname, - sat->az, sat->el, - losstr); + tooltip = g_markup_printf_escaped("<big><b>%s</b>\n</big>"\ + "<tt>Az: %5.1f\302\260\n" \ + "El: %5.1f\302\260\n" \ + "%s</tt>", + sat->nickname, + sat->az, sat->el, + losstr); g_object_set (obj->marker, "x", x - MARKER_SIZE_HALF, @@ -977,12 +977,12 @@ SAT_CFG_INT_POLAR_SAT_COL); /* create tooltip */ - tooltip = g_strdup_printf("<big><b>%s</b>\n</big>" \ - "<tt>Az: %5.1f\302\260\n" \ - "El: %5.1f\302\260\n" \ - "</tt>", - sat->escapednickname, - sat->az, sat->el); + tooltip = g_markup_printf_escaped("<big><b>%s</b>\n</big>" \ + "<tt>Az: %5.1f\302\260\n" \ + "El: %5.1f\302\260\n" \ + "</tt>", + sat->nickname, + sat->az, sat->el); obj->marker = goo_canvas_rect_model_new (root, x - MARKER_SIZE_HALF, Modified: trunk/src/gtk-sat-data.c =================================================================== --- trunk/src/gtk-sat-data.c 2011-11-23 15:16:36 UTC (rev 960) +++ trunk/src/gtk-sat-data.c 2011-11-23 19:57:19 UTC (rev 961) @@ -95,7 +95,6 @@ g_clear_error (&error); sat->nickname = g_strdup (sat->name); } - sat->escapednickname = g_markup_escape_text (sat->nickname, -1); sat->website = g_key_file_get_string (data, "Satellite", "WEBSITE", NULL); /* website may be NULL */ Modified: trunk/src/gtk-sat-list-popup.c =================================================================== --- trunk/src/gtk-sat-list-popup.c 2011-11-23 15:16:36 UTC (rev 960) +++ trunk/src/gtk-sat-list-popup.c 2011-11-23 19:57:19 UTC (rev 961) @@ -66,7 +66,7 @@ menuitem = gtk_image_menu_item_new (); label = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); - buff = g_strdup_printf ("<b>%s</b>", sat->escapednickname); + buff = g_markup_printf_escaped ("<b>%s</b>", sat->nickname); gtk_label_set_markup (GTK_LABEL (label), buff); g_free (buff); gtk_container_add (GTK_CONTAINER (menuitem), label); Modified: trunk/src/gtk-sat-map-popup.c =================================================================== --- trunk/src/gtk-sat-map-popup.c 2011-11-23 15:16:36 UTC (rev 960) +++ trunk/src/gtk-sat-map-popup.c 2011-11-23 19:57:19 UTC (rev 961) @@ -82,7 +82,7 @@ menuitem = gtk_image_menu_item_new (); label = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); - buff = g_strdup_printf ("<b>%s</b>", sat->escapednickname); + buff = g_markup_printf_escaped("<b>%s</b>", sat->nickname); gtk_label_set_markup (GTK_LABEL (label), buff); g_free (buff); gtk_container_add (GTK_CONTAINER (menuitem), label); Modified: trunk/src/gtk-sat-map.c =================================================================== --- trunk/src/gtk-sat-map.c 2011-11-23 15:16:36 UTC (rev 960) +++ trunk/src/gtk-sat-map.c 2011-11-23 19:57:19 UTC (rev 961) @@ -749,17 +749,17 @@ cs = g_strdup (":"); if (h > 0) - buff = g_strdup_printf (_("<span background=\"#%s\"> "\ - "Next: %s in %s%d:%s%d%s%d </span>"), - satmap->infobgd, - sat->escapednickname, - ch, h, cm, m, cs, s); + buff = g_markup_printf_escaped(_("<span background=\"#%s\"> "\ + "Next: %s in %s%d:%s%d%s%d </span>"), + satmap->infobgd, + sat->nickname, + ch, h, cm, m, cs, s); else - buff = g_strdup_printf (_("<span background=\"#%s\"> " \ - "Next: %s in %s%d%s%d </span>"), - satmap->infobgd, - sat->escapednickname, - cm, m, cs, s); + buff = g_markup_printf_escaped(_("<span background=\"#%s\"> " \ + "Next: %s in %s%d%s%d </span>"), + satmap->infobgd, + sat->nickname, + cm, m, cs, s); g_object_set (satmap->next, "text", buff, @@ -1905,14 +1905,14 @@ SAT_CFG_INT_MAP_SHADOW_ALPHA); /* create tooltip */ - tooltip = g_strdup_printf("<big><b>%s</b>\n</big>"\ - "<tt>Lon: %5.1f\302\260\n" \ - "Lat: %5.1f\302\260\n" \ - " Az: %5.1f\302\260\n" \ - " El: %5.1f\302\260</tt>", - sat->escapednickname, - sat->ssplon, sat->ssplat, - sat->az, sat->el); + tooltip = g_markup_printf_escaped("<big><b>%s</b>\n</big>"\ + "<tt>Lon: %5.1f\302\260\n" \ + "Lat: %5.1f\302\260\n" \ + " Az: %5.1f\302\260\n" \ + " El: %5.1f\302\260</tt>", + sat->nickname, + sat->ssplon, sat->ssplat, + sat->az, sat->el); /* create satellite marker and label + shadows. We create shadows first */ obj->shadowm = goo_canvas_rect_model_new (root, @@ -2097,16 +2097,16 @@ /* we update tooltips every time */ aosstr = aoslos_time_to_str(satmap, sat); - tooltip = g_strdup_printf("<big><b>%s</b>\n</big>"\ - "<tt>Lon: %5.1f\302\260\n" \ - "Lat: %5.1f\302\260\n" \ - " Az: %5.1f\302\260\n" \ - " El: %5.1f\302\260\n" \ - "%s</tt>", - sat->escapednickname, - sat->ssplon, sat->ssplat, - sat->az, sat->el, - aosstr); + tooltip = g_markup_printf_escaped("<big><b>%s</b>\n</big>"\ + "<tt>Lon: %5.1f\302\260\n" \ + "Lat: %5.1f\302\260\n" \ + " Az: %5.1f\302\260\n" \ + " El: %5.1f\302\260\n" \ + "%s</tt>", + sat->nickname, + sat->ssplon, sat->ssplat, + sat->az, sat->el, + aosstr); g_object_set (obj->marker, "tooltip", tooltip, NULL); g_object_set (obj->label, "tooltip", tooltip, NULL); g_free (tooltip); @@ -2310,12 +2310,12 @@ /* if satellite appears to be GEO don't attempt to show AOS/LOS */ if (isgeo) { if (sat->el > 0.0) { - text = g_strdup_printf ("<span background=\"#%s\"> %s: Always in range </span>", - satmap->infobgd, sat->escapednickname); + text = g_markup_printf_escaped("<span background=\"#%s\"> %s: Always in range </span>", + satmap->infobgd, sat->nickname); } else { - text = g_strdup_printf ("<span background=\"#%s\"> %s: Always out of range </span>", - satmap->infobgd, sat->escapednickname); + text = g_markup_printf_escaped("<span background=\"#%s\"> %s: Always out of range </span>", + satmap->infobgd, sat->nickname); } } else { @@ -2349,16 +2349,16 @@ cs = g_strdup (":"); if (h > 0) { - text = g_strdup_printf ("<span background=\"#%s\"> "\ - "%s %s in %s%d:%s%d%s%d </span>", - satmap->infobgd, sat->escapednickname, - alsstr, ch, h, cm, m, cs, s); + text = g_markup_printf_escaped("<span background=\"#%s\"> "\ + "%s %s in %s%d:%s%d%s%d </span>", + satmap->infobgd, sat->nickname, + alsstr, ch, h, cm, m, cs, s); } else { - text = g_strdup_printf ("<span background=\"#%s\"> "\ - "%s %s in %s%d%s%d </span>", - satmap->infobgd, sat->escapednickname, - alsstr, cm, m, cs, s); + text = g_markup_printf_escaped("<span background=\"#%s\"> "\ + "%s %s in %s%d%s%d </span>", + satmap->infobgd, sat->nickname, + alsstr, cm, m, cs, s); } g_free (ch); Modified: trunk/src/gtk-single-sat.c =================================================================== --- trunk/src/gtk-single-sat.c 2011-11-23 15:16:36 UTC (rev 960) +++ trunk/src/gtk-single-sat.c 2011-11-23 19:57:19 UTC (rev 961) @@ -268,7 +268,7 @@ /* create header */ sat = SAT (g_slist_nth_data (GTK_SINGLE_SAT (widget)->sats, 0)); - title = g_strdup_printf ("<b>%s</b>", sat ? sat->escapednickname : "noname"); + title = g_markup_printf_escaped("<b>%s</b>", sat ? sat->nickname : "noname"); GTK_SINGLE_SAT (widget)->header = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (GTK_SINGLE_SAT (widget)->header), title); g_free (title); @@ -370,7 +370,7 @@ __FUNCTION__, catnum); return; } - title = g_strdup_printf ("<b>%s</b>", sat->escapednickname); + title = g_markup_printf_escaped("<b>%s</b>", sat->nickname); gtk_label_set_markup (GTK_LABEL (ssat->header), title); g_free (title); @@ -825,7 +825,7 @@ menuitem = gtk_image_menu_item_new (); label = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); - buff = g_strdup_printf ("<b>%s</b>", sat->escapednickname); + buff = g_markup_printf_escaped("<b>%s</b>", sat->nickname); gtk_label_set_markup (GTK_LABEL (label), buff); g_free (buff); gtk_container_add (GTK_CONTAINER (menuitem), label); @@ -921,7 +921,7 @@ sat = SAT (g_slist_nth_data (ssat->sats, i)); - title = g_strdup_printf ("<b>%s</b>", sat->escapednickname); + title = g_markup_printf_escaped("<b>%s</b>", sat->nickname); gtk_label_set_markup (GTK_LABEL (ssat->header), title); g_free (title); Modified: trunk/src/sat-info.c =================================================================== --- trunk/src/sat-info.c 2011-11-23 15:16:36 UTC (rev 960) +++ trunk/src/sat-info.c 2011-11-23 19:57:19 UTC (rev 961) @@ -97,7 +97,7 @@ gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); label = gtk_label_new (NULL); - str = g_strdup_printf (_("<b>%s</b>"), sat->escapednickname); + str = g_markup_printf_escaped (_("<b>%s</b>"), sat->nickname); gtk_label_set_markup (GTK_LABEL (label), str); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 0, 1); Modified: trunk/src/sgpsdp/sgp4sdp4.h =================================================================== --- trunk/src/sgpsdp/sgp4sdp4.h 2011-11-23 15:16:36 UTC (rev 960) +++ trunk/src/sgpsdp/sgp4sdp4.h 2011-11-23 19:57:19 UTC (rev 961) @@ -156,7 +156,6 @@ typedef struct { char *name; char *nickname; - char *escapednickname; char *website; tle_t tle; /*!< Keplerian elements */ int flags; /*!< Flags for algo ctrl */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |