genius r684 - in trunk: . src



Author: jirka
Date: Tue Nov  4 06:20:06 2008
New Revision: 684
URL: http://svn.gnome.org/viewvc/genius?rev=684&view=rev

Log:

Tue Nov 04 00:19:54 2008  Jiri (George) Lebl <jirka 5z com>

	* src/gnome-genius.c: fix warning

	* src/graphing.c: fix warning, handle error on print command, fix
	  bad labling of functions if some functions cannot be parsed or are
	  empty.



Modified:
   trunk/ChangeLog
   trunk/src/gnome-genius.c
   trunk/src/graphing.c

Modified: trunk/src/gnome-genius.c
==============================================================================
--- trunk/src/gnome-genius.c	(original)
+++ trunk/src/gnome-genius.c	Tue Nov  4 06:20:06 2008
@@ -483,8 +483,8 @@
 	ret = gtk_dialog_run (GTK_DIALOG (d));
 
 	if (ret == GTK_RESPONSE_OK) {
-		txt = gtk_entry_get_text (GTK_ENTRY (e));
-		txt = g_strdup (ve_sure_string (txt));
+		const char *t = gtk_entry_get_text (GTK_ENTRY (e));
+		txt = g_strdup (ve_sure_string (t));
 	}
 
 	gtk_widget_destroy (d);

Modified: trunk/src/graphing.c
==============================================================================
--- trunk/src/graphing.c	(original)
+++ trunk/src/graphing.c	Tue Nov  4 06:20:06 2008
@@ -567,8 +567,18 @@
 
 	{
 		char *cmdstring = g_strdup_printf ("cat %s | %s", tmpfile, last_cmd);
-		system (cmdstring);
+		errno = 0;
+		if (system (cmdstring) < 0) {
+			char *err = g_strdup_printf (
+			_("Printing failed: %s"), 
+				      g_strerror (errno));
+			genius_display_error (graph_window, err);
+			g_free (err);
+		}
+
+
 		g_free (cmdstring);
+
 	}
 
 	plot_in_progress --;
@@ -3172,7 +3182,8 @@
 						 "x",
 						 &ex);
 			if (f != NULL) {
-				func[funcs++] = f;
+				func[i] = f;
+				funcs++;
 			}
 		}
 	} else {
@@ -3257,12 +3268,16 @@
 	line_plot_clear_funcs ();
 
 	if (function_page == 0) {
-		for (i = 0; i < MAXFUNC && func[i] != NULL; i++) {
-			plot_func[i] = func[i];
-			func[i] = NULL;
-			/* setup name when the functions don't have their own name */
-			if (plot_func[i]->id == NULL)
-				plot_func_name[i] = g_strdup (gtk_entry_get_text (GTK_ENTRY (plot_entries[i])));
+		int j = 0;
+		for (i = 0; i < MAXFUNC; i++) {
+			if (func[i] != NULL) {
+				plot_func[j] = func[i];
+				func[i] = NULL;
+				/* setup name when the functions don't have their own name */
+				if (plot_func[j]->id == NULL)
+					plot_func_name[j] = g_strdup (gtk_entry_get_text (GTK_ENTRY (plot_entries[i])));
+				j++;
+			}
 		}
 
 		plot_mode = MODE_LINEPLOT;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]