more work on datasets dataset
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 13 Mar 2016 17:36:23 +0000 (10:36 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 13 Mar 2016 17:36:23 +0000 (10:36 -0700)
src/data/dataset.c
src/data/dataset.h
src/data/session.c
src/ui/gui/psppire-output-window.c

index 7a5a6a4a6a08a22749baf5340b9e71d709d66c51..7972a5ddcc75889586a9cd44fe09a4a56388edca 100644 (file)
@@ -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);
+    }
 }
index ce8b980d2e69c1cbc6207bd7c3ce8dc3b77a3c23..17602130033b3b465eb3f2887a98366e1fe7a806 100644 (file)
@@ -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;
 \f
 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 *);
 
index ae37c76b945c8ae9c69288313f69db41d5b24c15..6dc1334cf206d3f9bddfdbb2626003edabe70dc0 100644 (file)
@@ -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);
index 469966af2325adf73faafbba8e29194dcfc7168a..1da4b24673fae15e4d9648ea71d13bd31c81e60e 100644 (file)
@@ -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.")));
 }
 
 \f