From: Ben Pfaff Date: Sun, 13 Mar 2016 17:36:23 +0000 (-0700) Subject: more work on datasets X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=a7db48f8f93e7262209e130dbaf876d88e22d087 more work on datasets --- diff --git a/src/data/dataset.c b/src/data/dataset.c index 7a5a6a4a6a..7972a5ddcc 100644 --- a/src/data/dataset.c +++ b/src/data/dataset.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2013 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2013, 2016 Free Software Foundation, Inc. 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 @@ -267,10 +267,12 @@ dataset_set_session (struct dataset *ds, struct session *session) { if (session != ds->session) { + dataset_ref (ds); if (ds->session != NULL) session_remove_dataset (ds->session, ds); if (session != NULL) session_add_dataset (session, ds); + dataset_unref (ds); } } @@ -974,5 +976,12 @@ dataset_transformations_changed__ (struct dataset *ds, bool non_empty) void dataset_set_session__ (struct dataset *ds, struct session *session) { - ds->session = session; + if (ds->session != session) + { + if (ds->session) + dataset_unref (ds->session); + ds->session = session; + if (session) + dataset_ref (session); + } } diff --git a/src/data/dataset.h b/src/data/dataset.h index ce8b980d2e..1760213003 100644 --- a/src/data/dataset.h +++ b/src/data/dataset.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2013 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2013, 2016 Free Software Foundation, Inc. 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 @@ -29,7 +29,8 @@ struct session; struct dataset *dataset_create (struct session *, const char *); struct dataset *dataset_clone (struct dataset *, const char *); -void dataset_destroy (struct dataset *); +void dataset_unref (struct dataset *); +struct dataset *dataset_ref (const struct dataset *); void dataset_clear (struct dataset *); diff --git a/src/data/session.c b/src/data/session.c index ae37c76b94..6dc1334cf2 100644 --- a/src/data/session.c +++ b/src/data/session.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2010, 2011, 2012, 2013 Free Software Foundation, Inc. + Copyright (C) 2010, 2011, 2012, 2013, 2016 Free Software Foundation, Inc. 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 @@ -68,7 +68,7 @@ session_destroy (struct session *s) s->active = NULL; HMAPX_FOR_EACH_SAFE (ds, node, next, &s->datasets) - dataset_destroy (ds); + dataset_unref (ds); hmapx_destroy (&s->datasets); free (s->syntax_encoding); free (s); diff --git a/src/ui/gui/psppire-output-window.c b/src/ui/gui/psppire-output-window.c index 469966af23..1da4b24673 100644 --- a/src/ui/gui/psppire-output-window.c +++ b/src/ui/gui/psppire-output-window.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation + Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2016 Free Software Foundation 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 @@ -182,6 +182,15 @@ psppire_output_window_setup (void) output_driver_init (d, &psppire_output_class, "PSPPIRE", SETTINGS_DEVICE_UNFILTERED); output_driver_register (d); + + text_item_submit ( + text_item_create (TEXT_ITEM_PARAGRAPH, + _("This is a development version of PSPP. Please be " + "alert to the likely possibility that it contains " + "more bugs than a PSPP release. If you encounter " + "bugs, please consider reporting them to the PSPP " + "developers at bug-gnu-pspp@gnu.org, to enable them " + "to be fixed."))); }