starplot: fix build
Closes #10886. Signed-off-by: Enno Boland <gottox@voidlinux.eu>
This commit is contained in:
parent
2c21d507ed
commit
de78c97a1c
|
@ -0,0 +1,89 @@
|
||||||
|
# Description: Fix the 'fail to build from source' problem.
|
||||||
|
# Author: Francisco Manuel Garcia Claramonte <francisco@debian.org>
|
||||||
|
# Last-Update: 26-06-2012
|
||||||
|
|
||||||
|
Index: starplot-0.95.5/src/gui/hrdiagram.cc
|
||||||
|
===================================================================
|
||||||
|
--- src/gui/hrdiagram.cc 2008-04-10 21:14:00.000000000 +0200
|
||||||
|
+++ src/gui/hrdiagram.cc 2012-06-26 21:16:14.000000000 +0200
|
||||||
|
@@ -29,7 +29,7 @@
|
||||||
|
/* Functions to make sure the HR Diagram window stays updated */
|
||||||
|
|
||||||
|
namespace globals {
|
||||||
|
- static GtkWidget *program_hr_window = NULL;
|
||||||
|
+ GtkWidget *program_hr_window = NULL;
|
||||||
|
static GdkPixmap *program_hr_pixmap = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -88,6 +88,7 @@
|
||||||
|
delete globals::program_hr_viewer;
|
||||||
|
globals::program_hr_viewer = NULL;
|
||||||
|
gtk_widget_destroy(globals::program_hr_window);
|
||||||
|
+ globals::program_hr_window = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -254,8 +255,7 @@
|
||||||
|
hr_options_label_widgets[i] = item;
|
||||||
|
|
||||||
|
if ((GTK_CHECK_MENU_ITEM (options_label_widgets[i]))->active)
|
||||||
|
- set_item(&globals::chart_rules.StarLabels,
|
||||||
|
- globals::chart_rules.StarLabels, item, false);
|
||||||
|
+ set_label_item(globals::chart_rules.StarLabels, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < OPTIONS_DIAMETER_MENU_SIZE; i++) {
|
||||||
|
@@ -265,8 +265,7 @@
|
||||||
|
hr_options_diameter_widgets[i] = item;
|
||||||
|
|
||||||
|
if ((GTK_CHECK_MENU_ITEM (options_diameter_widgets[i]))->active)
|
||||||
|
- set_item(&globals::chart_rules.StarDiameters,
|
||||||
|
- globals::chart_rules.StarDiameters, item, false);
|
||||||
|
+ set_diameter_item(globals::chart_rules.StarDiameters, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (menubar) {
|
||||||
|
Index: starplot-0.95.5/src/gui/menuops.cc
|
||||||
|
===================================================================
|
||||||
|
--- src/gui/menuops.cc 2008-04-11 20:46:31.000000000 +0200
|
||||||
|
+++ src/gui/menuops.cc 2012-06-26 21:19:21.000000000 +0200
|
||||||
|
@@ -305,10 +305,12 @@
|
||||||
|
{
|
||||||
|
if (globals::chart_rules.StarLabels == l) return;
|
||||||
|
|
||||||
|
- if (globals::program_hr_viewer) {
|
||||||
|
+ if (globals::program_hr_window) {
|
||||||
|
set_item(&globals::chart_rules.StarLabels, l,
|
||||||
|
hr_options_label_widgets[l], false);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (globals::chart_rules.StarLabels == l) return;
|
||||||
|
set_item(&globals::chart_rules.StarLabels, l,
|
||||||
|
options_label_widgets[l], redraw);
|
||||||
|
}
|
||||||
|
@@ -322,10 +324,12 @@
|
||||||
|
{
|
||||||
|
if (globals::chart_rules.StarDiameters == d) return;
|
||||||
|
|
||||||
|
- if (globals::program_hr_viewer) {
|
||||||
|
+ if (globals::program_hr_window) {
|
||||||
|
set_item(&globals::chart_rules.StarDiameters, d,
|
||||||
|
hr_options_diameter_widgets[d], false);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (globals::chart_rules.StarDiameters == d) return;
|
||||||
|
set_item(&globals::chart_rules.StarDiameters, d,
|
||||||
|
options_diameter_widgets[d], redraw);
|
||||||
|
}
|
||||||
|
Index: starplot-0.95.5/src/gui/starplot.h
|
||||||
|
===================================================================
|
||||||
|
--- src/gui/starplot.h 2008-04-10 21:13:07.000000000 +0200
|
||||||
|
+++ src/gui/starplot.h 2012-06-26 21:20:31.000000000 +0200
|
||||||
|
@@ -134,6 +134,7 @@
|
||||||
|
extern GTKViewer *program_viewer; // The GTKViewer used by StarPlot
|
||||||
|
extern GtkWidget *program_canvas; // The GTK_DRAWING_AREA used
|
||||||
|
extern GdkPixmap *program_pixmap; // The backing pixmap
|
||||||
|
+ extern GtkWidget *program_hr_window; // HR Diagram GTK_WINDOW
|
||||||
|
extern GTKViewer *program_hr_viewer; // HR Diagram GTKViewer
|
||||||
|
extern GtkWidget *program_hr_canvas; // HR Diagram GTK_DRAWING_AREA
|
||||||
|
extern GdkPixbuf *program_icon; // used by the window manager
|
|
@ -0,0 +1,40 @@
|
||||||
|
Index: starplot-0.95.5/src/convert/convert.cc
|
||||||
|
===================================================================
|
||||||
|
--- src/convert/convert.cc
|
||||||
|
+++ src/convert/convert.cc
|
||||||
|
@@ -49,7 +49,7 @@ void parse_star_file(istream & infile, o
|
||||||
|
bool using_stdout, bool add_sun)
|
||||||
|
{
|
||||||
|
int lineno = 0;
|
||||||
|
- bool sun_found = false, moredata = true;
|
||||||
|
+ bool sun_found = false;
|
||||||
|
char record[1000];
|
||||||
|
Star * tempstar = 0, * currentstar = 0, * previousstar = 0;
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ available on the StarPlot web page, you
|
||||||
|
in that package for more information.") << endl << endl;
|
||||||
|
|
||||||
|
do {
|
||||||
|
- moredata = infile.getline(record, 999, '\n');
|
||||||
|
+ infile.getline(record, 999, '\n');
|
||||||
|
record[999] = 0;
|
||||||
|
|
||||||
|
// $ ; and , have special meanings to StarPlot, so purge them:
|
||||||
|
@@ -73,7 +73,7 @@ in that package for more information.")
|
||||||
|
record[i] = ' ';
|
||||||
|
|
||||||
|
tempstar = parse_star_record(record, format);
|
||||||
|
- if (tempstar || !moredata) {
|
||||||
|
+ if (tempstar || infile.eof()) {
|
||||||
|
delete previousstar;
|
||||||
|
previousstar = currentstar;
|
||||||
|
currentstar = tempstar;
|
||||||
|
@@ -111,7 +111,7 @@ in that package for more information.")
|
||||||
|
if (!using_stdout && !(lineno % 1000))
|
||||||
|
cout << starstrings::ssprintf(_("%d records converted."), lineno) << endl;
|
||||||
|
|
||||||
|
- } while (moredata) ;
|
||||||
|
+ } while (!infile.eof()) ;
|
||||||
|
|
||||||
|
delete previousstar;
|
||||||
|
|
Loading…
Reference in New Issue